platform-types 1.10.733 → 1.10.734

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INVOICE_DOCUMENT_REFUSAL_CODES = exports.INVOICE_ISSUANCE_REFUSAL_RECOVERY = exports.INVOICE_ISSUANCE_REFUSAL_CODES = exports.INVOICE_POST_VOUCHER_ERROR_CODES = void 0;
3
+ exports.INVOICE_NOT_AUTHORIZED_RECOVERIES = exports.INVOICE_DOCUMENT_REFUSAL_CODES = exports.INVOICE_ISSUANCE_REFUSAL_RECOVERY = exports.INVOICE_ISSUANCE_REFUSAL_CODES = exports.INVOICE_POST_VOUCHER_ERROR_CODES = void 0;
4
4
  /**
5
5
  * The codes `POST /invoices` answers AFTER a voucher number was spent — ARCA
6
6
  * was asked, or a CAEA number was claimed — as a runtime value the app maps.
@@ -87,13 +87,33 @@ exports.INVOICE_ISSUANCE_REFUSAL_RECOVERY = {
87
87
  * store. Answered before any store read, render, print stamp, broadcast,
88
88
  * staged PDF, print job or email.
89
89
  * - `INVOICE_NOT_AUTHORIZED` · 409 — the row's `fiscalStatus` is `pending_cae`
90
- * or `rejected`. `invoiceId` and that `fiscalStatus` ride beside `error`. A
90
+ * or `rejected`. `invoiceId`, that `fiscalStatus` and a `recovery`
91
+ * (`INVOICE_NOT_AUTHORIZED_RECOVERIES`) ride beside `error`. A
91
92
  * print refused here wrote nothing to the invoice and dispatched nothing.
92
- * `pending_cae` is wait-and-retry: the pending-invoice drain authorizes a
93
- * factura or full credit note with no client action (an FCE or partial
94
- * credit note waits for support). `rejected` is final — ARCA refused the
95
- * voucher and nothing retries it. The decision reads `fiscalStatus` only: a row with none (issued
96
- * before the field existed) is treated as authorized, whether or not it
97
- * carries a CAE.
93
+ * What the client tells the operator is `recovery`'s to say, never
94
+ * re-derived here: a `pending_cae` row answers `retry` or `support` (an FCE
95
+ * voucher, a partial credit note, or a submit whose recorded voucher triple
96
+ * is incomplete), and a `rejected` row answers `final`. Whether to refuse at
97
+ * all reads `fiscalStatus` only: a row with none (issued before the field
98
+ * existed) is treated as authorized, whether or not it carries a CAE.
98
99
  */
99
100
  exports.INVOICE_DOCUMENT_REFUSAL_CODES = ['INVOICE_NOT_FOUND', 'INVOICE_NOT_AUTHORIZED'];
101
+ /**
102
+ * What a client should tell the operator about a voucher the document routes
103
+ * refused with `INVOICE_NOT_AUTHORIZED` — the `recovery` beside `error` in that
104
+ * 409 body, decided server-side from the INVOICE row so a client never re-derives
105
+ * the drain's rules:
106
+ *
107
+ * - `retry` — `pending_cae`, and nothing on the row says the pending-invoice
108
+ * drain will hold it: try again later. The drain may still hold such a row
109
+ * when its order changed underneath it — that is decided against the order,
110
+ * not the row, and is not answered here.
111
+ * - `support` — `pending_cae`, and the row itself shows the drain will hold it
112
+ * rather than settle it: an FCE voucher (skipped), a PARTIAL credit note (its
113
+ * row carries `partialItems`, and the drain's full-order rebuild never
114
+ * reproduces it), or a submit whose recorded voucher triple is incomplete.
115
+ * Contact support. A return's own partial credit note can still be settled by
116
+ * that return's credit-note retry.
117
+ * - `final` — `rejected`. ARCA refused the voucher and nothing retries it.
118
+ */
119
+ exports.INVOICE_NOT_AUTHORIZED_RECOVERIES = ['retry', 'support', 'final'];
package/dist/invoice.d.ts CHANGED
@@ -354,6 +354,26 @@ declare global {
354
354
  * Forward-only; nothing reads it as anything but a deadline.
355
355
  */
356
356
  drainClaimUntil?: number;
357
+ /**
358
+ * `true` while a REJECTED row's order still shows it unsettled — the
359
+ * rejection committed, but the order's `invoices[]` entry could not be set to
360
+ * `rejected` in the same write. Written in that same rejection write, only
361
+ * then; REMOVEd by the repair that sets the entry — tried at once, then by the
362
+ * `order-copy-repair` queue's consumer, and by a pending-invoice drain pass
363
+ * that reaches the store's page (AFIP not known down, its AFIP client up).
364
+ * ABSENT on every other row, and forward-only.
365
+ */
366
+ orderCopyStale?: true;
367
+ /**
368
+ * The rejecting caller's ORDER-trail origin, written beside `orderCopyStale`
369
+ * in the same write and REMOVEd with it, so whichever repairer reaches the
370
+ * row records the caller's settle rather than its own. Forward-only.
371
+ */
372
+ orderCopyStaleOrigin?: Extract<OrderAuditOrigin, 'platform' | 'operator' | 'worker'>;
373
+ /** The rejecting caller's settle reason — ids only, code-authored. Beside `orderCopyStale`, REMOVEd with it. */
374
+ orderCopyStaleReason?: string;
375
+ /** The rejecting caller's actor `userId` (`''` = the system actor). Beside `orderCopyStale`, REMOVEd with it. */
376
+ orderCopyStaleActorId?: string;
357
377
  invoicePrinted?: boolean;
358
378
  /**
359
379
  * Server-derived ms epoch, stamped by the WSS `ack` handler on an
@@ -1006,15 +1026,36 @@ export declare const INVOICE_ISSUANCE_REFUSAL_RECOVERY: {
1006
1026
  * store. Answered before any store read, render, print stamp, broadcast,
1007
1027
  * staged PDF, print job or email.
1008
1028
  * - `INVOICE_NOT_AUTHORIZED` · 409 — the row's `fiscalStatus` is `pending_cae`
1009
- * or `rejected`. `invoiceId` and that `fiscalStatus` ride beside `error`. A
1029
+ * or `rejected`. `invoiceId`, that `fiscalStatus` and a `recovery`
1030
+ * (`INVOICE_NOT_AUTHORIZED_RECOVERIES`) ride beside `error`. A
1010
1031
  * print refused here wrote nothing to the invoice and dispatched nothing.
1011
- * `pending_cae` is wait-and-retry: the pending-invoice drain authorizes a
1012
- * factura or full credit note with no client action (an FCE or partial
1013
- * credit note waits for support). `rejected` is final — ARCA refused the
1014
- * voucher and nothing retries it. The decision reads `fiscalStatus` only: a row with none (issued
1015
- * before the field existed) is treated as authorized, whether or not it
1016
- * carries a CAE.
1032
+ * What the client tells the operator is `recovery`'s to say, never
1033
+ * re-derived here: a `pending_cae` row answers `retry` or `support` (an FCE
1034
+ * voucher, a partial credit note, or a submit whose recorded voucher triple
1035
+ * is incomplete), and a `rejected` row answers `final`. Whether to refuse at
1036
+ * all reads `fiscalStatus` only: a row with none (issued before the field
1037
+ * existed) is treated as authorized, whether or not it carries a CAE.
1017
1038
  */
1018
1039
  export declare const INVOICE_DOCUMENT_REFUSAL_CODES: readonly ["INVOICE_NOT_FOUND", "INVOICE_NOT_AUTHORIZED"];
1019
1040
  export type InvoiceDocumentRefusalCode = (typeof INVOICE_DOCUMENT_REFUSAL_CODES)[number];
1041
+ /**
1042
+ * What a client should tell the operator about a voucher the document routes
1043
+ * refused with `INVOICE_NOT_AUTHORIZED` — the `recovery` beside `error` in that
1044
+ * 409 body, decided server-side from the INVOICE row so a client never re-derives
1045
+ * the drain's rules:
1046
+ *
1047
+ * - `retry` — `pending_cae`, and nothing on the row says the pending-invoice
1048
+ * drain will hold it: try again later. The drain may still hold such a row
1049
+ * when its order changed underneath it — that is decided against the order,
1050
+ * not the row, and is not answered here.
1051
+ * - `support` — `pending_cae`, and the row itself shows the drain will hold it
1052
+ * rather than settle it: an FCE voucher (skipped), a PARTIAL credit note (its
1053
+ * row carries `partialItems`, and the drain's full-order rebuild never
1054
+ * reproduces it), or a submit whose recorded voucher triple is incomplete.
1055
+ * Contact support. A return's own partial credit note can still be settled by
1056
+ * that return's credit-note retry.
1057
+ * - `final` — `rejected`. ARCA refused the voucher and nothing retries it.
1058
+ */
1059
+ export declare const INVOICE_NOT_AUTHORIZED_RECOVERIES: readonly ["retry", "support", "final"];
1060
+ export type InvoiceNotAuthorizedRecovery = (typeof INVOICE_NOT_AUTHORIZED_RECOVERIES)[number];
1020
1061
  export {};
package/dist/invoice.js CHANGED
@@ -84,13 +84,33 @@ export const INVOICE_ISSUANCE_REFUSAL_RECOVERY = {
84
84
  * store. Answered before any store read, render, print stamp, broadcast,
85
85
  * staged PDF, print job or email.
86
86
  * - `INVOICE_NOT_AUTHORIZED` · 409 — the row's `fiscalStatus` is `pending_cae`
87
- * or `rejected`. `invoiceId` and that `fiscalStatus` ride beside `error`. A
87
+ * or `rejected`. `invoiceId`, that `fiscalStatus` and a `recovery`
88
+ * (`INVOICE_NOT_AUTHORIZED_RECOVERIES`) ride beside `error`. A
88
89
  * print refused here wrote nothing to the invoice and dispatched nothing.
89
- * `pending_cae` is wait-and-retry: the pending-invoice drain authorizes a
90
- * factura or full credit note with no client action (an FCE or partial
91
- * credit note waits for support). `rejected` is final — ARCA refused the
92
- * voucher and nothing retries it. The decision reads `fiscalStatus` only: a row with none (issued
93
- * before the field existed) is treated as authorized, whether or not it
94
- * carries a CAE.
90
+ * What the client tells the operator is `recovery`'s to say, never
91
+ * re-derived here: a `pending_cae` row answers `retry` or `support` (an FCE
92
+ * voucher, a partial credit note, or a submit whose recorded voucher triple
93
+ * is incomplete), and a `rejected` row answers `final`. Whether to refuse at
94
+ * all reads `fiscalStatus` only: a row with none (issued before the field
95
+ * existed) is treated as authorized, whether or not it carries a CAE.
95
96
  */
96
97
  export const INVOICE_DOCUMENT_REFUSAL_CODES = ['INVOICE_NOT_FOUND', 'INVOICE_NOT_AUTHORIZED'];
98
+ /**
99
+ * What a client should tell the operator about a voucher the document routes
100
+ * refused with `INVOICE_NOT_AUTHORIZED` — the `recovery` beside `error` in that
101
+ * 409 body, decided server-side from the INVOICE row so a client never re-derives
102
+ * the drain's rules:
103
+ *
104
+ * - `retry` — `pending_cae`, and nothing on the row says the pending-invoice
105
+ * drain will hold it: try again later. The drain may still hold such a row
106
+ * when its order changed underneath it — that is decided against the order,
107
+ * not the row, and is not answered here.
108
+ * - `support` — `pending_cae`, and the row itself shows the drain will hold it
109
+ * rather than settle it: an FCE voucher (skipped), a PARTIAL credit note (its
110
+ * row carries `partialItems`, and the drain's full-order rebuild never
111
+ * reproduces it), or a submit whose recorded voucher triple is incomplete.
112
+ * Contact support. A return's own partial credit note can still be settled by
113
+ * that return's credit-note retry.
114
+ * - `final` — `rejected`. ARCA refused the voucher and nothing retries it.
115
+ */
116
+ export const INVOICE_NOT_AUTHORIZED_RECOVERIES = ['retry', 'support', 'final'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.733",
3
+ "version": "1.10.734",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",