@fleetless/contracts 6.3.0-next.5 → 6.3.0

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/artifacts/openapi.json +4386 -1883
  3. package/artifacts/routes.json +328 -2
  4. package/artifacts/schema/billing-address.schema.json +49 -0
  5. package/artifacts/schema/billing-cancel-request.schema.json +12 -0
  6. package/artifacts/schema/billing-change-request.schema.json +60 -0
  7. package/artifacts/schema/billing-change-response.schema.json +799 -0
  8. package/artifacts/schema/billing-details-update.schema.json +25 -0
  9. package/artifacts/schema/billing-details.schema.json +176 -0
  10. package/artifacts/schema/billing-invoice.schema.json +76 -0
  11. package/artifacts/schema/billing-view.schema.json +705 -0
  12. package/artifacts/schema/checkout-request.schema.json +252 -0
  13. package/artifacts/schema/checkout-response.schema.json +22 -0
  14. package/artifacts/schema/checkout-status.schema.json +49 -0
  15. package/artifacts/schema/payment-method-change-request.schema.json +19 -0
  16. package/artifacts/schema/payment-method.schema.json +86 -0
  17. package/artifacts/schema/payment-provider-unavailable-details.schema.json +29 -0
  18. package/artifacts/schema/vat-id-check-request.schema.json +22 -0
  19. package/artifacts/schema/vat-id-check-response.schema.json +36 -0
  20. package/dist/billing.d.ts +812 -0
  21. package/dist/billing.js +471 -0
  22. package/dist/errors.d.ts +17 -5
  23. package/dist/errors.js +33 -0
  24. package/dist/index.d.ts +4 -2
  25. package/dist/index.js +5 -1
  26. package/dist/plans.d.ts +9 -9
  27. package/dist/realtime.d.ts +2 -2
  28. package/dist/rest.d.ts +3 -3
  29. package/dist/routes.d.ts +1 -1
  30. package/dist/routes.js +195 -4
  31. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -9,8 +9,53 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [6.3.0] — 2026-10-05
13
+
12
14
  ### Added
13
15
 
16
+ - **Billing.** `src/billing.ts`: `EU_COUNTRIES`, `countryCode`,
17
+ `currencyForCountry`, `normalizeVatId` and `viesCountry`; `vatFor`, who
18
+ may pay and at which VAT rate (Germany 19 %, a company in another EU
19
+ country with a VAT ID VIES confirms 0 % reverse charge, outside the EU
20
+ 0 %, everyone else refused with a named rule); the money functions in
21
+ integer cents (`periodNetCents`, `periodDays`, `remainingDays`,
22
+ `prorateCents`, `changeNetCents`, `chargeAmounts`, `checkoutQuote`); and
23
+ the dunning schedule `BILLING_RETRY_DAYS` and `BILLING_LOCK_DAY`.
24
+ - **The billing read model and requests.** `billingView` (the account, the
25
+ payment method on file, the `payment_method_options` a change may offer
26
+ now, the last 24 invoices), `billingAccount`, `billingInvoice`,
27
+ `paymentMethod`, `billingDetails` and `billingAddress`;
28
+ the requests `checkoutRequest`, `vatIdCheckRequest`,
29
+ `billingChangeRequest` (absolute counts, not deltas),
30
+ `billingCancelRequest`, `billingDetailsUpdate` and
31
+ `paymentMethodChangeRequest`; the answers `checkoutResponse`,
32
+ `checkoutStatus`, `vatIdCheckResponse` and `billingChangeResponse`. Each
33
+ has a JSON Schema in `artifacts/schema/`.
34
+ - **Card, PayPal and Apple Pay.** `paymentMethodKind`
35
+ (`card | paypal | applepay`) is what `paymentMethodChangeRequest` names
36
+ and what `paymentMethod` shows: `applepay` carries the card fields,
37
+ because Mollie stores an Apple Pay mandate as a card mandate. A change
38
+ to Apple Pay may be refused with `400 validation_error`, rule
39
+ `applepay_needs_open_invoice`, where it can only be made while paying an
40
+ open invoice; `payment_method_options` says which applies.
41
+ - **The VAT-ID hold and chargebacks** (descriptions only). A renewal held
42
+ by the VAT ID is a due charge without an invoice number until it is
43
+ paid: `dunning.invoice_id` names it, `failure` is `vat_id_invalid`, and
44
+ `POST /api/billing/invoices/:id/pay` answers `409 target_state_conflict`,
45
+ rule `vat_id_invalid`, while it is held. A charged-back payment is never
46
+ recharged automatically: `next_retry_at` is `null`, `failure` is
47
+ `charged_back`.
48
+ - **The `billing` route section**, twelve routes: `GET /api/billing`, the
49
+ checkout and its status, the VAT-ID check, billing details, changes,
50
+ the payment method, cancel and resume, an invoice's PDF and paying an
51
+ open invoice, all owner-tier; and Mollie's webhook
52
+ (`POST /api/billing/mollie/webhook`, internal, no auth).
53
+ - **`billing_unavailable`** (`503`): this cloud has no payment provider
54
+ configured, so it takes no payments. Retrying does not help.
55
+ - **`payment_provider_unavailable`** (`502`): Mollie did not answer, or
56
+ answered with an error; nothing was charged. `details` is
57
+ `paymentProviderUnavailableDetails` (`provider`, Mollie's HTTP `status`
58
+ or `null` for a timeout). Retrying may work.
14
59
  - **`history_migrating`** (`409`): a slug rename refused while the robot's
15
60
  recorded history is being migrated to a new storage layout. Temporary;
16
61
  nothing is written, and the same request succeeds once the migration has
@@ -19,6 +64,12 @@ version.
19
64
 
20
65
  ### Changed
21
66
 
67
+ - **`PATCH /api/admin/orgs/:id/plan`** lists `target_state_conflict`: rule
68
+ `billed` when the org has a billing account and the change would touch
69
+ its currency or period.
70
+ - The notes of **`PUT /api/org/plan/change`** and the admin route no longer
71
+ say payment is missing; an upgrade of a billed org goes through the
72
+ billing routes.
22
73
  - `POST /api/robots/:id/config/rename-slug`: the summary and notes, and the
23
74
  `renameSlugRequest` doc comment, now say the history moves with the name
24
75
  without rewriting stored samples, and that samples sent under the old slug