@happyvertical/smrt-inventory 0.57.17 → 0.57.19

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 (45) hide show
  1. package/AGENTS.md +19 -1
  2. package/README.md +32 -2
  3. package/dist/collections/LotCollection.d.ts +22 -0
  4. package/dist/collections/LotCollection.d.ts.map +1 -0
  5. package/dist/collections/LotCorrectionCollection.d.ts +12 -0
  6. package/dist/collections/LotCorrectionCollection.d.ts.map +1 -0
  7. package/dist/collections/LotDocumentCollection.d.ts +12 -0
  8. package/dist/collections/LotDocumentCollection.d.ts.map +1 -0
  9. package/dist/collections/LotStockLevelCollection.d.ts +21 -0
  10. package/dist/collections/LotStockLevelCollection.d.ts.map +1 -0
  11. package/dist/collections/LotUsageCollection.d.ts +18 -0
  12. package/dist/collections/LotUsageCollection.d.ts.map +1 -0
  13. package/dist/collections/index.d.ts +5 -0
  14. package/dist/collections/index.d.ts.map +1 -1
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1168 -31
  18. package/dist/index.js.map +1 -1
  19. package/dist/manifest.json +2921 -288
  20. package/dist/models/Lot.d.ts +96 -0
  21. package/dist/models/Lot.d.ts.map +1 -0
  22. package/dist/models/LotCorrection.d.ts +55 -0
  23. package/dist/models/LotCorrection.d.ts.map +1 -0
  24. package/dist/models/LotDocument.d.ts +45 -0
  25. package/dist/models/LotDocument.d.ts.map +1 -0
  26. package/dist/models/LotStockLevel.d.ts +43 -0
  27. package/dist/models/LotStockLevel.d.ts.map +1 -0
  28. package/dist/models/LotUsage.d.ts +64 -0
  29. package/dist/models/LotUsage.d.ts.map +1 -0
  30. package/dist/models/StockMovement.d.ts +7 -0
  31. package/dist/models/StockMovement.d.ts.map +1 -1
  32. package/dist/models/index.d.ts +5 -0
  33. package/dist/models/index.d.ts.map +1 -1
  34. package/dist/services/LotService.d.ts +258 -0
  35. package/dist/services/LotService.d.ts.map +1 -0
  36. package/dist/services/StockService.d.ts +25 -2
  37. package/dist/services/StockService.d.ts.map +1 -1
  38. package/dist/services/index.d.ts +2 -0
  39. package/dist/services/index.d.ts.map +1 -1
  40. package/dist/services/lot-errors.d.ts +44 -0
  41. package/dist/services/lot-errors.d.ts.map +1 -0
  42. package/dist/smrt-knowledge.json +1333 -76
  43. package/dist/types.d.ts +6 -0
  44. package/dist/types.d.ts.map +1 -1
  45. package/package.json +8 -8
package/AGENTS.md CHANGED
@@ -11,7 +11,13 @@ Multi-location stock tracking. Strictly industry-neutral — the same primitives
11
11
  | `StockLevel` | Materialized `qty` for a `(skuId, locationId, state)` tuple. Upserted in place. **Mutated only by `StockService`.** States: `available`, `allocated`, `wip`, `qc_hold`, `damaged`. |
12
12
  | `StockMovement` | Append-only audit log. Every `StockService` mutation writes one (or two for `transfer`). `sourceType` + `sourceId` carry cross-package attribution. |
13
13
 
14
- All three inventory models (`InventoryLocation`, `StockLevel`, `StockMovement`) use `@TenantScoped({ mode: 'optional' })` + nullable `tenantId` so they can be used either tenant-scoped or globally. The catalog shapes (`Product`, `Material`, `ProductVariant`, `Sku`) live in `@happyvertical/smrt-products` and carry their own tenant decoration there.
14
+ | `Lot` | A traceable batch or serial (`inventory_lots`). `conflictColumns: ['identity_key','tenant_id']`, every create insert-only. **Written only by `LotService`.** |
15
+ | `LotStockLevel` | Per-lot balance for `(lotId, locationId, state)` (`inventory_lot_stock_levels`). **Mutated only by `StockService`** when `lotId` is passed. |
16
+ | `LotUsage` | A lot used by a consumer: the trace edge. Never deleted; `status: 'unlinked'` after a correction. `consumerType: 'Lot'` marks assembly lineage. |
17
+ | `LotCorrection` | Append-only correction trail (`conflictColumns: ['id']`); reason mandatory. |
18
+ | `LotDocument` | Asset attached to a lot (`assetId` is a cross-package ref); detached, never deleted. |
19
+
20
+ All inventory models (`InventoryLocation`, `StockLevel`, `StockMovement`, and the lot models) use `@TenantScoped({ mode: 'optional' })` + nullable `tenantId` so they can be used either tenant-scoped or globally. The catalog shapes (`Product`, `Material`, `ProductVariant`, `Sku`) live in `@happyvertical/smrt-products` and carry their own tenant decoration there.
15
21
 
16
22
  ## StockService — the only sanctioned way to mutate stock
17
23
 
@@ -38,6 +44,18 @@ await service.adjust(skuId, locationId, delta, { sourceType, sourceId });
38
44
 
39
45
  All methods reject zero / negative / non-finite quantities except `adjust`, which accepts non-zero signed deltas. Negative deltas that would drive a state below zero throw `InsufficientStockError`.
40
46
 
47
+ ## LotService — lots and serials (additive, #3459)
48
+
49
+ `createLotService({ db })` (with `withTransaction`, same pattern as `StockService`) is the only writer of the lot tables. `receiveLot` records identity only and moves no stock; compose with `StockService` in one transaction via `createLotService({ db: tx.db })`. Passing `lotId` to a `StockService` mutation applies the same deltas to `LotStockLevel`, enforces non-negative at lot level (`InsufficientStockError.lotId`), validates the lot (`LotNotFoundError`, `LotMismatchError` when `lot.skuId` differs), and stamps `StockMovement.lotId`.
50
+
51
+ - `Lot.identityKey` is the only DB-unique key: `u:<kind>:<sku>:<SEARCHKEY>` for unique lots and all serials (hashed if over 160 chars), `k:<idempotencyKey>` for idempotent receipts, else a random `r:` key. So a lot number repeats by default (one supplier lot, two receipts); `DuplicateLotError` only for unique ones.
52
+ - Corrections (`correctLotNumber`, `correctAttributes`, `setStatus`, `unlinkUsage`, `detachDocument`) require a reason, are refused when nothing changes, and write a `LotCorrection`. They `save()` the lot so concurrent changes conflict on its revision; retry the loser.
53
+ - `recordUsage` is idempotent per consumer; `exclusive` (default for serials) throws `LotInUseError` for a second consumer.
54
+ - `traceForward(lotId)` / `traceBack(consumerType, consumerId)` follow `consumerType: 'Lot'` usages with a path-based cycle guard and `depth` (default 10).
55
+ - `StockService` does not consult `lot.status`: callers decide what a quarantined or void lot may do. A repeated `idempotencyKey` returns the first lot even if the other fields differ; a repeated `recordUsage` for the same consumer returns the existing usage unchanged (its `qty` is ignored).
56
+ - No authorization inside the package; callers authorize. Nothing assumes an id format, so a consumer's data migration may insert rows with its own ids.
57
+ - Schema upgrade is additive: five new tables and one nullable column, `inventory_stock_movements.lot_id`. `StockLevel`'s unique key is unchanged. Runtime never creates schema: generate and apply the normal migration first (`smrt doctor --db`); no data copy is needed.
58
+
41
59
  ## Opt-in DispatchBus hooks
42
60
 
43
61
  Off by default. Wire them up explicitly in the application's `smrt.ts`:
package/README.md CHANGED
@@ -122,7 +122,7 @@ try {
122
122
 
123
123
  ### Multi-tenancy
124
124
 
125
- The three inventory models (`InventoryLocation`, `StockLevel`, `StockMovement`) use `@TenantScoped({ mode: 'optional' })` with a nullable `tenantId`. The catalog shapes (`Sku`, `Product`, `ProductVariant`, `Material`) live in `@happyvertical/smrt-products` and carry their own tenant decoration there; the cross-package id refs flow through unchanged. Wrap mutations in `withTenant()` from `@happyvertical/smrt-tenancy` to scope queries automatically.
125
+ The inventory models (`InventoryLocation`, `StockLevel`, `StockMovement`, and the lot models `Lot`, `LotUsage`, `LotCorrection`, `LotDocument`, `LotStockLevel`) use `@TenantScoped({ mode: 'optional' })` with a nullable `tenantId`. The catalog shapes (`Sku`, `Product`, `ProductVariant`, `Material`) live in `@happyvertical/smrt-products` and carry their own tenant decoration there; the cross-package id refs flow through unchanged. Wrap mutations in `withTenant()` from `@happyvertical/smrt-tenancy` to scope queries automatically.
126
126
 
127
127
  ```typescript
128
128
  import { withTenant } from '@happyvertical/smrt-tenancy';
@@ -171,7 +171,12 @@ Per-handler toggles (`installContractReserved`, `installFulfillmentShipped`) let
171
171
  |---|---|
172
172
  | `InventoryLocation` | Physical or virtual stocking site with open-ended `kind`. |
173
173
  | `StockLevel` | Materialized `(skuId, locationId, state) → qty` row. **Never mutate directly — use `StockService`.** |
174
- | `StockMovement` | Append-only audit row. One per mutation; two for transfers. |
174
+ | `StockMovement` | Append-only audit row. One per mutation; two for transfers. Carries a nullable `lotId`. |
175
+ | `Lot` | A batch (`kind: 'lot'`) or single unit (`'serial'`) with a number, attributes and status. **Write via `LotService`.** |
176
+ | `LotStockLevel` | Materialized `(lotId, locationId, state) → qty` row. **Written only by `StockService`.** |
177
+ | `LotUsage` | A lot used by a consumer (`consumerType` + `consumerId`; `'Lot'` for assemblies). Never deleted; `unlinked` instead. |
178
+ | `LotCorrection` | Append-only record of every correction, with reason, old and new value. |
179
+ | `LotDocument` | A stored file (an Asset id) attached to a lot. Detached, never deleted. |
175
180
 
176
181
  ### Collections
177
182
 
@@ -180,6 +185,10 @@ Per-handler toggles (`installContractReserved`, `installFulfillmentShipped`) let
180
185
  | `InventoryLocationCollection` | `findByCode`, `findByKind`, `findByPlace`, `findActive` |
181
186
  | `StockLevelCollection` | `getLevel`, `findBySku`, `findByLocation`, `totalForSku`, `totalForLocation` |
182
187
  | `StockMovementCollection` | `findBySku`, `findByLocation`, `findBySource`, `findByReason` |
188
+ | `LotCollection` | `findByLotNumber(number, { skuId? })` (case-insensitive) |
189
+ | `LotStockLevelCollection` | `getLevel(lotId, locationId, state?)`, `onHand(lotId, state?)` |
190
+ | `LotUsageCollection` | `findActiveForLot`, `findForConsumer` |
191
+ | `LotCorrectionCollection`, `LotDocumentCollection` | Read access |
183
192
 
184
193
  All catalog shapes (`Product`, `Material`, `ProductVariant`, `Sku`) live in [`@happyvertical/smrt-products`](../products). This package adds the stock-motion layer (`InventoryLocation`, `StockLevel`, `StockMovement`, `StockService`) on top.
185
194
 
@@ -190,8 +199,29 @@ All catalog shapes (`Product`, `Material`, `ProductVariant`, `Sku`) live in [`@h
190
199
  | `StockService` | The only sanctioned mutation surface. Six methods: `receive`, `reserve`, `release`, `fulfill`, `transfer`, `adjust`. |
191
200
  | `createStockService({ db })` | Convenience factory. |
192
201
  | `InsufficientStockError` | Thrown by `reserve` / `fulfill` / `transfer` / negative `adjust` when stock would go negative. Carries `skuId`, `locationId`, `state`, `requested`, `available`. |
202
+ | `LotService` / `createLotService({ db })` | Lots and serials: `receiveLot`, `correctLotNumber`, `correctAttributes`, `setStatus`, `recordUsage`, `unlinkUsage`, `attachDocument`, `detachDocument`, `history`, `traceForward`, `traceBack`, `withTransaction`. |
203
+ | `DuplicateLotError`, `LotInUseError`, `LotMismatchError`, `LotNotFoundError`, `LotCorrectionError` | Lot failures. |
193
204
  | `installInventoryDispatchHandlers({ dispatchBus, db })` | Opt-in DispatchBus wiring for `contract:created` and `fulfillment:shipped`. |
194
205
 
206
+ ### Lots and serials
207
+
208
+ Pass `lotId` to any `StockService` mutation and the same deltas are applied per lot (with the same non-negative rule) and the lot is stamped on every movement; SKU-level balances behave as before. `LotService` creates the lots. Receiving a lot moves no stock, so compose both in one transaction:
209
+
210
+ ```typescript
211
+ await stock.withTransaction(async (tx) => {
212
+ const lots = await createLotService({ db: tx.db });
213
+ const lot = await lots.receiveLot({ lotNumber: 'B-1042', skuId, receivedQty: 40 });
214
+ await tx.receive(skuId, locationId, 40, { lotId: lot.id });
215
+ });
216
+ await lots.recordUsage(lot.id, { consumerType: 'ProductionOrder', consumerId });
217
+ const trace = await lots.traceForward(lot.id); // where it went
218
+ const sources = await lots.traceBack('ProductionOrder', consumerId); // where it came from
219
+ ```
220
+
221
+ A lot number is not unique by default (one supplier lot can arrive on two receipts); pass `unique: true`, or `kind: 'serial'`, to make it so, or `idempotencyKey` to make a receipt retry-safe. A repeated `idempotencyKey` returns the first lot even if other fields differ, and a repeated `recordUsage` for one consumer returns the existing usage unchanged. `StockService` ignores `lot.status`; callers decide what a quarantined lot may do. Corrections always need a reason. No authorization is checked in the package; callers authorize and pass `actorProfileId`.
222
+
223
+ Existing deployments must generate and apply their normal s-m-r-t schema migration before using lots: five new tables (`inventory_lots`, `inventory_lot_stock_levels`, `inventory_lot_usages`, `inventory_lot_corrections`, `inventory_lot_documents`) and a nullable `lot_id` on `inventory_stock_movements` (UUID on PostgreSQL/DuckDB, text on SQLite). Existing rows and `StockLevel`'s unique key are unchanged; runtime reads do not create tables.
224
+
195
225
  ### Types
196
226
 
197
227
  | Export | Description |
@@ -0,0 +1,22 @@
1
+ /**
2
+ * LotCollection — read helpers for lots. Writes go through
3
+ * {@link LotService}.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ import { SmrtCollection } from '@happyvertical/smrt-core';
8
+ import { Lot } from '../models/Lot.js';
9
+ /** Normal form of a lot number used for lookup: trimmed and upper-cased. */
10
+ export declare function lotSearchKey(lotNumber: string): string;
11
+ export declare class LotCollection extends SmrtCollection<Lot> {
12
+ static readonly _itemClass: typeof Lot;
13
+ /**
14
+ * Find lots by number, case-insensitively and ignoring surrounding
15
+ * whitespace. A number can match several lots (one supplier lot received
16
+ * twice); pass `skuId` to narrow. Oldest receipt first.
17
+ */
18
+ findByLotNumber(lotNumber: string, options?: {
19
+ skuId?: string | null;
20
+ }): Promise<Lot[]>;
21
+ }
22
+ //# sourceMappingURL=LotCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LotCollection.d.ts","sourceRoot":"","sources":["../../src/collections/LotCollection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,qBAAa,aAAc,SAAQ,cAAc,CAAC,GAAG,CAAC;IACpD,MAAM,CAAC,QAAQ,CAAC,UAAU,aAAO;IAEjC;;;;OAIG;IACG,eAAe,CACnB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAO,GACtC,OAAO,CAAC,GAAG,EAAE,CAAC;CAOlB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * LotCorrectionCollection — read access to the append-only correction
3
+ * trail. Writes go through {@link LotService}.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ import { SmrtCollection } from '@happyvertical/smrt-core';
8
+ import { LotCorrection } from '../models/LotCorrection.js';
9
+ export declare class LotCorrectionCollection extends SmrtCollection<LotCorrection> {
10
+ static readonly _itemClass: typeof LotCorrection;
11
+ }
12
+ //# sourceMappingURL=LotCorrectionCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LotCorrectionCollection.d.ts","sourceRoot":"","sources":["../../src/collections/LotCorrectionCollection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,qBAAa,uBAAwB,SAAQ,cAAc,CAAC,aAAa,CAAC;IACxE,MAAM,CAAC,QAAQ,CAAC,UAAU,uBAAiB;CAC5C"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * LotDocumentCollection — read access to documents attached to lots.
3
+ * Writes go through {@link LotService}.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ import { SmrtCollection } from '@happyvertical/smrt-core';
8
+ import { LotDocument } from '../models/LotDocument.js';
9
+ export declare class LotDocumentCollection extends SmrtCollection<LotDocument> {
10
+ static readonly _itemClass: typeof LotDocument;
11
+ }
12
+ //# sourceMappingURL=LotDocumentCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LotDocumentCollection.d.ts","sourceRoot":"","sources":["../../src/collections/LotDocumentCollection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACpE,MAAM,CAAC,QAAQ,CAAC,UAAU,qBAAe;CAC1C"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * LotStockLevelCollection — read helpers for per-lot balances.
3
+ *
4
+ * Mutations live in {@link StockService}; see {@link StockLevelCollection}.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ import { SmrtCollection } from '@happyvertical/smrt-core';
9
+ import { LotStockLevel } from '../models/LotStockLevel.js';
10
+ import type { StockState } from '../types.js';
11
+ export declare class LotStockLevelCollection extends SmrtCollection<LotStockLevel> {
12
+ static readonly _itemClass: typeof LotStockLevel;
13
+ /** The level row for a `(lotId, locationId, state)` tuple, or `null`. */
14
+ getLevel(lotId: string, locationId: string, state?: StockState): Promise<LotStockLevel | null>;
15
+ /**
16
+ * Sum of the lot's quantity across locations. Pass `state` to narrow
17
+ * to one state; omit it for the total across all states.
18
+ */
19
+ onHand(lotId: string, state?: StockState): Promise<number>;
20
+ }
21
+ //# sourceMappingURL=LotStockLevelCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LotStockLevelCollection.d.ts","sourceRoot":"","sources":["../../src/collections/LotStockLevelCollection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,uBAAwB,SAAQ,cAAc,CAAC,aAAa,CAAC;IACxE,MAAM,CAAC,QAAQ,CAAC,UAAU,uBAAiB;IAE3C,yEAAyE;IACnE,QAAQ,CACZ,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,UAAwB,GAC9B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAQhC;;;OAGG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;CAMjE"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * LotUsageCollection — read helpers for lot usage edges. Writes go
3
+ * through {@link LotService}.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ import { SmrtCollection } from '@happyvertical/smrt-core';
8
+ import { LotUsage } from '../models/LotUsage.js';
9
+ export declare class LotUsageCollection extends SmrtCollection<LotUsage> {
10
+ static readonly _itemClass: typeof LotUsage;
11
+ /** Usages of the lot that have not been unlinked, oldest first. */
12
+ findActiveForLot(lotId: string): Promise<LotUsage[]>;
13
+ /** Every usage by one consumer, oldest first. Active only unless asked. */
14
+ findForConsumer(consumerType: string, consumerId: string, options?: {
15
+ includeUnlinked?: boolean;
16
+ }): Promise<LotUsage[]>;
17
+ }
18
+ //# sourceMappingURL=LotUsageCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LotUsageCollection.d.ts","sourceRoot":"","sources":["../../src/collections/LotUsageCollection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D,MAAM,CAAC,QAAQ,CAAC,UAAU,kBAAY;IAEtC,mEAAmE;IAC7D,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAO1D,2EAA2E;IACrE,eAAe,CACnB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAO,GAC1C,OAAO,CAAC,QAAQ,EAAE,CAAC;CAKvB"}
@@ -10,6 +10,11 @@
10
10
  */
11
11
  import '../__smrt-register__.js';
12
12
  export { InventoryLocationCollection } from './InventoryLocationCollection.js';
13
+ export { LotCollection, lotSearchKey } from './LotCollection.js';
14
+ export { LotCorrectionCollection } from './LotCorrectionCollection.js';
15
+ export { LotDocumentCollection } from './LotDocumentCollection.js';
16
+ export { LotStockLevelCollection } from './LotStockLevelCollection.js';
17
+ export { LotUsageCollection } from './LotUsageCollection.js';
13
18
  export { StockLevelCollection } from './StockLevelCollection.js';
14
19
  export { StockMovementCollection } from './StockMovementCollection.js';
15
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -44,9 +44,9 @@
44
44
  * @packageDocumentation
45
45
  */
46
46
  import './__smrt-register__.js';
47
- export { InventoryLocationCollection, StockLevelCollection, StockMovementCollection, } from './collections/index.js';
48
- export { InventoryLocation, type InventoryLocationOptions, StockLevel, type StockLevelOptions, StockMovement, type StockMovementOptions, } from './models/index.js';
47
+ export { InventoryLocationCollection, LotCollection, LotCorrectionCollection, LotDocumentCollection, LotStockLevelCollection, LotUsageCollection, lotSearchKey, StockLevelCollection, StockMovementCollection, } from './collections/index.js';
48
+ export { InventoryLocation, type InventoryLocationOptions, Lot, LotCorrection, type LotCorrectionOptions, LotDocument, type LotDocumentOptions, type LotOptions, LotStockLevel, type LotStockLevelOptions, LotUsage, type LotUsageOptions, StockLevel, type StockLevelOptions, StockMovement, type StockMovementOptions, } from './models/index.js';
49
49
  export { StockRecipe } from './recipes.js';
50
- export { type ContractCreatedLine, type ContractCreatedPayload, createStockService, type FulfillmentShippedLine, type FulfillmentShippedPayload, type InstalledInventoryDispatchHandlers, type InstallInventoryDispatchHandlersOptions, InsufficientStockError, installInventoryDispatchHandlers, type StockMutationOptions, StockService, type StockServiceOptions, } from './services/index.js';
51
- export type { InventoryLocationKind, StockMovementReason, StockState, } from './types.js';
50
+ export { type AttachDocumentInput, type ContractCreatedLine, type ContractCreatedPayload, createLotService, createStockService, DuplicateLotError, type FulfillmentShippedLine, type FulfillmentShippedPayload, type InstalledInventoryDispatchHandlers, type InstallInventoryDispatchHandlersOptions, InsufficientStockError, installInventoryDispatchHandlers, type LotChangeOptions, LotCorrectionError, LotInUseError, LotMismatchError, LotNotFoundError, LotService, type LotServiceOptions, type ReceiveLotInput, type RecordUsageInput, type StockMutationOptions, StockService, type StockServiceOptions, type TraceNode, type TraceOptions, } from './services/index.js';
51
+ export type { InventoryLocationKind, LotCorrectionKind, LotKind, LotUsageStatus, StockMovementReason, StockState, } from './types.js';
52
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAMH,OAAO,wBAAwB,CAAC;AAKhC,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,UAAU,EACV,KAAK,iBAAiB,EACtB,aAAa,EACb,KAAK,oBAAoB,GAC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