platform-types 1.10.732 → 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.
package/dist/cash.d.ts CHANGED
@@ -511,12 +511,16 @@ declare global {
511
511
  * - `WAREHOUSE_NOT_FOUND` · 404 — `GET /shifts?warehouseId=` naming a depósito
512
512
  * the store does not have (`resolveReportWarehouseFilter`).
513
513
  * - `ROLE_FORBIDDEN` · 403 · `VALIDATION_FAILED` · 400
514
+ * - `STORE_MODULE_DISABLED` · 403 — `POST /shifts` (open) while the store has
515
+ * `modules.cash` off; `data.module` is `'cash'` (`StoreModuleDisabledData`)
516
+ * and nothing is written. Close, movements, reconcile and reads of a shift
517
+ * already open stay reachable.
514
518
  *
515
519
  * ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
516
520
  * as well, and `TERMINAL_ELEVATION_ERROR_CODES` for a money-out movement's PIN
517
521
  * elevation.
518
522
  */
519
- export declare const SHIFT_ERROR_CODES: readonly ["INVALID_SHIFT_ID", "SHIFT_NOT_FOUND", "SHIFT_ALREADY_OPEN", "SHIFT_NOT_OPEN", "SHIFT_NOT_CLOSED", "SHIFT_OWNER_MISMATCH", "CURRENCY_MISMATCH", "BUCKET_COUNTS_INVALID", "BUCKET_REVIEW_INVALID", "BUCKET_COUNT_MISSING", "SHIFT_CHANGED", "SHIFT_EVENTS_TRUNCATED", "CASH_DRAWER_BUSY", "SELF_APPROVAL_FORBIDDEN", "INVALID_DENOMINATION", "INVALID_CURSOR", "WAREHOUSE_NOT_FOUND", "ROLE_FORBIDDEN", "VALIDATION_FAILED"];
523
+ export declare const SHIFT_ERROR_CODES: readonly ["INVALID_SHIFT_ID", "SHIFT_NOT_FOUND", "SHIFT_ALREADY_OPEN", "SHIFT_NOT_OPEN", "SHIFT_NOT_CLOSED", "SHIFT_OWNER_MISMATCH", "CURRENCY_MISMATCH", "BUCKET_COUNTS_INVALID", "BUCKET_REVIEW_INVALID", "BUCKET_COUNT_MISSING", "SHIFT_CHANGED", "SHIFT_EVENTS_TRUNCATED", "CASH_DRAWER_BUSY", "SELF_APPROVAL_FORBIDDEN", "INVALID_DENOMINATION", "INVALID_CURSOR", "WAREHOUSE_NOT_FOUND", "ROLE_FORBIDDEN", "VALIDATION_FAILED", "STORE_MODULE_DISABLED"];
520
524
  export type ShiftErrorCode = (typeof SHIFT_ERROR_CODES)[number];
521
525
  /**
522
526
  * Where a {@link ShiftMethodTotal}'s `label` came from.
package/dist/cash.js CHANGED
@@ -37,6 +37,10 @@
37
37
  * - `WAREHOUSE_NOT_FOUND` · 404 — `GET /shifts?warehouseId=` naming a depósito
38
38
  * the store does not have (`resolveReportWarehouseFilter`).
39
39
  * - `ROLE_FORBIDDEN` · 403 · `VALIDATION_FAILED` · 400
40
+ * - `STORE_MODULE_DISABLED` · 403 — `POST /shifts` (open) while the store has
41
+ * `modules.cash` off; `data.module` is `'cash'` (`StoreModuleDisabledData`)
42
+ * and nothing is written. Close, movements, reconcile and reads of a shift
43
+ * already open stay reachable.
40
44
  *
41
45
  * ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
42
46
  * as well, and `TERMINAL_ELEVATION_ERROR_CODES` for a money-out movement's PIN
@@ -62,6 +66,9 @@ export const SHIFT_ERROR_CODES = [
62
66
  'WAREHOUSE_NOT_FOUND',
63
67
  'ROLE_FORBIDDEN',
64
68
  'VALIDATION_FAILED',
69
+ // Opening a shift while the store has `modules.cash` off; its `data` is
70
+ // `StoreModuleDisabledData` (`StoreModuleRefusalBody` types the whole body).
71
+ 'STORE_MODULE_DISABLED',
65
72
  ];
66
73
  /**
67
74
  * Where a {@link ShiftMethodTotal}'s `label` came from.
package/dist/cjs/cash.js CHANGED
@@ -40,6 +40,10 @@ exports.METHOD_LABEL_SOURCES = exports.SHIFT_ERROR_CODES = void 0;
40
40
  * - `WAREHOUSE_NOT_FOUND` · 404 — `GET /shifts?warehouseId=` naming a depósito
41
41
  * the store does not have (`resolveReportWarehouseFilter`).
42
42
  * - `ROLE_FORBIDDEN` · 403 · `VALIDATION_FAILED` · 400
43
+ * - `STORE_MODULE_DISABLED` · 403 — `POST /shifts` (open) while the store has
44
+ * `modules.cash` off; `data.module` is `'cash'` (`StoreModuleDisabledData`)
45
+ * and nothing is written. Close, movements, reconcile and reads of a shift
46
+ * already open stay reachable.
43
47
  *
44
48
  * ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
45
49
  * as well, and `TERMINAL_ELEVATION_ERROR_CODES` for a money-out movement's PIN
@@ -65,6 +69,9 @@ exports.SHIFT_ERROR_CODES = [
65
69
  'WAREHOUSE_NOT_FOUND',
66
70
  'ROLE_FORBIDDEN',
67
71
  'VALIDATION_FAILED',
72
+ // Opening a shift while the store has `modules.cash` off; its `data` is
73
+ // `StoreModuleDisabledData` (`StoreModuleRefusalBody` types the whole body).
74
+ 'STORE_MODULE_DISABLED',
68
75
  ];
69
76
  /**
70
77
  * Where a {@link ShiftMethodTotal}'s `label` came from.
@@ -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/cjs/store.js CHANGED
@@ -71,10 +71,14 @@ exports.isStoreModuleOn = isStoreModuleOn;
71
71
  * - `STORE_MODULE_BALANCE_CHECK_INCOMPLETE` (409) — the bounded balance read
72
72
  * stopped before it could prove every balance is zero. Retrying is harmless but
73
73
  * walks the same rows, so a very large customer book keeps answering it.
74
+ * - `STORE_MODULE_SHIFTS_OPEN` (409) — `cash` off while any cash shift of the
75
+ * store is still open (the default drawer is not a shift anyone closes, so it
76
+ * never counts); `data.openShifts` carries the count, `data.truncated: true`
77
+ * marks it as a floor (see {@link StoreModuleShiftsOpenData}).
74
78
  * - `STORE_MODULE_DISABLED` (403) — a server-enforced module is off (storefront
75
- * self-booking, storefront survey); `data.module` names it. `POST /warehouses`
76
- * answers it too when a create, or returning a depósito to service, would add
77
- * a second active depósito while `multiWarehouse` is off
79
+ * self-booking, storefront survey, opening a cash shift); `data.module` names
80
+ * it. `POST /warehouses` answers it too when a create, or returning a depósito
81
+ * to service, would add a second active depósito while `multiWarehouse` is off
78
82
  * (`data.module: 'multiWarehouse'`). Always 403, and never an Action Denied row.
79
83
  */
80
84
  exports.STORE_MODULE_ERROR_CODES = [
@@ -84,5 +88,6 @@ exports.STORE_MODULE_ERROR_CODES = [
84
88
  'STORE_MODULE_TRANSFER_IN_FLIGHT',
85
89
  'STORE_MODULE_CUSTOMER_BALANCES',
86
90
  'STORE_MODULE_BALANCE_CHECK_INCOMPLETE',
91
+ 'STORE_MODULE_SHIFTS_OPEN',
87
92
  'STORE_MODULE_DISABLED',
88
93
  ];
@@ -66,7 +66,8 @@ exports.TERMINAL_ENROLMENT_ERROR_CODES = [
66
66
  *
67
67
  * - `TERMINAL_NOT_PAIRED` · 401 — the request carried no `sf_terminal` cookie,
68
68
  * or one naming an unknown, expired or revoked terminal. Re-pair the till.
69
- * - `SHIFT_NOT_OPEN` · 409 — activation by an employee who holds no open shift.
69
+ * - `SHIFT_NOT_OPEN` · 409 — activation by an employee who holds no open shift,
70
+ * while the store's `cash` module is on (with it off no shift is asked for).
70
71
  * - `TERMINAL_ACTIVATION_SESSION_INVALID` · 401 — the presented USER refresh
71
72
  * credential cannot identify a signed modern family; clear delivery and sign in again.
72
73
  * - `TERMINAL_ACTIVATION_SESSION_MISMATCH` · 409 — its signed employee or store
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/dist/store.d.ts CHANGED
@@ -915,9 +915,10 @@ declare global {
915
915
  * `customerAccounts` while any customer carries a non-zero balance
916
916
  * (`409 STORE_MODULE_CUSTOMER_BALANCES`, or
917
917
  * `409 STORE_MODULE_BALANCE_CHECK_INCOMPLETE` when the bounded read could
918
- * not finish).
918
+ * not finish); `cash` while any cash shift is still open
919
+ * (`409 STORE_MODULE_SHIFTS_OPEN` — `StoreModuleShiftsOpenData`).
919
920
  *
920
- * Enforced on the server for six modules only:
921
+ * Enforced on the server for seven modules only:
921
922
  * - `promotions` — applying one is refused `PROMOTION_NOT_ACTIVE` (the
922
923
  * existing promotion refusal, not `STORE_MODULE_DISABLED`), a grant already
923
924
  * frozen on a cart stays on the row but derives no money (its
@@ -942,6 +943,10 @@ declare global {
942
943
  * operator's `POST /loyalty/earn` and every read stay reachable.
943
944
  * - `marketing` — automation and campaign sends go out to nobody: each is
944
945
  * settled `'skipped'` with reason `MODULE_OFF` at its send worker.
946
+ * - `cash` — a POS terminal activates WITHOUT a shift (no `shiftId`,
947
+ * living until its own expiry), and opening a shift (`POST /shifts`) is
948
+ * refused `403 STORE_MODULE_DISABLED`; every other `/shifts` endpoint
949
+ * (close, movements, reconcile, reads) stays reachable.
945
950
  * Every other module is hide-only: its endpoints stay reachable. Public
946
951
  * reads carry only `appointments`, `surveys`, `promotions` and
947
952
  * `customerAccounts`. `PUT /platform/stores/{storeId}` refuses the leaf.
@@ -2046,13 +2051,17 @@ export declare const isStoreModuleOn: (modules: StoreModules | null | undefined,
2046
2051
  * - `STORE_MODULE_BALANCE_CHECK_INCOMPLETE` (409) — the bounded balance read
2047
2052
  * stopped before it could prove every balance is zero. Retrying is harmless but
2048
2053
  * walks the same rows, so a very large customer book keeps answering it.
2054
+ * - `STORE_MODULE_SHIFTS_OPEN` (409) — `cash` off while any cash shift of the
2055
+ * store is still open (the default drawer is not a shift anyone closes, so it
2056
+ * never counts); `data.openShifts` carries the count, `data.truncated: true`
2057
+ * marks it as a floor (see {@link StoreModuleShiftsOpenData}).
2049
2058
  * - `STORE_MODULE_DISABLED` (403) — a server-enforced module is off (storefront
2050
- * self-booking, storefront survey); `data.module` names it. `POST /warehouses`
2051
- * answers it too when a create, or returning a depósito to service, would add
2052
- * a second active depósito while `multiWarehouse` is off
2059
+ * self-booking, storefront survey, opening a cash shift); `data.module` names
2060
+ * it. `POST /warehouses` answers it too when a create, or returning a depósito
2061
+ * to service, would add a second active depósito while `multiWarehouse` is off
2053
2062
  * (`data.module: 'multiWarehouse'`). Always 403, and never an Action Denied row.
2054
2063
  */
2055
- export declare const STORE_MODULE_ERROR_CODES: readonly ["STORE_MODULE_UNKNOWN", "STORE_MODULE_NOT_BOOLEAN", "STORE_MODULE_WAREHOUSES_ACTIVE", "STORE_MODULE_TRANSFER_IN_FLIGHT", "STORE_MODULE_CUSTOMER_BALANCES", "STORE_MODULE_BALANCE_CHECK_INCOMPLETE", "STORE_MODULE_DISABLED"];
2064
+ export declare const STORE_MODULE_ERROR_CODES: readonly ["STORE_MODULE_UNKNOWN", "STORE_MODULE_NOT_BOOLEAN", "STORE_MODULE_WAREHOUSES_ACTIVE", "STORE_MODULE_TRANSFER_IN_FLIGHT", "STORE_MODULE_CUSTOMER_BALANCES", "STORE_MODULE_BALANCE_CHECK_INCOMPLETE", "STORE_MODULE_SHIFTS_OPEN", "STORE_MODULE_DISABLED"];
2056
2065
  export type StoreModuleErrorCode = (typeof STORE_MODULE_ERROR_CODES)[number];
2057
2066
  /** `data` of `400 STORE_MODULE_UNKNOWN` — the unknown key, cut to its first 64 UTF-16 code units. */
2058
2067
  export interface StoreModuleUnknownData {
@@ -2092,7 +2101,20 @@ export interface StoreModuleCustomerBalancesData {
2092
2101
  export interface StoreModuleBalanceCheckIncompleteData {
2093
2102
  module: 'customerAccounts';
2094
2103
  }
2095
- /** `data` of `STORE_MODULE_DISABLED` (403) — the switched-off module the request needed. */
2104
+ /**
2105
+ * `data` of `409 STORE_MODULE_SHIFTS_OPEN`.
2106
+ *
2107
+ * `openShifts` is the number of open cash shifts the read SAW — the store
2108
+ * default drawer excluded. `truncated: true` marks the read as stopped early,
2109
+ * so that number is a FLOOR (possibly `0`: "could not finish counting");
2110
+ * absent, the count is exact and at least one.
2111
+ */
2112
+ export interface StoreModuleShiftsOpenData {
2113
+ module: 'cash';
2114
+ openShifts: number;
2115
+ truncated?: true;
2116
+ }
2117
+ /** `data` of `403 STORE_MODULE_DISABLED` — the switched-off module the request needed. */
2096
2118
  export interface StoreModuleDisabledData {
2097
2119
  module: StoreModuleKey;
2098
2120
  }
@@ -2109,6 +2131,7 @@ export interface StoreModuleRefusalDataByCode {
2109
2131
  STORE_MODULE_TRANSFER_IN_FLIGHT: StoreModuleTransferInFlightData;
2110
2132
  STORE_MODULE_CUSTOMER_BALANCES: StoreModuleCustomerBalancesData;
2111
2133
  STORE_MODULE_BALANCE_CHECK_INCOMPLETE: StoreModuleBalanceCheckIncompleteData;
2134
+ STORE_MODULE_SHIFTS_OPEN: StoreModuleShiftsOpenData;
2112
2135
  STORE_MODULE_DISABLED: StoreModuleDisabledData;
2113
2136
  }
2114
2137
  /**
package/dist/store.js CHANGED
@@ -66,10 +66,14 @@ export const isStoreModuleOn = (modules, module) => modules?.[module] !== false;
66
66
  * - `STORE_MODULE_BALANCE_CHECK_INCOMPLETE` (409) — the bounded balance read
67
67
  * stopped before it could prove every balance is zero. Retrying is harmless but
68
68
  * walks the same rows, so a very large customer book keeps answering it.
69
+ * - `STORE_MODULE_SHIFTS_OPEN` (409) — `cash` off while any cash shift of the
70
+ * store is still open (the default drawer is not a shift anyone closes, so it
71
+ * never counts); `data.openShifts` carries the count, `data.truncated: true`
72
+ * marks it as a floor (see {@link StoreModuleShiftsOpenData}).
69
73
  * - `STORE_MODULE_DISABLED` (403) — a server-enforced module is off (storefront
70
- * self-booking, storefront survey); `data.module` names it. `POST /warehouses`
71
- * answers it too when a create, or returning a depósito to service, would add
72
- * a second active depósito while `multiWarehouse` is off
74
+ * self-booking, storefront survey, opening a cash shift); `data.module` names
75
+ * it. `POST /warehouses` answers it too when a create, or returning a depósito
76
+ * to service, would add a second active depósito while `multiWarehouse` is off
73
77
  * (`data.module: 'multiWarehouse'`). Always 403, and never an Action Denied row.
74
78
  */
75
79
  export const STORE_MODULE_ERROR_CODES = [
@@ -79,5 +83,6 @@ export const STORE_MODULE_ERROR_CODES = [
79
83
  'STORE_MODULE_TRANSFER_IN_FLIGHT',
80
84
  'STORE_MODULE_CUSTOMER_BALANCES',
81
85
  'STORE_MODULE_BALANCE_CHECK_INCOMPLETE',
86
+ 'STORE_MODULE_SHIFTS_OPEN',
82
87
  'STORE_MODULE_DISABLED',
83
88
  ];
@@ -293,11 +293,18 @@ declare global {
293
293
  activatedByName: string;
294
294
  /**
295
295
  * The activating employee's OPEN shift. The activation ends the moment
296
- * this shift closes; activating with no open shift is `409 SHIFT_NOT_OPEN`.
296
+ * this shift closes; activating with no open shift is `409 SHIFT_NOT_OPEN`
297
+ * while the store's `cash` module is on (absent counts as on).
298
+ *
299
+ * ABSENT on a SHIFT-LESS activation — one made while
300
+ * `config.modules.cash === false`, when no shift is asked for. That
301
+ * activation lives until `expiresAt` alone, whatever the switch reads
302
+ * later; cash sales on its till attribute to the store's default drawer
303
+ * whenever the operator holds no open shift of their own.
297
304
  */
298
- shiftId: string;
305
+ shiftId?: string;
299
306
  activatedAt: number;
300
- /** The 12-hour hard cap, unix ms. The shift closing ends it sooner. */
307
+ /** The 12-hour hard cap, unix ms. A shift-bound activation's shift closing ends it sooner. */
301
308
  expiresAt: number;
302
309
  }
303
310
  /** A PIN ladder refusal from operator login or elevation; whole seconds until that gate unlocks. */
@@ -563,7 +570,8 @@ export type TerminalEnrolmentErrorCode = (typeof TERMINAL_ENROLMENT_ERROR_CODES)
563
570
  *
564
571
  * - `TERMINAL_NOT_PAIRED` · 401 — the request carried no `sf_terminal` cookie,
565
572
  * or one naming an unknown, expired or revoked terminal. Re-pair the till.
566
- * - `SHIFT_NOT_OPEN` · 409 — activation by an employee who holds no open shift.
573
+ * - `SHIFT_NOT_OPEN` · 409 — activation by an employee who holds no open shift,
574
+ * while the store's `cash` module is on (with it off no shift is asked for).
567
575
  * - `TERMINAL_ACTIVATION_SESSION_INVALID` · 401 — the presented USER refresh
568
576
  * credential cannot identify a signed modern family; clear delivery and sign in again.
569
577
  * - `TERMINAL_ACTIVATION_SESSION_MISMATCH` · 409 — its signed employee or store
package/dist/terminal.js CHANGED
@@ -63,7 +63,8 @@ export const TERMINAL_ENROLMENT_ERROR_CODES = [
63
63
  *
64
64
  * - `TERMINAL_NOT_PAIRED` · 401 — the request carried no `sf_terminal` cookie,
65
65
  * or one naming an unknown, expired or revoked terminal. Re-pair the till.
66
- * - `SHIFT_NOT_OPEN` · 409 — activation by an employee who holds no open shift.
66
+ * - `SHIFT_NOT_OPEN` · 409 — activation by an employee who holds no open shift,
67
+ * while the store's `cash` module is on (with it off no shift is asked for).
67
68
  * - `TERMINAL_ACTIVATION_SESSION_INVALID` · 401 — the presented USER refresh
68
69
  * credential cannot identify a signed modern family; clear delivery and sign in again.
69
70
  * - `TERMINAL_ACTIVATION_SESSION_MISMATCH` · 409 — its signed employee or store
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.732",
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",