platform-types 1.10.732 → 1.10.733

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.
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/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.733",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",