@fleetless/contracts 6.2.0-next.2 → 6.3.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 +42 -0
- package/artifacts/openapi.json +4322 -1887
- package/artifacts/routes.json +326 -2
- package/artifacts/schema/billing-address.schema.json +49 -0
- package/artifacts/schema/billing-cancel-request.schema.json +12 -0
- package/artifacts/schema/billing-change-request.schema.json +60 -0
- package/artifacts/schema/billing-change-response.schema.json +765 -0
- package/artifacts/schema/billing-details-update.schema.json +25 -0
- package/artifacts/schema/billing-details.schema.json +176 -0
- package/artifacts/schema/billing-invoice.schema.json +76 -0
- package/artifacts/schema/billing-view.schema.json +671 -0
- package/artifacts/schema/checkout-request.schema.json +252 -0
- package/artifacts/schema/checkout-response.schema.json +22 -0
- package/artifacts/schema/checkout-status.schema.json +49 -0
- package/artifacts/schema/payment-method-change-request.schema.json +19 -0
- package/artifacts/schema/payment-method.schema.json +80 -0
- package/artifacts/schema/payment-provider-unavailable-details.schema.json +29 -0
- package/artifacts/schema/vat-id-check-request.schema.json +22 -0
- package/artifacts/schema/vat-id-check-response.schema.json +36 -0
- package/dist/billing.d.ts +778 -0
- package/dist/billing.js +441 -0
- package/dist/errors.d.ts +17 -5
- package/dist/errors.js +31 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +5 -1
- package/dist/plans.d.ts +9 -9
- package/dist/realtime.d.ts +2 -2
- package/dist/rest.d.ts +3 -3
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +181 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,48 @@ version.
|
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
13
|
|
|
14
|
+
- **Billing.** `src/billing.ts`: `EU_COUNTRIES`, `countryCode`,
|
|
15
|
+
`currencyForCountry`, `normalizeVatId` and `viesCountry`; `vatFor`, who
|
|
16
|
+
may pay and at which VAT rate (Germany 19 %, a company in another EU
|
|
17
|
+
country with a VAT ID VIES confirms 0 % reverse charge, outside the EU
|
|
18
|
+
0 %, everyone else refused with a named rule); the money functions in
|
|
19
|
+
integer cents (`periodNetCents`, `periodDays`, `remainingDays`,
|
|
20
|
+
`prorateCents`, `changeNetCents`, `chargeAmounts`, `checkoutQuote`); and
|
|
21
|
+
the dunning schedule `BILLING_RETRY_DAYS` and `BILLING_LOCK_DAY`.
|
|
22
|
+
- **The billing read model and requests.** `billingView` (the account, the
|
|
23
|
+
payment method on file, the last 24 invoices), `billingAccount`,
|
|
24
|
+
`billingInvoice`, `paymentMethod`, `billingDetails` and `billingAddress`;
|
|
25
|
+
the requests `checkoutRequest`, `vatIdCheckRequest`,
|
|
26
|
+
`billingChangeRequest` (absolute counts, not deltas),
|
|
27
|
+
`billingCancelRequest`, `billingDetailsUpdate` and
|
|
28
|
+
`paymentMethodChangeRequest`; the answers `checkoutResponse`,
|
|
29
|
+
`checkoutStatus`, `vatIdCheckResponse` and `billingChangeResponse`. Each
|
|
30
|
+
has a JSON Schema in `artifacts/schema/`.
|
|
31
|
+
- **The `billing` route section**, twelve routes: `GET /api/billing`, the
|
|
32
|
+
checkout and its status, the VAT-ID check, billing details, changes,
|
|
33
|
+
the payment method, cancel and resume, an invoice's PDF and paying an
|
|
34
|
+
open invoice, all owner-tier; and Mollie's webhook
|
|
35
|
+
(`POST /api/billing/mollie/webhook`, internal, no auth).
|
|
36
|
+
- **`billing_unavailable`** (`503`): this cloud has no payment provider
|
|
37
|
+
configured, so it takes no payments. Retrying does not help.
|
|
38
|
+
- **`payment_provider_unavailable`** (`502`): Mollie did not answer, or
|
|
39
|
+
answered with an error; nothing was charged. `details` is
|
|
40
|
+
`paymentProviderUnavailableDetails` (`provider`, Mollie's HTTP `status`
|
|
41
|
+
or `null` for a timeout). Retrying may work.
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- **`PATCH /api/admin/orgs/:id/plan`** lists `target_state_conflict`: rule
|
|
46
|
+
`billed` when the org has a billing account and the change would touch
|
|
47
|
+
its currency or period.
|
|
48
|
+
- The notes of **`PUT /api/org/plan/change`** and the admin route no longer
|
|
49
|
+
say payment is missing; an upgrade of a billed org goes through the
|
|
50
|
+
billing routes.
|
|
51
|
+
|
|
52
|
+
## [6.2.0] — 2026-10-04
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
14
56
|
- **`file_too_large`** (`413`): one asset file is larger than
|
|
15
57
|
`ASSET_FILE_MAX_BYTES` (one gigabyte, every plan, the URDF included).
|
|
16
58
|
`details` is `fileTooLargeDetails`: `max_bytes` and `size_bytes`, the
|