feat(shop-sales): ledger contracts + docs for consumer PSP sales tracking

platform/order + platform/event gain the sale.paid and refund.issued wire
contracts (per-rate VatBuckets, PSP provider, timestamps) that drive the
ledger's SHOP-/REFUND- vouchers (go-cart-actor 2b819bd). docs/status.md
records the shop-sales + PSP settlement stack (tickets 17 + 18); the
wayfinder ledger tracker gains the two closed tickets and their Decisions
entries. Bumps go-cart-actor + backoffice (PSP float stat).

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
mats committed 2026-08-17 20:01:58 +02:00
1 parent 16655e8dbc
commit 7c2a34cc7a
3 files changed
+107

No files matched your search

+14
View File
@@ -73,6 +73,20 @@ const (
// amount + per-rate VAT split, which the ledger books as the reversal
// voucher (1510 C / 304x D / 261x D per rate).
InvoiceCredited Type = "invoice.credited"
// SalePaid is emitted when a consumer (PSP) order is captured — the
// accounting fact for shop sales: amount + per-rate VAT buckets + payment
// method + capture timestamp. Distinct from InvoiceIssued: invoice orders
// book via invoice.issued, so SalePaid must NOT fire for them. Payload is an
// order.SalePaid (platform/order). Consumer: cmd/ledger (aggregates into the
// daily SHOP- voucher).
SalePaid Type = "sale.paid"
// RefundIssued is emitted when a refund is issued against a captured PSP
// order (refund-order / cancel-order flows). Payload is an
// order.RefundIssued (platform/order): the refund amount + pro-rata VAT
// split. The ledger books the reversal voucher (clearing C / 304x D /
// 261x D per rate), idempotent per refund id. Invoice orders reverse via
// credit notes (invoice.credited), so RefundIssued never fires for them.
RefundIssued Type = "refund.issued"
// Analytics (tracking). Replaces the integer enum 0–6 that finder and