1.9 KiB
1.9 KiB
Documenter — F-017 Pricing module
Summary
Documented F-017 pricing behavior in this evidence artifact. Project README updates are not applied during document stage because the active repository guard restricts project/ product edits to build/implementer state.
Public API notes
Pricing owns server-side price and VAT truth for product variants. Callers provide variant identity and quantity only; client-supplied prices, tax amounts, discounts, subtotals, or totals are not trusted.
| Route | Access | Result |
|---|---|---|
| GET /pricing/variants/:variantId | public | 200 current server-side variant price |
| PUT /pricing/variants/:variantId | admin only | 200 updated price and history row written |
| POST /pricing/calculate | public | 200 calculated net subtotal, VAT and total |
Error codes
PRICING_PRICE_NOT_FOUND— HTTP 404INVALID_PRICE— HTTP 422
Money and VAT rules
- Money is represented as integer cents only.
- Currency is fixed to
EUR. - Stored price is
netUnitAmountCentsbefore VAT. - VAT rates:
general= 21% (2100basis points)reduced= 10% (1000basis points)
- Calculation:
netSubtotal = netUnitAmountCents * quantity;vatAmount = round(netSubtotal * vatBps / 10000);total = netSubtotal + vatAmount.
Audit/history
- Current price lives in
pricing_variant_prices. - Every create/update writes an append-only row to
pricing_price_historywith previous and new values. - Variant ids are opaque UUIDs; pricing does not import catalog internals or join catalog tables.
Evidence
work/artifacts/F-017/architect.mdwork/artifacts/F-017/implementer.mdwork/artifacts/F-017/reviewer.jsonwork/artifacts/F-017/security.jsonwork/artifacts/F-017/qa.json