platform-types 1.10.839 → 1.10.840

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.
@@ -151,6 +151,20 @@ declare global {
151
151
  type PurchaseWithdrawalIneligibleReason = (typeof PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS)[number];
152
152
  type PurchaseWithdrawalGuestIntent = (typeof PURCHASE_WITHDRAWAL_GUEST_INTENTS)[number];
153
153
  type PurchaseWithdrawalFiscalInFlightCause = (typeof PURCHASE_WITHDRAWAL_FISCAL_IN_FLIGHT_CAUSES)[number];
154
+ /** A withdrawal credit note's failure cause: a return's, plus one only a withdrawal stores. */
155
+ type PurchaseWithdrawalCreditNoteErrorCode = ReturnCreditNoteErrorCode | 'RETURN_LEDGER_BASIS_UNAVAILABLE';
156
+ /** Why a withdrawal's credit note is `not_requested`: FAC already credited, no FAC yet, FAC rejected. */
157
+ type PurchaseWithdrawalCreditNoteSkip = 'fac-credited' | 'no-fac-counsel-pending' | 'fac-rejected';
158
+ /**
159
+ * The `return-credit-note` retry's refusal codes for a withdrawal's note: a return's, plus
160
+ * `PURCHASE_WITHDRAWAL_NOT_FOUND` (404) — no withdrawal row under that `orderId` and `withdrawalId`.
161
+ * Two of a return's codes cover more for a withdrawal:
162
+ * - `NC_OUTCOME_UNCONFIRMED` (503) also answers the handled waits — the factura the note credits, or an
163
+ * earlier credit note of it, is still `pending_cae`. Nothing was issued; the `message` names which one.
164
+ * - `NC_NOT_REQUESTED` (409) also answers a `rejected` note stored without its allocation and order-index
165
+ * subset: what to credit could not be determined, so the note is issued by hand, never retried.
166
+ */
167
+ type PurchaseWithdrawalCreditNoteRetryErrorCode = ReturnCreditNoteRetryErrorCode | 'PURCHASE_WITHDRAWAL_NOT_FOUND';
154
168
  /** One withdrawn order line, by its index in `Order.items`. */
155
169
  interface PurchaseWithdrawalLine {
156
170
  orderItemIndex: number;
@@ -247,6 +261,16 @@ declare global {
247
261
  declineReason?: PurchaseWithdrawalDeclineReason;
248
262
  /** The operator's own words on a decline. Removed by a customer erasure; never in an audit row. */
249
263
  declineNote?: string;
264
+ /** The credit note of the order's cancellation; absent when none was planned. Never moves `revision`. */
265
+ ncStatus?: ReturnCreditNoteStatus;
266
+ /** The credit note's ARCA voucher NUMBER (`String(invoice.invoiceNumber)`), once `authorized` — not an INVOICE id. */
267
+ creditNoteId?: string;
268
+ /** Machine-readable cause when `ncStatus` is `rejected`. */
269
+ ncErrorCode?: PurchaseWithdrawalCreditNoteErrorCode;
270
+ /** Unix ms — when the credit note last went into `pending`. */
271
+ ncPendingSince?: number;
272
+ /** Why `ncStatus` is `not_requested`. */
273
+ creditNoteSkip?: PurchaseWithdrawalCreditNoteSkip;
250
274
  /** Bumped by every move, for a compare-and-set. */
251
275
  revision: number;
252
276
  /** Unix ms. */
@@ -254,6 +278,11 @@ declare global {
254
278
  /** Unix ms of the last move. */
255
279
  revisedAt: number;
256
280
  }
281
+ /**
282
+ * What the `return-credit-note` retry answers for a withdrawal's note: its credit-note fields and the ids that
283
+ * name it, nothing else — the retry is open to a `creditNote` holder who may not read customers.
284
+ */
285
+ type PurchaseWithdrawalCreditNoteView = Pick<PurchaseWithdrawal, 'withdrawalId' | 'orderId' | 'ncStatus' | 'creditNoteId' | 'ncErrorCode' | 'ncPendingSince' | 'creditNoteSkip'>;
257
286
  /**
258
287
  * The undecided request an order carries, stamped on the ORDER row while
259
288
  * the request is `requested` and removed in the decision's transaction. Its
package/dist/return.d.ts CHANGED
@@ -1011,6 +1011,14 @@ declare global {
1011
1011
  mode: 'return-credit-note';
1012
1012
  returnId: string;
1013
1013
  }
1014
+ /** The same retry for the credit note of a purchase withdrawal's cancellation. */
1015
+ interface RetryPurchaseWithdrawalCreditNoteRequest {
1016
+ mode: 'return-credit-note';
1017
+ orderId: string;
1018
+ withdrawalId: string;
1019
+ }
1020
+ /** The `return-credit-note` body: a return's, or a purchase withdrawal's — never both. */
1021
+ type RetryCreditNoteRequest = RetryReturnCreditNoteRequest | RetryPurchaseWithdrawalCreditNoteRequest;
1014
1022
  /**
1015
1023
  * `POST /orders` with `mode: 'return-disposition'` — re-grade ONE line of a
1016
1024
  * committed return. ADMIN/MANAGER only, and the `Idempotency-Key` header is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.839",
3
+ "version": "1.10.840",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",