sinfactura-types 1.10.376 → 1.10.378
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/cjs/stock.js +12 -1
- package/dist/cycleCount.d.ts +25 -1
- package/dist/stock.d.ts +10 -2
- package/dist/stock.js +12 -1
- package/package.json +1 -1
package/dist/cjs/stock.js
CHANGED
|
@@ -68,8 +68,16 @@ exports.MAX_STOCK_ADJUSTMENT_NOTE_BYTES = 280;
|
|
|
68
68
|
* than the count.
|
|
69
69
|
* - `PRODUCT_NOT_FOUND` · 404 — from the pre-check AND from classifying a
|
|
70
70
|
* cancelled transaction, so it is reachable even after the pre-check passed.
|
|
71
|
-
* - `STOCK_ADJUSTMENT_RACED` · 409 — a concurrent movement won the ledger write
|
|
71
|
+
* - `STOCK_ADJUSTMENT_RACED` · 409 — a concurrent movement won the ledger write, or
|
|
72
|
+
* moved the product between an `opening_balance` check and its write.
|
|
72
73
|
* Re-read and retry; the adjustment did NOT apply.
|
|
74
|
+
* - `OPENING_BALANCE_EXISTS` · 409 — `opening_balance` on a product that already
|
|
75
|
+
* has an opening row. Nothing applied; the product needs no second one.
|
|
76
|
+
* - `OPENING_BALANCE_QUANTITY_MISMATCH` · 400 — `opening_balance` whose
|
|
77
|
+
* `quantityDelta` is not the product's `counter − ledger` delta. `data.expectedQuantityDelta`
|
|
78
|
+
* carries the figure that would be accepted; `0` means there is nothing to explain.
|
|
79
|
+
* - `OPENING_BALANCE_UNVERIFIABLE` · 409 — the product's ledger is too long to sum,
|
|
80
|
+
* so the opening balance cannot be checked and is not written.
|
|
73
81
|
*
|
|
74
82
|
* ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
|
|
75
83
|
* as well.
|
|
@@ -80,4 +88,7 @@ exports.STOCK_ADJUSTMENT_ERROR_CODES = [
|
|
|
80
88
|
'STOCK_ADJUSTMENT_REASON_DIRECTION_MISMATCH',
|
|
81
89
|
'PRODUCT_NOT_FOUND',
|
|
82
90
|
'STOCK_ADJUSTMENT_RACED',
|
|
91
|
+
'OPENING_BALANCE_EXISTS',
|
|
92
|
+
'OPENING_BALANCE_QUANTITY_MISMATCH',
|
|
93
|
+
'OPENING_BALANCE_UNVERIFIABLE',
|
|
83
94
|
];
|
package/dist/cycleCount.d.ts
CHANGED
|
@@ -267,7 +267,13 @@ declare global {
|
|
|
267
267
|
* nothing to show for it.
|
|
268
268
|
*/
|
|
269
269
|
systemQuantity: number;
|
|
270
|
-
/**
|
|
270
|
+
/**
|
|
271
|
+
* What the operator physically counted.
|
|
272
|
+
*
|
|
273
|
+
* ⚠️ Still required on a SKIPPED line (`skippedAt` set), where it carries
|
|
274
|
+
* no meaning: send `0`. Finalise, the tolerance gate and every variance
|
|
275
|
+
* ignore it there — a skipped line is never read as "counted zero".
|
|
276
|
+
*/
|
|
271
277
|
countedQuantity: number;
|
|
272
278
|
/**
|
|
273
279
|
* The batch counted, when the product is lot-tracked.
|
|
@@ -283,6 +289,24 @@ declare global {
|
|
|
283
289
|
note?: string;
|
|
284
290
|
/** Unix ms this line was captured. Its distance from `finalizedAt` is how stale `systemQuantity` is. */
|
|
285
291
|
countedAt?: number;
|
|
292
|
+
/**
|
|
293
|
+
* Unix ms the operator marked this line UNREACHABLE (a locked case, a
|
|
294
|
+
* blocked aisle) — deliberately not walked, which is neither dropped nor
|
|
295
|
+
* counted as `0`.
|
|
296
|
+
*
|
|
297
|
+
* - The line STAYS in `items`, so the count's scope never silently shrinks.
|
|
298
|
+
* - Mutually exclusive with `countedAt`: a line carrying both is refused 400.
|
|
299
|
+
* - Finalise applies NO adjustment for it, and the tolerance gate never
|
|
300
|
+
* measures it. ⚠️ Because `systemQuantity` is the WHOLE-product counter,
|
|
301
|
+
* one skipped line takes its whole PRODUCT out of the finalise: the other
|
|
302
|
+
* lots' counts cannot be compared against a baseline that includes the
|
|
303
|
+
* unwalked one, so that product's stock is left untouched.
|
|
304
|
+
* - Undone by re-sending the line without it on an open session (`edit`
|
|
305
|
+
* replaces the whole array); the line is then uncounted again.
|
|
306
|
+
*/
|
|
307
|
+
skippedAt?: number;
|
|
308
|
+
/** Why the line was skipped. Only with `skippedAt`. ⚠️ Never personal data — same un-scrubbed, TTL-less row as `note`. */
|
|
309
|
+
skippedReason?: string;
|
|
286
310
|
}
|
|
287
311
|
}
|
|
288
312
|
export {};
|
package/dist/stock.d.ts
CHANGED
|
@@ -554,12 +554,20 @@ declare global {
|
|
|
554
554
|
* than the count.
|
|
555
555
|
* - `PRODUCT_NOT_FOUND` · 404 — from the pre-check AND from classifying a
|
|
556
556
|
* cancelled transaction, so it is reachable even after the pre-check passed.
|
|
557
|
-
* - `STOCK_ADJUSTMENT_RACED` · 409 — a concurrent movement won the ledger write
|
|
557
|
+
* - `STOCK_ADJUSTMENT_RACED` · 409 — a concurrent movement won the ledger write, or
|
|
558
|
+
* moved the product between an `opening_balance` check and its write.
|
|
558
559
|
* Re-read and retry; the adjustment did NOT apply.
|
|
560
|
+
* - `OPENING_BALANCE_EXISTS` · 409 — `opening_balance` on a product that already
|
|
561
|
+
* has an opening row. Nothing applied; the product needs no second one.
|
|
562
|
+
* - `OPENING_BALANCE_QUANTITY_MISMATCH` · 400 — `opening_balance` whose
|
|
563
|
+
* `quantityDelta` is not the product's `counter − ledger` delta. `data.expectedQuantityDelta`
|
|
564
|
+
* carries the figure that would be accepted; `0` means there is nothing to explain.
|
|
565
|
+
* - `OPENING_BALANCE_UNVERIFIABLE` · 409 — the product's ledger is too long to sum,
|
|
566
|
+
* so the opening balance cannot be checked and is not written.
|
|
559
567
|
*
|
|
560
568
|
* ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
|
|
561
569
|
* as well.
|
|
562
570
|
*/
|
|
563
|
-
export declare const STOCK_ADJUSTMENT_ERROR_CODES: readonly ["ROLE_FORBIDDEN", "VALIDATION_FAILED", "STOCK_ADJUSTMENT_REASON_DIRECTION_MISMATCH", "PRODUCT_NOT_FOUND", "STOCK_ADJUSTMENT_RACED"];
|
|
571
|
+
export declare const STOCK_ADJUSTMENT_ERROR_CODES: readonly ["ROLE_FORBIDDEN", "VALIDATION_FAILED", "STOCK_ADJUSTMENT_REASON_DIRECTION_MISMATCH", "PRODUCT_NOT_FOUND", "STOCK_ADJUSTMENT_RACED", "OPENING_BALANCE_EXISTS", "OPENING_BALANCE_QUANTITY_MISMATCH", "OPENING_BALANCE_UNVERIFIABLE"];
|
|
564
572
|
export type StockAdjustmentErrorCode = (typeof STOCK_ADJUSTMENT_ERROR_CODES)[number];
|
|
565
573
|
export {};
|
package/dist/stock.js
CHANGED
|
@@ -65,8 +65,16 @@ export const MAX_STOCK_ADJUSTMENT_NOTE_BYTES = 280;
|
|
|
65
65
|
* than the count.
|
|
66
66
|
* - `PRODUCT_NOT_FOUND` · 404 — from the pre-check AND from classifying a
|
|
67
67
|
* cancelled transaction, so it is reachable even after the pre-check passed.
|
|
68
|
-
* - `STOCK_ADJUSTMENT_RACED` · 409 — a concurrent movement won the ledger write
|
|
68
|
+
* - `STOCK_ADJUSTMENT_RACED` · 409 — a concurrent movement won the ledger write, or
|
|
69
|
+
* moved the product between an `opening_balance` check and its write.
|
|
69
70
|
* Re-read and retry; the adjustment did NOT apply.
|
|
71
|
+
* - `OPENING_BALANCE_EXISTS` · 409 — `opening_balance` on a product that already
|
|
72
|
+
* has an opening row. Nothing applied; the product needs no second one.
|
|
73
|
+
* - `OPENING_BALANCE_QUANTITY_MISMATCH` · 400 — `opening_balance` whose
|
|
74
|
+
* `quantityDelta` is not the product's `counter − ledger` delta. `data.expectedQuantityDelta`
|
|
75
|
+
* carries the figure that would be accepted; `0` means there is nothing to explain.
|
|
76
|
+
* - `OPENING_BALANCE_UNVERIFIABLE` · 409 — the product's ledger is too long to sum,
|
|
77
|
+
* so the opening balance cannot be checked and is not written.
|
|
70
78
|
*
|
|
71
79
|
* ⚠️ Cross-cutting refusals are NOT repeated here — check `GATING_ERROR_CODES`
|
|
72
80
|
* as well.
|
|
@@ -77,4 +85,7 @@ export const STOCK_ADJUSTMENT_ERROR_CODES = [
|
|
|
77
85
|
'STOCK_ADJUSTMENT_REASON_DIRECTION_MISMATCH',
|
|
78
86
|
'PRODUCT_NOT_FOUND',
|
|
79
87
|
'STOCK_ADJUSTMENT_RACED',
|
|
88
|
+
'OPENING_BALANCE_EXISTS',
|
|
89
|
+
'OPENING_BALANCE_QUANTITY_MISMATCH',
|
|
90
|
+
'OPENING_BALANCE_UNVERIFIABLE',
|
|
80
91
|
];
|