Mattsson
6ea92f3152
feat(zettle): sync paid purchases into webshop_orders ( #2445 )
...
Community PR #2416 by @olofpinzke, adopted and finished by maintainers (rebased so every commit is signed).
Why the problem occurred: no Zettle integration; POS sales only reached the books as bank descriptors while Woo/Shopify already had order underlag via webshop_orders. The contributor's version also failed at the database (platform CHECKs listed only woocommerce/shopify), which the mocked unit tests never saw.
What was simplified: reused the Orders/book/invoice path instead of a new inbox; Finance API payouts/fees deferred. Sales the one-account, revenue-per-rate model cannot book (split tender, gift cards, tips) import unbookable with a "bokför manuellt" title instead of guessing accounts. Reset parity uses the rename-and-wrap pattern instead of re-issuing the reset body.
Why this solution: per-purchase rows give the radunderlag BFL verifikat need and the bulk-book path exists; daily kassarapport aggregation and Finance API fees/payouts are the follow-up (DECISIONS.md). Skeptic-refuted paths fixed before merge: concurrent refresh-token rotation (sync claim), cron offset paging (candidate snapshot), platform CHECKs, writer-role gate, migration-reset parity, white-label return origin re-validated at callback, VAT net from product rows.
Not live until ZETTLE_CLIENT_ID / ZETTLE_CLIENT_SECRET / ZETTLE_CREDENTIALS_ENCRYPTION_KEY are set on Vercel and a Zettle developer app is registered with the callback redirect URI.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01WtYqzKPoTSRHskYYdf7MwB
2026-09-09 11:19:39 +02:00
..
2026-09-02 18:14:32 +02:00
2026-07-24 16:36:35 +02:00
2026-07-03 16:50:28 +02:00
2026-08-25 09:34:05 +02:00
2026-08-24 14:07:58 +02:00
2026-08-06 23:00:05 +02:00
2026-07-04 15:58:06 +02:00
2026-07-04 15:58:06 +02:00
2026-07-26 17:48:18 +02:00
2026-08-03 15:41:01 +02:00
2026-07-21 23:00:15 +02:00
2026-09-02 11:38:30 +02:00
2026-07-04 15:58:06 +02:00
2026-08-26 09:58:25 +02:00
2026-07-04 15:58:06 +02:00
2026-07-16 16:00:05 +02:00
2026-08-06 23:00:05 +02:00
2026-08-15 23:07:29 +02:00
2026-09-08 14:14:51 +02:00
2026-09-02 15:25:34 +02:00
2026-08-03 15:41:01 +02:00
2026-08-25 09:34:05 +02:00
2026-08-28 12:12:47 +02:00
2026-08-03 18:55:59 +02:00
2026-09-05 10:42:14 +02:00
2026-08-27 18:32:52 +02:00
2026-08-26 16:56:39 +02:00
2026-07-04 15:58:06 +02:00
2026-07-27 03:34:56 +02:00
2026-08-25 10:32:12 +02:00
2026-08-06 23:00:05 +02:00
2026-08-26 16:56:39 +02:00
2026-09-04 06:45:56 +02:00
2026-07-11 23:13:50 +02:00
2026-08-21 15:55:26 +02:00
2026-08-04 19:34:54 +02:00
2026-08-06 23:00:05 +02:00
2026-07-04 15:58:06 +02:00
2026-09-02 11:38:30 +02:00
2026-07-04 15:58:06 +02:00
2026-09-09 11:19:39 +02:00
2026-09-06 18:55:42 +02:00
2026-08-31 20:51:17 +02:00
2026-09-02 20:57:57 +02:00
2026-08-25 12:41:02 +02:00
2026-07-27 03:34:56 +02:00
2026-07-27 03:34:56 +02:00
2026-07-28 19:50:16 +02:00
2026-09-09 11:19:39 +02:00
2026-07-10 11:05:40 +02:00
2026-09-02 18:14:49 +02:00
2026-07-04 15:58:06 +02:00
2026-08-24 17:05:00 +02:00
2026-07-04 15:58:06 +02:00
2026-07-04 15:58:06 +02:00
2026-07-04 15:58:06 +02:00
2026-09-01 14:23:05 +02:00
2026-08-25 15:15:33 +02:00
2026-07-27 03:34:56 +02:00
2026-07-28 18:34:55 +02:00
2026-07-13 22:54:33 +02:00
2026-09-04 16:44:45 +02:00
2026-07-13 22:54:33 +02:00
2026-09-04 17:01:34 +02:00
2026-09-05 13:36:51 +02:00
2026-09-06 21:17:46 +02:00
2026-07-04 15:58:06 +02:00
2026-07-21 23:00:15 +02:00
2026-09-08 14:47:50 +02:00
2026-07-27 03:34:56 +02:00
2026-08-28 23:51:27 +02:00
2026-08-06 23:00:05 +02:00
2026-08-06 23:00:05 +02:00
2026-08-30 11:56:15 +02:00
2026-09-03 20:47:24 +02:00
2026-05-12 13:12:17 +02:00
2026-08-28 17:45:10 +02:00
2026-08-31 16:01:11 +02:00
2026-08-19 20:09:23 +02:00
2026-08-25 17:03:57 +02:00
2026-08-03 17:56:37 +02:00
2026-09-02 08:50:42 +02:00
2026-08-13 23:57:53 +02:00
2026-09-03 19:42:43 +02:00
2026-09-06 21:04:53 +02:00
2026-07-04 15:58:06 +02:00
2026-09-04 06:45:56 +02:00
2026-08-17 21:36:16 +02:00
2026-07-04 15:58:06 +02:00
2026-08-13 16:53:19 +02:00
2026-09-03 18:21:00 +02:00
2026-08-06 23:00:05 +02:00
2026-09-05 09:43:00 +02:00
2026-08-30 16:54:35 +02:00
2026-08-06 23:00:05 +02:00
2026-08-10 12:23:42 +02:00
2026-07-23 16:16:55 +02:00
2026-08-17 22:20:52 +02:00
2026-08-24 13:19:32 +02:00
2026-07-04 15:58:06 +02:00
2026-07-29 18:15:06 +02:00
2026-09-01 11:29:12 +02:00
2026-09-03 19:39:56 +02:00
2026-08-20 10:27:52 +02:00
2026-07-04 15:58:06 +02:00
2026-09-07 16:43:38 +02:00
2026-06-08 09:47:33 +02:00
2026-09-02 17:33:30 +02:00
2026-09-02 14:33:45 +02:00
2026-09-03 19:49:25 +02:00
2026-09-02 18:18:35 +02:00
2026-09-03 19:49:25 +02:00
2026-09-03 19:49:25 +02:00
2026-09-04 17:01:10 +02:00
2026-07-04 15:58:06 +02:00
2026-08-13 23:12:27 +02:00
2026-07-22 18:30:33 +02:00
2026-07-22 18:33:49 +02:00
2026-08-31 08:39:04 +01:00
2026-08-13 15:55:01 +02:00
2026-07-27 03:34:56 +02:00
2026-07-27 03:34:56 +02:00
2026-08-21 17:27:45 +02:00
2026-08-13 19:44:32 +02:00
2026-08-21 16:56:32 +02:00
2026-09-01 14:14:09 +02:00
2026-08-29 00:29:11 +02:00
2026-08-28 22:12:20 +02:00
2026-09-08 18:29:37 +02:00
2026-09-03 20:16:59 +02:00
2026-09-06 19:45:03 +02:00
2026-09-06 19:59:32 +02:00
2026-07-04 15:58:06 +02:00
2026-09-04 18:49:23 +02:00
2026-07-23 16:16:55 +02:00
2026-07-03 13:57:59 +02:00
2026-07-12 19:14:12 +02:00
2026-05-26 22:29:41 +02:00
2026-07-03 13:57:59 +02:00
2026-09-04 14:33:41 +02:00
2026-09-08 00:13:05 +02:00
2026-07-05 03:05:09 +02:00
2026-09-05 09:49:21 +02:00
2026-07-05 03:05:09 +02:00
2026-09-02 18:14:49 +02:00
2026-09-01 14:14:45 +02:00
2026-09-05 10:42:14 +02:00
2026-09-05 10:42:14 +02:00
2026-09-02 11:38:30 +02:00
2026-09-02 11:38:30 +02:00
2026-07-04 15:58:06 +02:00
2026-06-04 13:14:57 +02:00
2026-07-27 03:34:56 +02:00
2026-08-09 12:44:08 +02:00
2026-07-21 16:54:14 +02:00
2026-07-12 19:14:12 +02:00
2026-08-14 08:21:57 +02:00
2026-07-12 19:14:12 +02:00
2026-07-09 12:19:57 +02:00
2026-09-05 09:43:00 +02:00
2026-09-06 21:05:43 +02:00
2026-09-05 09:43:00 +02:00
2026-08-03 18:49:46 +02:00
2026-09-04 17:19:18 +02:00
2026-09-01 14:29:47 +02:00
2026-07-21 23:00:15 +02:00
2026-08-04 11:43:58 +02:00
2026-08-26 16:56:39 +02:00
2026-07-04 15:58:06 +02:00
2026-07-04 15:58:06 +02:00
2026-05-06 10:24:57 +02:00
2026-08-13 23:12:27 +02:00
2026-08-08 11:58:51 +02:00
2026-09-09 11:19:39 +02:00
2026-08-15 19:50:32 +02:00
2026-09-06 19:04:30 +02:00
2026-09-06 21:17:46 +02:00
2026-08-13 16:53:19 +02:00
2026-08-30 11:51:27 +02:00
2026-08-06 23:00:05 +02:00
2026-08-06 23:00:05 +02:00
2026-09-06 16:20:42 +02:00
2026-09-08 00:13:05 +02:00
2026-08-25 14:23:56 +02:00
2026-08-05 15:47:23 +02:00
2026-08-05 15:27:00 +02:00
2026-09-07 15:54:28 +02:00
2026-09-09 11:19:39 +02:00