@fleetless/contracts 15.6.0-next.1 → 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,66 @@ 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
+
70
+ ## [15.6.0] — 2026-11-18
71
+
12
72
  ### Added
13
73
 
14
74
  - **`plan_purchase_closed`, and `paid_plans` on the org's plan**
@@ -16,15 +76,18 @@ version.
16
76
  organizations Fleetless has unlocked for them. A new `403` code,
17
77
  `plan_purchase_closed`, is listed on the six routes that refuse an org
18
78
  that is not unlocked: `POST /api/billing/checkout`,
19
- `POST /api/billing/intents/:id/display` and `/confirm`,
79
+ `POST /api/billing/intents/:id/display`, `/confirm` of a checkout or paid
80
+ change,
20
81
  `POST /api/billing/change`, and `POST /api/org/plan/change/prepare` and
21
82
  `PUT /api/org/plan/change` when the target is not Basic. Cancel, resume,
22
- the details, the payment method, invoices, charges, the documents, the
23
- checkout poll and `DELETE /api/org/plan/change` never answer it.
83
+ the details, the payment method, invoices, charges (their confirm
84
+ included), the documents, the checkout poll and `DELETE /api/org/plan/change` never answer it.
24
85
  - `orgPlan.paid_plans`, required, `open` or `closed`: `closed` exactly when
25
86
  those routes answer `plan_purchase_closed` for this org. A consumer that
26
87
  builds an `orgPlan` by hand adds the field; one that parses the cloud's
27
- answer reads it.
88
+ answer reads it. It travels wherever `orgPlan` does: `GET`, `PUT` and
89
+ `DELETE /api/org/plan/change`'s answers, the accepted `result` of the
90
+ decision lookup, and `PATCH /api/admin/orgs/:id/plan`.
28
91
 
29
92
  ## [15.5.0] — 2026-11-14
30
93