platform-types 1.10.863 → 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 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, none of its shipments can be voided, and none of its
211
- * señas refunded (`mode: 'deposit-refund'`). Nothing was written.
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 before delivery (shipped or not): the
30
- * dispatch lock is released so the delivery can be recorded. Accepting an
31
- * `accepted` withdrawal again once its order is delivered, while no open
32
- * `purchase-withdrawal` RMA names it, hands it off as below. That also covers
33
- * a row accepted after delivery before the hand-off shipped.
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 `awaiting-goods` at the collection deadline, or from `completed` by a
44
- * late capture. Moves
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. Not final while money can still
48
- * arrive: a late capture (a new payment approval the order's payment
49
- * attempt refused to settle) moves it back to `refund-pending`.
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, none of its shipments can be voided, and none of its
2831
- * señas refunded (`mode: 'deposit-refund'`). Nothing was written.
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, none of its shipments can be voided, and none of its
204
- * señas refunded (`mode: 'deposit-refund'`). Nothing was written.
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 before delivery (shipped or not): the
27
- * dispatch lock is released so the delivery can be recorded. Accepting an
28
- * `accepted` withdrawal again once its order is delivered, while no open
29
- * `purchase-withdrawal` RMA names it, hands it off as below. That also covers
30
- * a row accepted after delivery before the hand-off shipped.
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 `awaiting-goods` at the collection deadline, or from `completed` by a
41
- * late capture. Moves
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. Not final while money can still
45
- * arrive: a late capture (a new payment approval the order's payment
46
- * attempt refused to settle) moves it back to `refund-pending`.
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 before delivery (shipped or not): the
27
- * dispatch lock is released so the delivery can be recorded. Accepting an
28
- * `accepted` withdrawal again once its order is delivered, while no open
29
- * `purchase-withdrawal` RMA names it, hands it off as below. That also covers
30
- * a row accepted after delivery before the hand-off shipped.
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 `awaiting-goods` at the collection deadline, or from `completed` by a
41
- * late capture. Moves
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. Not final while money can still
45
- * arrive: a late capture (a new payment approval the order's payment
46
- * attempt refused to settle) moves it back to `refund-pending`.
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',
@@ -733,7 +733,9 @@ declare global {
733
733
  * is `PPPP-NNNNNNNN` (point of sale and comprobante number, zero-padded);
734
734
  * `issuedAt` is Unix ms. A factura is written by the platform's
735
735
  * self-billing for a MercadoPago charge approved on or after its go-live;
736
- * nothing writes a credit note yet, so `creditNote` still answers `null`.
736
+ * a credit note — one full Nota de Crédito against that factura — for a
737
+ * refund or chargeback of a charge whose factura was issued (a partial
738
+ * refund owes none).
737
739
  */
738
740
  type PlatformFiscalDoc = null | {
739
741
  status: 'pending';
@@ -753,7 +755,13 @@ declare global {
753
755
  * `expiresAt` (Unix ms, about 5 minutes). Fetch it on click, never cache it.
754
756
  * `404 PLATFORM_FISCAL_DOC_NOT_FOUND` when the payment or its document does
755
757
  * not exist; `409 PLATFORM_FISCAL_DOC_PENDING` while it is still pending.
756
- * The route itself ships with platform self-billing's PDF slice.
758
+ *
759
+ * `{paymentId}` is the MercadoPago payment id — `InvoiceSummary.providerPaymentId`
760
+ * for a subscription row, `StoreMessagePackPurchase.paymentId` for a pack —
761
+ * never `InvoiceSummary.id`. The route looks it up only under the token's
762
+ * store: its subscription payment row under `mercadopago#{paymentId}`, then
763
+ * its pack payment row under the same key; a foreign or unknown id is the
764
+ * same `404`.
757
765
  */
758
766
  interface PlatformFiscalDocPdf {
759
767
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.863",
3
+ "version": "1.10.865",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",