platform-types 1.10.717 → 1.10.718
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 +16 -3
- package/dist/cash.js +17 -2
- package/dist/cjs/cash.js +17 -2
- package/dist/order.d.ts +34 -1
- package/package.json +1 -1
package/dist/cash.d.ts
CHANGED
|
@@ -468,7 +468,11 @@ declare global {
|
|
|
468
468
|
}
|
|
469
469
|
/**
|
|
470
470
|
* Refusals from the cash-shift surface — `stacks/lambdas/shifts/*.ts`
|
|
471
|
-
* (`_get`, `_post`, `_patchClose`, `_postMovement`, `_patchReconcile`)
|
|
471
|
+
* (`_get`, `_post`, `_patchClose`, `_postMovement`, `_patchReconcile`) — plus
|
|
472
|
+
* the shared drawer write's own `CASH_DRAWER_BUSY`, which `POST /cash`,
|
|
473
|
+
* `POST`/`DELETE /account` and a cash return answer. A tender or seña does
|
|
474
|
+
* not: a tender's drawer collision is `SHIFT_NOT_OPEN` or `422 CURRENCY_MISMATCH`,
|
|
475
|
+
* a seña's `SHIFT_NOT_OPEN` or `409 DEPOSIT_CURRENCY_MISMATCH`.
|
|
472
476
|
*
|
|
473
477
|
* - `INVALID_SHIFT_ID` · 400 · `SHIFT_NOT_FOUND` · 404
|
|
474
478
|
* - `SHIFT_ALREADY_OPEN` · 409 — one open shift per cashier.
|
|
@@ -489,15 +493,24 @@ declare global {
|
|
|
489
493
|
* - `SHIFT_EVENTS_TRUNCATED` · 503 — the event log could not be read in full, so
|
|
490
494
|
* the totals behind a close or a reconcile would be computed from a partial
|
|
491
495
|
* ledger.
|
|
496
|
+
* - `CASH_DRAWER_BUSY` · 409 — emitted by the shared drawer write
|
|
497
|
+
* (`drawerWriteRefusal`, `stacks/services/shifts.ts`), not by a `/shifts`
|
|
498
|
+
* route: `POST /account` and `POST /cash` answer it when their transaction is
|
|
499
|
+
* cancelled by a pure conflict on any item it writes (most often the drawer
|
|
500
|
+
* row), as do `DELETE /account` and `POST /orders { mode: 'return' }` on a
|
|
501
|
+
* cash leg. Nothing was written; retry the same request.
|
|
492
502
|
* - `SELF_APPROVAL_FORBIDDEN` · 403 — segregation of duties: the cashier who
|
|
493
503
|
* closed a shift cannot reconcile it.
|
|
494
504
|
* - `INVALID_DENOMINATION` · 400 · `INVALID_CURSOR` · 400
|
|
505
|
+
* - `WAREHOUSE_NOT_FOUND` · 404 — `GET /shifts?warehouseId=` naming a depósito
|
|
506
|
+
* the store does not have (`resolveReportWarehouseFilter`).
|
|
495
507
|
* - `ROLE_FORBIDDEN` · 403 · `VALIDATION_FAILED` · 400
|
|
496
508
|
*
|
|
497
509
|
* ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
|
|
498
|
-
* as well
|
|
510
|
+
* as well, and `TERMINAL_ELEVATION_ERROR_CODES` for a money-out movement's PIN
|
|
511
|
+
* elevation.
|
|
499
512
|
*/
|
|
500
|
-
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", "SELF_APPROVAL_FORBIDDEN", "INVALID_DENOMINATION", "INVALID_CURSOR", "ROLE_FORBIDDEN", "VALIDATION_FAILED"];
|
|
513
|
+
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"];
|
|
501
514
|
export type ShiftErrorCode = (typeof SHIFT_ERROR_CODES)[number];
|
|
502
515
|
/**
|
|
503
516
|
* Where a {@link ShiftMethodTotal}'s `label` came from.
|
package/dist/cash.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Refusals from the cash-shift surface — `stacks/lambdas/shifts/*.ts`
|
|
3
|
-
* (`_get`, `_post`, `_patchClose`, `_postMovement`, `_patchReconcile`)
|
|
3
|
+
* (`_get`, `_post`, `_patchClose`, `_postMovement`, `_patchReconcile`) — plus
|
|
4
|
+
* the shared drawer write's own `CASH_DRAWER_BUSY`, which `POST /cash`,
|
|
5
|
+
* `POST`/`DELETE /account` and a cash return answer. A tender or seña does
|
|
6
|
+
* not: a tender's drawer collision is `SHIFT_NOT_OPEN` or `422 CURRENCY_MISMATCH`,
|
|
7
|
+
* a seña's `SHIFT_NOT_OPEN` or `409 DEPOSIT_CURRENCY_MISMATCH`.
|
|
4
8
|
*
|
|
5
9
|
* - `INVALID_SHIFT_ID` · 400 · `SHIFT_NOT_FOUND` · 404
|
|
6
10
|
* - `SHIFT_ALREADY_OPEN` · 409 — one open shift per cashier.
|
|
@@ -21,13 +25,22 @@
|
|
|
21
25
|
* - `SHIFT_EVENTS_TRUNCATED` · 503 — the event log could not be read in full, so
|
|
22
26
|
* the totals behind a close or a reconcile would be computed from a partial
|
|
23
27
|
* ledger.
|
|
28
|
+
* - `CASH_DRAWER_BUSY` · 409 — emitted by the shared drawer write
|
|
29
|
+
* (`drawerWriteRefusal`, `stacks/services/shifts.ts`), not by a `/shifts`
|
|
30
|
+
* route: `POST /account` and `POST /cash` answer it when their transaction is
|
|
31
|
+
* cancelled by a pure conflict on any item it writes (most often the drawer
|
|
32
|
+
* row), as do `DELETE /account` and `POST /orders { mode: 'return' }` on a
|
|
33
|
+
* cash leg. Nothing was written; retry the same request.
|
|
24
34
|
* - `SELF_APPROVAL_FORBIDDEN` · 403 — segregation of duties: the cashier who
|
|
25
35
|
* closed a shift cannot reconcile it.
|
|
26
36
|
* - `INVALID_DENOMINATION` · 400 · `INVALID_CURSOR` · 400
|
|
37
|
+
* - `WAREHOUSE_NOT_FOUND` · 404 — `GET /shifts?warehouseId=` naming a depósito
|
|
38
|
+
* the store does not have (`resolveReportWarehouseFilter`).
|
|
27
39
|
* - `ROLE_FORBIDDEN` · 403 · `VALIDATION_FAILED` · 400
|
|
28
40
|
*
|
|
29
41
|
* ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
|
|
30
|
-
* as well
|
|
42
|
+
* as well, and `TERMINAL_ELEVATION_ERROR_CODES` for a money-out movement's PIN
|
|
43
|
+
* elevation.
|
|
31
44
|
*/
|
|
32
45
|
export const SHIFT_ERROR_CODES = [
|
|
33
46
|
'INVALID_SHIFT_ID',
|
|
@@ -42,9 +55,11 @@ export const SHIFT_ERROR_CODES = [
|
|
|
42
55
|
'BUCKET_COUNT_MISSING',
|
|
43
56
|
'SHIFT_CHANGED',
|
|
44
57
|
'SHIFT_EVENTS_TRUNCATED',
|
|
58
|
+
'CASH_DRAWER_BUSY',
|
|
45
59
|
'SELF_APPROVAL_FORBIDDEN',
|
|
46
60
|
'INVALID_DENOMINATION',
|
|
47
61
|
'INVALID_CURSOR',
|
|
62
|
+
'WAREHOUSE_NOT_FOUND',
|
|
48
63
|
'ROLE_FORBIDDEN',
|
|
49
64
|
'VALIDATION_FAILED',
|
|
50
65
|
];
|
package/dist/cjs/cash.js
CHANGED
|
@@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.METHOD_LABEL_SOURCES = exports.SHIFT_ERROR_CODES = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Refusals from the cash-shift surface — `stacks/lambdas/shifts/*.ts`
|
|
6
|
-
* (`_get`, `_post`, `_patchClose`, `_postMovement`, `_patchReconcile`)
|
|
6
|
+
* (`_get`, `_post`, `_patchClose`, `_postMovement`, `_patchReconcile`) — plus
|
|
7
|
+
* the shared drawer write's own `CASH_DRAWER_BUSY`, which `POST /cash`,
|
|
8
|
+
* `POST`/`DELETE /account` and a cash return answer. A tender or seña does
|
|
9
|
+
* not: a tender's drawer collision is `SHIFT_NOT_OPEN` or `422 CURRENCY_MISMATCH`,
|
|
10
|
+
* a seña's `SHIFT_NOT_OPEN` or `409 DEPOSIT_CURRENCY_MISMATCH`.
|
|
7
11
|
*
|
|
8
12
|
* - `INVALID_SHIFT_ID` · 400 · `SHIFT_NOT_FOUND` · 404
|
|
9
13
|
* - `SHIFT_ALREADY_OPEN` · 409 — one open shift per cashier.
|
|
@@ -24,13 +28,22 @@ exports.METHOD_LABEL_SOURCES = exports.SHIFT_ERROR_CODES = void 0;
|
|
|
24
28
|
* - `SHIFT_EVENTS_TRUNCATED` · 503 — the event log could not be read in full, so
|
|
25
29
|
* the totals behind a close or a reconcile would be computed from a partial
|
|
26
30
|
* ledger.
|
|
31
|
+
* - `CASH_DRAWER_BUSY` · 409 — emitted by the shared drawer write
|
|
32
|
+
* (`drawerWriteRefusal`, `stacks/services/shifts.ts`), not by a `/shifts`
|
|
33
|
+
* route: `POST /account` and `POST /cash` answer it when their transaction is
|
|
34
|
+
* cancelled by a pure conflict on any item it writes (most often the drawer
|
|
35
|
+
* row), as do `DELETE /account` and `POST /orders { mode: 'return' }` on a
|
|
36
|
+
* cash leg. Nothing was written; retry the same request.
|
|
27
37
|
* - `SELF_APPROVAL_FORBIDDEN` · 403 — segregation of duties: the cashier who
|
|
28
38
|
* closed a shift cannot reconcile it.
|
|
29
39
|
* - `INVALID_DENOMINATION` · 400 · `INVALID_CURSOR` · 400
|
|
40
|
+
* - `WAREHOUSE_NOT_FOUND` · 404 — `GET /shifts?warehouseId=` naming a depósito
|
|
41
|
+
* the store does not have (`resolveReportWarehouseFilter`).
|
|
30
42
|
* - `ROLE_FORBIDDEN` · 403 · `VALIDATION_FAILED` · 400
|
|
31
43
|
*
|
|
32
44
|
* ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
|
|
33
|
-
* as well
|
|
45
|
+
* as well, and `TERMINAL_ELEVATION_ERROR_CODES` for a money-out movement's PIN
|
|
46
|
+
* elevation.
|
|
34
47
|
*/
|
|
35
48
|
exports.SHIFT_ERROR_CODES = [
|
|
36
49
|
'INVALID_SHIFT_ID',
|
|
@@ -45,9 +58,11 @@ exports.SHIFT_ERROR_CODES = [
|
|
|
45
58
|
'BUCKET_COUNT_MISSING',
|
|
46
59
|
'SHIFT_CHANGED',
|
|
47
60
|
'SHIFT_EVENTS_TRUNCATED',
|
|
61
|
+
'CASH_DRAWER_BUSY',
|
|
48
62
|
'SELF_APPROVAL_FORBIDDEN',
|
|
49
63
|
'INVALID_DENOMINATION',
|
|
50
64
|
'INVALID_CURSOR',
|
|
65
|
+
'WAREHOUSE_NOT_FOUND',
|
|
51
66
|
'ROLE_FORBIDDEN',
|
|
52
67
|
'VALIDATION_FAILED',
|
|
53
68
|
];
|
package/dist/order.d.ts
CHANGED
|
@@ -1867,6 +1867,39 @@ declare global {
|
|
|
1867
1867
|
*/
|
|
1868
1868
|
cancellation?: OrderCancellability;
|
|
1869
1869
|
}
|
|
1870
|
+
/**
|
|
1871
|
+
* `POST /orders { mode: 'tender' }` — ring one or more tender legs against an
|
|
1872
|
+
* EXISTING order (the append counterpart of the create leg's
|
|
1873
|
+
* {@link CreateOrderRequest.tenders}). Any operator but PRINTER or ACCOUNTANT
|
|
1874
|
+
* (`403 ROLE_FORBIDDEN`).
|
|
1875
|
+
*
|
|
1876
|
+
* `shiftId` attributes the legs to a drawer. An EXPLICIT value must be the
|
|
1877
|
+
* caller's own OPEN shift — anything else is `409 SHIFT_NOT_AVAILABLE`, never
|
|
1878
|
+
* a silent drop. OMITTED resolves the caller's own open drawer; with none, a
|
|
1879
|
+
* cash leg lands on the store's default drawer. At commit the drawer is
|
|
1880
|
+
* re-asserted: one that closed mid-request is `409 SHIFT_NOT_OPEN`, one that
|
|
1881
|
+
* did not declare the order's currency `422 CURRENCY_MISMATCH`.
|
|
1882
|
+
*
|
|
1883
|
+
* The opt-in `Idempotency-Key` and the lost-reply recovery through
|
|
1884
|
+
* `mode: 'collection-attempt'` follow the money-write rule documented on
|
|
1885
|
+
* {@link ORDER_ERROR_CODES} (and {@link OrderCollectionAttemptLookupRequest});
|
|
1886
|
+
* it is not restated here. Every refusal specific to this mode is in that
|
|
1887
|
+
* tuple; a body the schema rejects is `400 VALIDATION_FAILED`, and the
|
|
1888
|
+
* cross-cutting refusals (`ROLE_FORBIDDEN`, `IMPERSONATION_READONLY`, …) are
|
|
1889
|
+
* in `GATING_ERROR_CODES`.
|
|
1890
|
+
*
|
|
1891
|
+
* Tied to its validator (`tenderModeSchema`, `stacks/lambdas/orders/_tender.ts`)
|
|
1892
|
+
* by `AssertOrderTenderRequestMatchesSchema` — `mode` is the router's key.
|
|
1893
|
+
*/
|
|
1894
|
+
interface OrderTenderRequest {
|
|
1895
|
+
mode: 'tender';
|
|
1896
|
+
/** `ORD` followed by 6–10 digits. */
|
|
1897
|
+
orderId: string;
|
|
1898
|
+
/** RAW legs — see {@link TenderLegInput}. */
|
|
1899
|
+
tenders: TenderLegInput[];
|
|
1900
|
+
/** 1–100 chars; the caller's own OPEN shift. Omit to use the caller's open drawer. */
|
|
1901
|
+
shiftId?: string;
|
|
1902
|
+
}
|
|
1870
1903
|
/**
|
|
1871
1904
|
* `POST /orders { mode: 'deposit' }` — record a SEÑA (a sales deposit) on an
|
|
1872
1905
|
* existing, undelivered order, as one {@link OrderTender} leg carrying
|
|
@@ -1925,7 +1958,7 @@ declare global {
|
|
|
1925
1958
|
change?: number;
|
|
1926
1959
|
/** Required, never defaulted. `true` needs an authorized factura on the order first. */
|
|
1927
1960
|
freezesPrice: boolean;
|
|
1928
|
-
/** Same semantics as
|
|
1961
|
+
/** Same semantics as {@link OrderTenderRequest.shiftId}. */
|
|
1929
1962
|
shiftId?: string;
|
|
1930
1963
|
}
|
|
1931
1964
|
/**
|