platform-types 1.10.864 → 1.10.865
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/dist/cjs/order.js +5 -2
- package/dist/cjs/purchaseWithdrawal.js +17 -10
- package/dist/order.d.ts +5 -2
- package/dist/order.js +5 -2
- package/dist/purchaseWithdrawal.d.ts +28 -11
- package/dist/purchaseWithdrawal.js +17 -10
- package/package.json +1 -1
package/dist/cjs/order.js
CHANGED
|
@@ -207,8 +207,11 @@ exports.orderFulfilmentProgress = orderFulfilmentProgress;
|
|
|
207
207
|
* direction) and a `readyAt` change are refused. Voiding every shipment lifts
|
|
208
208
|
* it. Nothing was written.
|
|
209
209
|
* - `ORDER_HAS_RETURNS` · 409 — the order carries at least one return and can no
|
|
210
|
-
* longer be edited,
|
|
211
|
-
*
|
|
210
|
+
* longer be edited, un-delivered (`mode: 'delivery'`, `delivered: false`),
|
|
211
|
+
* none of its shipments can be voided, and none of its señas refunded
|
|
212
|
+
* (`mode: 'deposit-refund'`). Also answered by the un-delivery and by a
|
|
213
|
+
* shipment void (`mode: 'shipment-void'`) of an order holding a handed-off
|
|
214
|
+
* purchase withdrawal (`awaiting-goods` or later). Nothing was written.
|
|
212
215
|
* - `ORDER_CANCELLATION_NOT_PROTECTED` · 409 — `mode: 'cancel'` on an order with
|
|
213
216
|
* no cancel guard of the current generation, or with the switch off. Nothing
|
|
214
217
|
* was written.
|
|
@@ -26,11 +26,13 @@ exports.PURCHASE_WITHDRAWAL_VERIFICATION_FAILED = exports.SHOPPER_REQUEST_INTENT
|
|
|
26
26
|
* (`purchase-withdrawal-pending`) until an operator decides.
|
|
27
27
|
* - `declined` — an operator declined it with a typed exemption reason.
|
|
28
28
|
* Terminal.
|
|
29
|
-
* - `accepted` — an operator accepted it
|
|
30
|
-
* dispatch lock is released so the delivery can be recorded.
|
|
31
|
-
* `accepted` withdrawal again once its order is delivered, while
|
|
32
|
-
* `purchase-withdrawal` RMA names it, hands it off as below. That also
|
|
33
|
-
* a row accepted after delivery
|
|
29
|
+
* - `accepted` — an operator accepted it on an order SHIPPED but not yet
|
|
30
|
+
* delivered: the dispatch lock is released so the delivery can be recorded.
|
|
31
|
+
* Accepting an `accepted` withdrawal again once its order is delivered, while
|
|
32
|
+
* no open `purchase-withdrawal` RMA names it, hands it off as below. That also
|
|
33
|
+
* covers a row accepted before fulfilment, or after delivery, by the code that
|
|
34
|
+
* predates the cancellation and the hand-off. Before fulfilment an accept never
|
|
35
|
+
* leaves a record `accepted`: it cancels the order (below).
|
|
34
36
|
* - `awaiting-goods` — after delivery, the goods are on their way back. The
|
|
35
37
|
* operator's accept hands it off in one transaction: an `authorized` RMA
|
|
36
38
|
* (`source: 'purchase-withdrawal'`, `withdrawalId`, `collectByAt`), one
|
|
@@ -40,13 +42,18 @@ exports.PURCHASE_WITHDRAWAL_VERIFICATION_FAILED = exports.SHOPPER_REQUEST_INTENT
|
|
|
40
42
|
* `refundObligationDueDays` after that deadline, whether or not the goods
|
|
41
43
|
* came back, and moves the withdrawal to `refund-pending` when one is owed.
|
|
42
44
|
* - `refund-pending` — money is owed back (an open refund obligation): reached
|
|
43
|
-
* from `
|
|
44
|
-
*
|
|
45
|
+
* from `requested` by an accept before fulfilment that cancelled a paid order
|
|
46
|
+
* (or by a decision on an order another door cancelled, while one of the
|
|
47
|
+
* withdrawal's obligations is still owed), from `awaiting-goods` at the
|
|
48
|
+
* collection deadline, or from `completed` by a late capture. Moves
|
|
45
49
|
* to `completed` with the closure of its last open obligation, never while
|
|
46
50
|
* another one is open.
|
|
47
|
-
* - `completed` — nothing is owed any more
|
|
48
|
-
*
|
|
49
|
-
*
|
|
51
|
+
* - `completed` — nothing is owed any more: reached from `requested` by an
|
|
52
|
+
* accept before fulfilment that cancelled an order that received nothing (or
|
|
53
|
+
* by a decision on an order another door cancelled, nothing owed), or from
|
|
54
|
+
* `refund-pending`. Not final while money can still arrive: a late capture (a
|
|
55
|
+
* new payment approval the order's payment attempt refused to settle) moves
|
|
56
|
+
* it back to `refund-pending`.
|
|
50
57
|
*/
|
|
51
58
|
exports.PURCHASE_WITHDRAWAL_STATES = [
|
|
52
59
|
'requested',
|
package/dist/order.d.ts
CHANGED
|
@@ -2827,8 +2827,11 @@ export declare const orderFulfilmentProgress: (order: OrderFulfilmentProgressInp
|
|
|
2827
2827
|
* direction) and a `readyAt` change are refused. Voiding every shipment lifts
|
|
2828
2828
|
* it. Nothing was written.
|
|
2829
2829
|
* - `ORDER_HAS_RETURNS` · 409 — the order carries at least one return and can no
|
|
2830
|
-
* longer be edited,
|
|
2831
|
-
*
|
|
2830
|
+
* longer be edited, un-delivered (`mode: 'delivery'`, `delivered: false`),
|
|
2831
|
+
* none of its shipments can be voided, and none of its señas refunded
|
|
2832
|
+
* (`mode: 'deposit-refund'`). Also answered by the un-delivery and by a
|
|
2833
|
+
* shipment void (`mode: 'shipment-void'`) of an order holding a handed-off
|
|
2834
|
+
* purchase withdrawal (`awaiting-goods` or later). Nothing was written.
|
|
2832
2835
|
* - `ORDER_CANCELLATION_NOT_PROTECTED` · 409 — `mode: 'cancel'` on an order with
|
|
2833
2836
|
* no cancel guard of the current generation, or with the switch off. Nothing
|
|
2834
2837
|
* was written.
|
package/dist/order.js
CHANGED
|
@@ -200,8 +200,11 @@ export const orderFulfilmentProgress = (order) => {
|
|
|
200
200
|
* direction) and a `readyAt` change are refused. Voiding every shipment lifts
|
|
201
201
|
* it. Nothing was written.
|
|
202
202
|
* - `ORDER_HAS_RETURNS` · 409 — the order carries at least one return and can no
|
|
203
|
-
* longer be edited,
|
|
204
|
-
*
|
|
203
|
+
* longer be edited, un-delivered (`mode: 'delivery'`, `delivered: false`),
|
|
204
|
+
* none of its shipments can be voided, and none of its señas refunded
|
|
205
|
+
* (`mode: 'deposit-refund'`). Also answered by the un-delivery and by a
|
|
206
|
+
* shipment void (`mode: 'shipment-void'`) of an order holding a handed-off
|
|
207
|
+
* purchase withdrawal (`awaiting-goods` or later). Nothing was written.
|
|
205
208
|
* - `ORDER_CANCELLATION_NOT_PROTECTED` · 409 — `mode: 'cancel'` on an order with
|
|
206
209
|
* no cancel guard of the current generation, or with the switch off. Nothing
|
|
207
210
|
* was written.
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
* (`purchase-withdrawal-pending`) until an operator decides.
|
|
24
24
|
* - `declined` — an operator declined it with a typed exemption reason.
|
|
25
25
|
* Terminal.
|
|
26
|
-
* - `accepted` — an operator accepted it
|
|
27
|
-
* dispatch lock is released so the delivery can be recorded.
|
|
28
|
-
* `accepted` withdrawal again once its order is delivered, while
|
|
29
|
-
* `purchase-withdrawal` RMA names it, hands it off as below. That also
|
|
30
|
-
* a row accepted after delivery
|
|
26
|
+
* - `accepted` — an operator accepted it on an order SHIPPED but not yet
|
|
27
|
+
* delivered: the dispatch lock is released so the delivery can be recorded.
|
|
28
|
+
* Accepting an `accepted` withdrawal again once its order is delivered, while
|
|
29
|
+
* no open `purchase-withdrawal` RMA names it, hands it off as below. That also
|
|
30
|
+
* covers a row accepted before fulfilment, or after delivery, by the code that
|
|
31
|
+
* predates the cancellation and the hand-off. Before fulfilment an accept never
|
|
32
|
+
* leaves a record `accepted`: it cancels the order (below).
|
|
31
33
|
* - `awaiting-goods` — after delivery, the goods are on their way back. The
|
|
32
34
|
* operator's accept hands it off in one transaction: an `authorized` RMA
|
|
33
35
|
* (`source: 'purchase-withdrawal'`, `withdrawalId`, `collectByAt`), one
|
|
@@ -37,13 +39,18 @@
|
|
|
37
39
|
* `refundObligationDueDays` after that deadline, whether or not the goods
|
|
38
40
|
* came back, and moves the withdrawal to `refund-pending` when one is owed.
|
|
39
41
|
* - `refund-pending` — money is owed back (an open refund obligation): reached
|
|
40
|
-
* from `
|
|
41
|
-
*
|
|
42
|
+
* from `requested` by an accept before fulfilment that cancelled a paid order
|
|
43
|
+
* (or by a decision on an order another door cancelled, while one of the
|
|
44
|
+
* withdrawal's obligations is still owed), from `awaiting-goods` at the
|
|
45
|
+
* collection deadline, or from `completed` by a late capture. Moves
|
|
42
46
|
* to `completed` with the closure of its last open obligation, never while
|
|
43
47
|
* another one is open.
|
|
44
|
-
* - `completed` — nothing is owed any more
|
|
45
|
-
*
|
|
46
|
-
*
|
|
48
|
+
* - `completed` — nothing is owed any more: reached from `requested` by an
|
|
49
|
+
* accept before fulfilment that cancelled an order that received nothing (or
|
|
50
|
+
* by a decision on an order another door cancelled, nothing owed), or from
|
|
51
|
+
* `refund-pending`. Not final while money can still arrive: a late capture (a
|
|
52
|
+
* new payment approval the order's payment attempt refused to settle) moves
|
|
53
|
+
* it back to `refund-pending`.
|
|
47
54
|
*/
|
|
48
55
|
export declare const PURCHASE_WITHDRAWAL_STATES: readonly ["requested", "declined", "accepted", "awaiting-goods", "refund-pending", "completed"];
|
|
49
56
|
/**
|
|
@@ -516,7 +523,17 @@ declare global {
|
|
|
516
523
|
* - `accept` / `decline` — decide a `requested` withdrawal under
|
|
517
524
|
* `expectedRevision` (the `revision` the operator acted on). A decline
|
|
518
525
|
* names one {@link PurchaseWithdrawalDeclineReason} and may carry a note.
|
|
519
|
-
* Both release the order's dispatch lock in the same transaction.
|
|
526
|
+
* Both release the order's dispatch lock in the same transaction. What an
|
|
527
|
+
* accept does depends on the order as it stands: before fulfilment it
|
|
528
|
+
* CANCELS the order (the record goes to `refund-pending` or `completed`, the
|
|
529
|
+
* money it received is owed back and its credit note is queued) and can
|
|
530
|
+
* answer `409 PURCHASE_WITHDRAWAL_FISCAL_IN_FLIGHT`
|
|
531
|
+
* ({@link PurchaseWithdrawalFiscalInFlightData}), `409
|
|
532
|
+
* ORDER_VERSION_CONFLICT`, `409 ORDER_CANCELLATION_LOCKED` or `502
|
|
533
|
+
* PURCHASE_WITHDRAWAL_REFUND_BASIS_UNAVAILABLE`; shipped and undelivered it
|
|
534
|
+
* moves the record to `accepted` alone; delivered it hands the withdrawal
|
|
535
|
+
* off (`awaiting-goods`); on an order another door already cancelled it
|
|
536
|
+
* decides the record alone (`refund-pending` or `completed`).
|
|
520
537
|
* - `relay` — record a request the store received by email or WhatsApp and
|
|
521
538
|
* mint its code, which the operator then sends on that channel.
|
|
522
539
|
*/
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
* (`purchase-withdrawal-pending`) until an operator decides.
|
|
24
24
|
* - `declined` — an operator declined it with a typed exemption reason.
|
|
25
25
|
* Terminal.
|
|
26
|
-
* - `accepted` — an operator accepted it
|
|
27
|
-
* dispatch lock is released so the delivery can be recorded.
|
|
28
|
-
* `accepted` withdrawal again once its order is delivered, while
|
|
29
|
-
* `purchase-withdrawal` RMA names it, hands it off as below. That also
|
|
30
|
-
* a row accepted after delivery
|
|
26
|
+
* - `accepted` — an operator accepted it on an order SHIPPED but not yet
|
|
27
|
+
* delivered: the dispatch lock is released so the delivery can be recorded.
|
|
28
|
+
* Accepting an `accepted` withdrawal again once its order is delivered, while
|
|
29
|
+
* no open `purchase-withdrawal` RMA names it, hands it off as below. That also
|
|
30
|
+
* covers a row accepted before fulfilment, or after delivery, by the code that
|
|
31
|
+
* predates the cancellation and the hand-off. Before fulfilment an accept never
|
|
32
|
+
* leaves a record `accepted`: it cancels the order (below).
|
|
31
33
|
* - `awaiting-goods` — after delivery, the goods are on their way back. The
|
|
32
34
|
* operator's accept hands it off in one transaction: an `authorized` RMA
|
|
33
35
|
* (`source: 'purchase-withdrawal'`, `withdrawalId`, `collectByAt`), one
|
|
@@ -37,13 +39,18 @@
|
|
|
37
39
|
* `refundObligationDueDays` after that deadline, whether or not the goods
|
|
38
40
|
* came back, and moves the withdrawal to `refund-pending` when one is owed.
|
|
39
41
|
* - `refund-pending` — money is owed back (an open refund obligation): reached
|
|
40
|
-
* from `
|
|
41
|
-
*
|
|
42
|
+
* from `requested` by an accept before fulfilment that cancelled a paid order
|
|
43
|
+
* (or by a decision on an order another door cancelled, while one of the
|
|
44
|
+
* withdrawal's obligations is still owed), from `awaiting-goods` at the
|
|
45
|
+
* collection deadline, or from `completed` by a late capture. Moves
|
|
42
46
|
* to `completed` with the closure of its last open obligation, never while
|
|
43
47
|
* another one is open.
|
|
44
|
-
* - `completed` — nothing is owed any more
|
|
45
|
-
*
|
|
46
|
-
*
|
|
48
|
+
* - `completed` — nothing is owed any more: reached from `requested` by an
|
|
49
|
+
* accept before fulfilment that cancelled an order that received nothing (or
|
|
50
|
+
* by a decision on an order another door cancelled, nothing owed), or from
|
|
51
|
+
* `refund-pending`. Not final while money can still arrive: a late capture (a
|
|
52
|
+
* new payment approval the order's payment attempt refused to settle) moves
|
|
53
|
+
* it back to `refund-pending`.
|
|
47
54
|
*/
|
|
48
55
|
export const PURCHASE_WITHDRAWAL_STATES = [
|
|
49
56
|
'requested',
|