platform-types 1.10.825 → 1.10.827
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.
|
@@ -83,11 +83,14 @@ exports.PURCHASE_WITHDRAWAL_ACTION_MODES = ['accept', 'decline', 'relay'];
|
|
|
83
83
|
* already returned (`data.orderItemIndex`).
|
|
84
84
|
* - `nothing-to-withdraw` — every line is already withdrawn or returned.
|
|
85
85
|
* - `not-delivered` — a warranty request on an order not yet delivered.
|
|
86
|
-
* - `return-request-open` — a
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
86
|
+
* - `return-request-open` — a shopper return request (a warranty request, or a
|
|
87
|
+
* change of mind: a withdrawal-shaped body past W2 while the store's policy is
|
|
88
|
+
* on) on an order that already has an open shopper return request
|
|
89
|
+
* (`requested`, `authorized` or `received`); `data.rmaId` names it. One open
|
|
90
|
+
* shopper request per order.
|
|
91
|
+
* - `too-many-lines` — a shopper return request (either flow) naming, or
|
|
92
|
+
* resolving to, more lines than one return request may hold; `data.max` is
|
|
93
|
+
* the bound.
|
|
91
94
|
*/
|
|
92
95
|
exports.PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = [
|
|
93
96
|
'order-cancelled',
|
|
@@ -65,11 +65,14 @@ export declare const PURCHASE_WITHDRAWAL_ACTION_MODES: readonly ["accept", "decl
|
|
|
65
65
|
* already returned (`data.orderItemIndex`).
|
|
66
66
|
* - `nothing-to-withdraw` — every line is already withdrawn or returned.
|
|
67
67
|
* - `not-delivered` — a warranty request on an order not yet delivered.
|
|
68
|
-
* - `return-request-open` — a
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
68
|
+
* - `return-request-open` — a shopper return request (a warranty request, or a
|
|
69
|
+
* change of mind: a withdrawal-shaped body past W2 while the store's policy is
|
|
70
|
+
* on) on an order that already has an open shopper return request
|
|
71
|
+
* (`requested`, `authorized` or `received`); `data.rmaId` names it. One open
|
|
72
|
+
* shopper request per order.
|
|
73
|
+
* - `too-many-lines` — a shopper return request (either flow) naming, or
|
|
74
|
+
* resolving to, more lines than one return request may hold; `data.max` is
|
|
75
|
+
* the bound.
|
|
73
76
|
*/
|
|
74
77
|
export declare const PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS: readonly ["order-cancelled", "no-customer", "partial-before-fulfilment", "line-not-on-order", "line-unavailable", "nothing-to-withdraw", "not-delivered", "return-request-open", "too-many-lines"];
|
|
75
78
|
/**
|
|
@@ -140,7 +143,8 @@ declare global {
|
|
|
140
143
|
* `purchase-withdrawal-received` mail is queued after the commit and
|
|
141
144
|
* stamps `emailQueuedAt`, and the mail worker records `emailStatus`:
|
|
142
145
|
* `sent`, or `not-sent` when the order's customer has no address to mail
|
|
143
|
-
* or the send was refused for good (a suppressed address included)
|
|
146
|
+
* or the send was refused for good (a suppressed address included), or
|
|
147
|
+
* when an operator decided the request before the mail went out.
|
|
144
148
|
*/
|
|
145
149
|
interface PurchaseWithdrawalAcknowledgement {
|
|
146
150
|
/** Unix ms. */
|
|
@@ -282,7 +286,14 @@ declare global {
|
|
|
282
286
|
/** 1–{@link PURCHASE_WITHDRAWAL_LINES_MAX} distinct lines, each with a positive quantity. */
|
|
283
287
|
lines?: PurchaseWithdrawalLine[];
|
|
284
288
|
}
|
|
285
|
-
/**
|
|
289
|
+
/**
|
|
290
|
+
* `data` of the `201` of `POST /orders/purchase-withdrawal` when a withdrawal
|
|
291
|
+
* was recorded: the code is `purchaseWithdrawal.withdrawalId`. A
|
|
292
|
+
* withdrawal-shaped body past W2 may instead open a change-of-mind return
|
|
293
|
+
* request (the store's policy on, its window open) and answer
|
|
294
|
+
* {@link ShopperReturnRequestSubmitResponse} — tell them apart by key
|
|
295
|
+
* ({@link ShopperOrderRequestResponse}).
|
|
296
|
+
*/
|
|
286
297
|
interface PurchaseWithdrawalSubmitResponse {
|
|
287
298
|
purchaseWithdrawal: OrderPurchaseWithdrawalView;
|
|
288
299
|
}
|
|
@@ -329,7 +340,11 @@ declare global {
|
|
|
329
340
|
* `data` of the `201` of the guest submit: the code on screen, and a guest
|
|
330
341
|
* order status token minted at the order's CURRENT fence generation (no
|
|
331
342
|
* earlier link dies) — the storefront opens `/pedido/{statusToken}` to follow
|
|
332
|
-
* the refund. Absent only when the token could not be minted.
|
|
343
|
+
* the refund. Absent only when the token could not be minted. A
|
|
344
|
+
* withdrawal-shaped body past W2 may instead open a change-of-mind return
|
|
345
|
+
* request (the store's policy on, its window open) and answer
|
|
346
|
+
* {@link ShopperReturnRequestGuestSubmitResponse} — tell them apart by key
|
|
347
|
+
* ({@link ShopperOrderGuestRequestResponse}).
|
|
333
348
|
*/
|
|
334
349
|
interface PurchaseWithdrawalGuestSubmitResponse extends PurchaseWithdrawalSubmitResponse {
|
|
335
350
|
statusToken?: string;
|
|
@@ -80,11 +80,14 @@ export const PURCHASE_WITHDRAWAL_ACTION_MODES = ['accept', 'decline', 'relay'];
|
|
|
80
80
|
* already returned (`data.orderItemIndex`).
|
|
81
81
|
* - `nothing-to-withdraw` — every line is already withdrawn or returned.
|
|
82
82
|
* - `not-delivered` — a warranty request on an order not yet delivered.
|
|
83
|
-
* - `return-request-open` — a
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
83
|
+
* - `return-request-open` — a shopper return request (a warranty request, or a
|
|
84
|
+
* change of mind: a withdrawal-shaped body past W2 while the store's policy is
|
|
85
|
+
* on) on an order that already has an open shopper return request
|
|
86
|
+
* (`requested`, `authorized` or `received`); `data.rmaId` names it. One open
|
|
87
|
+
* shopper request per order.
|
|
88
|
+
* - `too-many-lines` — a shopper return request (either flow) naming, or
|
|
89
|
+
* resolving to, more lines than one return request may hold; `data.max` is
|
|
90
|
+
* the bound.
|
|
88
91
|
*/
|
|
89
92
|
export const PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = [
|
|
90
93
|
'order-cancelled',
|
package/dist/rma.d.ts
CHANGED
|
@@ -132,9 +132,10 @@ declare global {
|
|
|
132
132
|
expiresAt?: number;
|
|
133
133
|
/**
|
|
134
134
|
* Who opened the request. Absent means `operator`. `shopper` is the
|
|
135
|
-
* storefront
|
|
136
|
-
* guest twin
|
|
137
|
-
*
|
|
135
|
+
* storefront's own request on `POST /orders/purchase-withdrawal` and its
|
|
136
|
+
* guest twin: the warranty request (`intent: 'warranty'`), or a change of
|
|
137
|
+
* mind (a withdrawal-shaped body past W2 while the store's policy is on);
|
|
138
|
+
* `purchase-withdrawal` has no writer yet.
|
|
138
139
|
*/
|
|
139
140
|
source?: RmaSource;
|
|
140
141
|
/** Server-derived legal track. Absent on an operator request. */
|
|
@@ -143,6 +144,14 @@ declare global {
|
|
|
143
144
|
warrantyEndsAt?: StatutoryInstant;
|
|
144
145
|
/** The store's change-of-mind terms as they stood when requested. Set only on a `change-of-mind` request. */
|
|
145
146
|
changeOfMind?: RmaChangeOfMindTerms;
|
|
147
|
+
/**
|
|
148
|
+
* Set only on a `shopper` request, in its create transaction (`shownAt`);
|
|
149
|
+
* the `return-request-received` mail then stamps `emailQueuedAt` and its
|
|
150
|
+
* worker `emailStatus`. Absent on an operator request, which mails nothing,
|
|
151
|
+
* and on a shopper request opened before the acknowledgement shipped — a
|
|
152
|
+
* missing `acknowledgement` is not an unsent one.
|
|
153
|
+
*/
|
|
154
|
+
acknowledgement?: ReturnRequestAcknowledgement;
|
|
146
155
|
/** Lowercase, rebuilt on every write. A row missing it is invisible to search. */
|
|
147
156
|
search?: string;
|
|
148
157
|
createdAt: number;
|
|
@@ -218,6 +227,15 @@ declare global {
|
|
|
218
227
|
type RmaSource = (typeof RMA_SOURCES)[number];
|
|
219
228
|
/** The flows a shopper's own return request can land in. */
|
|
220
229
|
type ShopperReturnRequestFlow = Extract<ReturnFlow, 'warranty' | 'change-of-mind'>;
|
|
230
|
+
/**
|
|
231
|
+
* A shopper return request's acknowledgement — the purchase withdrawal's
|
|
232
|
+
* shape: `shownAt` (the `201` showed the request number), `emailQueuedAt`
|
|
233
|
+
* (the `return-request-received` mail was queued) and `emailStatus` (`sent`,
|
|
234
|
+
* or `not-sent` when the customer has no address, the send was refused for
|
|
235
|
+
* good, or an operator decided the request before the mail went out). The operator reads an undelivered acknowledgement off it; the
|
|
236
|
+
* shopper's view never carries it.
|
|
237
|
+
*/
|
|
238
|
+
type ReturnRequestAcknowledgement = PurchaseWithdrawalAcknowledgement;
|
|
221
239
|
/** The change-of-mind terms snapshotted onto a request, so a later policy edit does not rewrite them. */
|
|
222
240
|
interface RmaChangeOfMindTerms {
|
|
223
241
|
endsAt: StatutoryInstant;
|
|
@@ -233,8 +251,8 @@ declare global {
|
|
|
233
251
|
/**
|
|
234
252
|
* A shopper-sourced return request as the shopper sees it, by ALLOW-LIST:
|
|
235
253
|
* never the operator's reasons or actors, carrier, tracking, nor the
|
|
236
|
-
* shopper's own description. Answered by the shopper's warranty
|
|
237
|
-
* (`ShopperReturnRequestSubmitResponse`), its `orderReturnRequest` frame (on
|
|
254
|
+
* shopper's own description. Answered by the shopper's warranty or
|
|
255
|
+
* change-of-mind request (`ShopperReturnRequestSubmitResponse`), its `orderReturnRequest` frame (on
|
|
238
256
|
* the request and on every later status move), and the order reads
|
|
239
257
|
* (`StorefrontOrderView.returnRequests`, `GuestOrderStatusView.returnRequests`).
|
|
240
258
|
*/
|