sinfactura-types 1.10.301 → 1.10.302

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.
Files changed (2) hide show
  1. package/dist/lot.d.ts +34 -0
  2. package/package.json +1 -1
package/dist/lot.d.ts CHANGED
@@ -104,6 +104,40 @@ declare global {
104
104
  notes?: string;
105
105
  /** Soft delete. A lot is never hard-deleted: movement rows reference `lotId` permanently. */
106
106
  disabled?: boolean;
107
+ /**
108
+ * The sparse FEFO expiry index's partition value — `LOT#{storeId}`.
109
+ *
110
+ * ⚠️ **OPTIONAL, and the optionality is load-bearing.** Only a lot carrying
111
+ * an `expiryDate` is stamped with this and {@link Lot.expiryRef} — a lot with
112
+ * no expiry (a serialised component batch, traceability-only stock) must be
113
+ * ABSENT from the index rather than present with an invented sentinel. A
114
+ * required field here would force every writer to invent one, and every
115
+ * undated lot would then enter the expiry sweep as if it were about to go
116
+ * bad. Written and cleared together with {@link Lot.expiryRef} — the two
117
+ * always change as a pair; nothing may set one without the other.
118
+ */
119
+ expiryKey?: string;
120
+ /**
121
+ * The sparse FEFO expiry index's sort value —
122
+ * `{expiryDate zero-padded}#{productId}#{lotId}`.
123
+ *
124
+ * ⚠️ **OPTIONAL for the same reason {@link Lot.expiryKey} is, and the two are
125
+ * one unit.** Absent on every lot with no `expiryDate`; present only
126
+ * alongside `expiryKey`. The date is zero-padded so the sort key compares
127
+ * correctly as a STRING — DynamoDB orders an `S` sort key lexicographically,
128
+ * and an unpadded number would put `99999999` before `100000000` the moment
129
+ * the digit count changed. `productId` and `lotId` are appended only to keep
130
+ * the key unique per lot; `storeId` is deliberately NOT in this value — the
131
+ * partition (`expiryKey`) already carries it, the same reasoning
132
+ * `inventoryLevelWarehouseRef` states for its own sort value.
133
+ */
134
+ expiryRef?: string;
135
+ /**
136
+ * Lowercase '#'-joined write-side index over `lotCode`/`notes`. Internal;
137
+ * not part of the read contract — rebuilt by the service on every insert
138
+ * and update, same convention as `Warehouse.search`.
139
+ */
140
+ search?: string;
107
141
  }
108
142
  }
109
143
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.301",
3
+ "version": "1.10.302",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",