@fleetless/contracts 17.0.0-next.1 → 17.0.0-next.2

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
@@ -11,37 +11,26 @@ version.
11
11
 
12
12
  ### Changed
13
13
 
14
- - **BREAKING: a payment-method change starts a payment**
15
- (fleetless/fleetless#1185). `POST /api/billing/payment-method` answers
16
- operation `mandate_setup` in `payment_started` with a hosted payment of
17
- 0.00: redirect to its `checkout_url`. `checkoutResponse`, `purchaseIntent`,
18
- `purchaseIntentPaymentStarted` and `purchaseIntentResponse` admit
19
- `mandate_setup` there, hosted only; an older schema rejects that answer. The
20
- rule "`mandate_setup` if and only if `mandate_policy_unresolved`" is one-way
21
- now: the hold reason still names only a mandate setup (a change stored while
22
- changes were on hold), and a held mandate setup has only that reason, but a
23
- new change is never held. A mandate setup is never `eligible`,
24
- `awaiting_vies`, `invalid_vat_id` or `refused`: nothing is quoted and VIES is
25
- not asked. The same key again answers the same payment; `502
26
- payment_provider_unavailable` resumes under the same key; `409
27
- target_state_conflict` with `{ field: billing, rule: checkout_not_open }`
28
- means the key's payment is finished.
29
- - **`PATCH /api/billing/details` saves only what a purchase would accept.** The
30
- route lists `409 target_state_conflict`; its notes name the refusals, when
31
- VIES is asked and what a saved edit does.
32
- - **`GET /api/billing/intents` lists `409 target_state_conflict` and `502
33
- payment_provider_unavailable`**, which it has answered for a hosted payment
34
- read at the provider. A mandate setup the provider never answered reads as
35
- that `502`.
36
-
37
- ### Added
38
-
39
- - **`billingDetailsConflictDetails`**: the `409` details of
40
- `PATCH /api/billing/details`. `{ field, rule }` with a
41
- `purchaseRefusalRule` for a field a purchase would refuse,
42
- `viesUnavailableDetails` when VIES did not answer, and
43
- `{ field: billing, rule: buyer_changed }` when the details changed
44
- meanwhile. Nothing is saved in any of them.
14
+ - **BREAKING: `vies_unavailable` says which side of VIES was down**
15
+ (fleetless/fleetless#1181). A new `viesOutage` is
16
+ `{ scope: 'member_state' | 'vies', country }`: `member_state` when the VAT
17
+ register of `country` does not answer VIES, `vies` when VIES itself does
18
+ not. `country` is the billing address's country, so Greece is `GR`, never
19
+ VIES's `EL`. Every object that answers `reason: 'vies_unavailable'` now
20
+ carries it as a required `vies_outage`, and refuses it beside
21
+ `vies_unverified` and `vies_identifier_missing`, which are no outage:
22
+ `vatDecision` (`pending`), the purchase intent (`awaiting_vies`, in
23
+ `purchaseIntent`, `purchaseIntentDraft`, `purchaseIntentResponse` and
24
+ `checkoutResponse`), `checkoutStartResponse` (`vies_unavailable`),
25
+ `viesUnavailableDetails` and `vatIdCheckResponse` (`pending`). Each is a
26
+ union on `reason` now, so the rule is in the JSON Schema as well, and
27
+ `viesUnavailableDetails` has no `.shape` any more. These objects are strict:
28
+ a consumer on an older version rejects the new key, and a producer that
29
+ omits it no longer parses.
30
+ - **BREAKING: `vatFor` takes the outage with an `unavailable` verdict.**
31
+ `ViesVerdict`'s `unavailable` is `{ status: 'unavailable', outage }`, and
32
+ `vatFor` returns it as `vies_outage` on the pending decision. `invalid` and
33
+ `unverified` are unchanged.
45
34
 
46
35
  ## [16.0.0] — 2026-11-19
47
36