@fleetless/contracts 15.6.0 → 16.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,64 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ### Changed
13
+
14
+ - **BREAKING: one consent sentence and one button label per C.4 action**
15
+ (fleetless/fleetless#1168). `billingDecisionSnapshot.declaration` gains a
16
+ required `action_label`, and `text_id` is one of `C4_TEXT_IDS`, one per
17
+ action in `C4_ACTIONS`: `checkout` (`Pay 34,51 € with Mollie`),
18
+ `pay_and_switch` (`Pay 95 € and switch`), `switch` (`Switch to Pro`),
19
+ `schedule_switch` (`Switch to monthly at period end`),
20
+ `schedule_downgrade` (`Schedule downgrade to Plus`) and `cancel`
21
+ (`Cancel at period end`). The snapshot parses only when `text` and
22
+ `action_label` are exactly what `c4Declaration` writes for its own action,
23
+ amounts, plan, cycle and organization. The single `Order and pay` sentence
24
+ (`DR-1374-draft-3-C.4`) no longer parses as a new display. A producer builds
25
+ the declaration with `c4Declaration(c4ActionOf(snapshot, from), …)`; a
26
+ client renders `text` above one button labelled `action_label`. A snapshot
27
+ stored before this release reads with `storedBillingDecisionSnapshot`.
28
+ - **BREAKING: `POST /api/billing/checkout` answers `checkoutStartResponse`**
29
+ instead of `checkoutResponse`. The start decides in the request: `eligible`
30
+ carries the frozen quote and its C.4 display (`display`, a
31
+ `billingDecisionDisplayResponse` for this intent), so the one click on its
32
+ button confirms with the display's proof; `vies_unavailable`,
33
+ `invalid_vat_id` and `refused` carry no intent, since nothing is stored;
34
+ `held` only with `issuer_cutover_in_progress`; `payment_started` replays a
35
+ confirmed key, hosted only. A checkout never answers `awaiting_vies`. A
36
+ consumer that read `checkoutResponse` from the start reads the new union;
37
+ `checkoutResponse` stays the answer of the invoice, charge and
38
+ payment-method routes.
39
+ - **BREAKING: `purchaseHoldReason` shrinks** to `legacy_usd_invoice`,
40
+ `legacy_payer_unresolved`, `mandate_policy_unresolved` and
41
+ `issuer_cutover_in_progress`. `lexware_contact_pending`,
42
+ `lexware_contact_changed` and `lexware_issuance_paused` are gone: Lexware's
43
+ contact and invoice follow the payment and never hold a purchase.
44
+ - **BREAKING: a paid change never waits for VIES.** `billingChangeResponse`'s
45
+ draft has no `awaiting_vies` variant; when VIES does not answer, the change
46
+ is refused with `viesUnavailableDetails` and nothing is stored.
47
+ - The notes of the checkout start, the display, the confirm and
48
+ `POST /api/billing/change` describe the one-click flow, a fresh operation
49
+ key per press, `display_stale`, the open payment's `checkout_url` and the
50
+ two VIES refusals of a paid change.
51
+
52
+ ### Added
53
+
54
+ - **`GET /api/billing/checkout-draft`** (Owner tier) answers
55
+ `checkoutDraftResponse`: the last checkout start's body as `draft`, or else
56
+ the org's earlier billing details as `prefill`, or both `null`
57
+ (fleetless/fleetless#1168).
58
+ - `formatEur(cents)`: money as the console writes it, `34,51 €` and `29 €`.
59
+ - `c4ActionOf(snapshot, from?)` and `c4Declaration(action, values)`, with
60
+ the types `C4Action`, `C4TextId`, `C4DeclarationText`,
61
+ `C4DeclarationValues`, `C4Decision` and `C4From`.
62
+ - `storedBillingDecisionSnapshot`: also reads the legacy declaration without
63
+ `action_label`, for stored displays and replays only.
64
+ - `checkoutOpenDetails` (`409` rule `checkout_open`, now with
65
+ `checkout_url` to continue the open payment), `viesUnavailableDetails`
66
+ (`409` rule `vies_unavailable` on `POST /api/billing/change`) and
67
+ `purchaseConflictDetails`'s `{ field: 'confirmation_proof', rule:
68
+ 'display_stale' }` for a spent, expired or stale display.
69
+
12
70
  ## [15.6.0] — 2026-11-18
13
71
 
14
72
  ### Added