@happyvertical/smrt-inventory 0.40.65 → 0.40.66
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/index.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +175 -17
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ObjectRegistry, SmrtCollection, SmrtObject, field, resolveDatabase, smr
|
|
|
2
2
|
import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy";
|
|
3
3
|
import { createLogger } from "@happyvertical/logger";
|
|
4
4
|
//#region src/__smrt-register__.ts
|
|
5
|
-
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-inventory\",\"packageVersion\":\"0.40.65\",\"objects\":{\"@happyvertical/smrt-inventory:InventoryLocationCollection\":{\"name\":\"inventorylocationcollection\",\"className\":\"InventoryLocationCollection\",\"qualifiedName\":\"@happyvertical/smrt-inventory:InventoryLocationCollection\",\"collection\":\"inventorylocations\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/collections/InventoryLocationCollection.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{},\"methods\":{\"findByCode\":{\"name\":\"findByCode\",\"async\":true,\"parameters\":[{\"name\":\"code\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<InventoryLocation | null>\",\"isStatic\":false,\"isPublic\":true},\"findByKind\":{\"name\":\"findByKind\",\"async\":true,\"parameters\":[{\"name\":\"kind\",\"type\":\"InventoryLocationKind\",\"optional\":false}],\"returnType\":\"Promise<InventoryLocation[]>\",\"isStatic\":false,\"isPublic\":true},\"findByPlace\":{\"name\":\"findByPlace\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<InventoryLocation[]>\",\"isStatic\":false,\"isPublic\":true},\"findActive\":{\"name\":\"findActive\",\"async\":true,\"parameters\":[{\"name\":\"kind\",\"type\":\"InventoryLocationKind\",\"optional\":true}],\"returnType\":\"Promise<InventoryLocation[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"inventory_locations\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"InventoryLocation\",\"exportName\":\"InventoryLocationCollection\",\"collectionExportName\":\"InventoryLocationCollectionCollection\",\"schema\":{\"tableName\":\"inventory_locations\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_locations\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"inventory_locations_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_locations_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"a8cccfa5\"}},\"@happyvertical/smrt-inventory:StockLevelCollection\":{\"name\":\"stocklevelcollection\",\"className\":\"StockLevelCollection\",\"qualifiedName\":\"@happyvertical/smrt-inventory:StockLevelCollection\",\"collection\":\"stocklevels\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/collections/StockLevelCollection.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{},\"methods\":{\"getLevel\":{\"name\":\"getLevel\",\"async\":true,\"parameters\":[{\"name\":\"skuId\",\"type\":\"string\",\"optional\":false},{\"name\":\"locationId\",\"type\":\"string\",\"optional\":false},{\"name\":\"state\",\"type\":\"StockState\",\"optional\":true,\"default\":\"available\"}],\"returnType\":\"Promise<StockLevel | null>\",\"isStatic\":false,\"isPublic\":true},\"findBySku\":{\"name\":\"findBySku\",\"async\":true,\"parameters\":[{\"name\":\"skuId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockLevel[]>\",\"isStatic\":false,\"isPublic\":true},\"findByLocation\":{\"name\":\"findByLocation\",\"async\":true,\"parameters\":[{\"name\":\"locationId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockLevel[]>\",\"isStatic\":false,\"isPublic\":true},\"totalForSku\":{\"name\":\"totalForSku\",\"async\":true,\"parameters\":[{\"name\":\"skuId\",\"type\":\"string\",\"optional\":false},{\"name\":\"state\",\"type\":\"StockState\",\"optional\":true}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true},\"totalForLocation\":{\"name\":\"totalForLocation\",\"async\":true,\"parameters\":[{\"name\":\"locationId\",\"type\":\"string\",\"optional\":false},{\"name\":\"state\",\"type\":\"StockState\",\"optional\":true}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"inventory_stock_levels\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"StockLevel\",\"exportName\":\"StockLevelCollection\",\"collectionExportName\":\"StockLevelCollectionCollection\",\"schema\":{\"tableName\":\"inventory_stock_levels\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_stock_levels\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"inventory_stock_levels_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_stock_levels_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"d858b8a5\"}},\"@happyvertical/smrt-inventory:StockMovementCollection\":{\"name\":\"stockmovementcollection\",\"className\":\"StockMovementCollection\",\"qualifiedName\":\"@happyvertical/smrt-inventory:StockMovementCollection\",\"collection\":\"stockmovements\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/collections/StockMovementCollection.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{},\"methods\":{\"findBySku\":{\"name\":\"findBySku\",\"async\":true,\"parameters\":[{\"name\":\"skuId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockMovement[]>\",\"isStatic\":false,\"isPublic\":true},\"findByLocation\":{\"name\":\"findByLocation\",\"async\":true,\"parameters\":[{\"name\":\"locationId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockMovement[]>\",\"isStatic\":false,\"isPublic\":true},\"findBySource\":{\"name\":\"findBySource\",\"async\":true,\"parameters\":[{\"name\":\"sourceType\",\"type\":\"string\",\"optional\":false},{\"name\":\"sourceId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockMovement[]>\",\"isStatic\":false,\"isPublic\":true},\"findByReason\":{\"name\":\"findByReason\",\"async\":true,\"parameters\":[{\"name\":\"reasonCode\",\"type\":\"StockMovementReason\",\"optional\":false}],\"returnType\":\"Promise<StockMovement[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"inventory_stock_movements\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"StockMovement\",\"exportName\":\"StockMovementCollection\",\"collectionExportName\":\"StockMovementCollectionCollection\",\"schema\":{\"tableName\":\"inventory_stock_movements\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_stock_movements\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"inventory_stock_movements_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_stock_movements_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"54d9d8f6\"}},\"@happyvertical/smrt-inventory:InventoryLocation\":{\"name\":\"inventorylocation\",\"className\":\"InventoryLocation\",\"qualifiedName\":\"@happyvertical/smrt-inventory:InventoryLocation\",\"collection\":\"inventorylocations\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/models/InventoryLocation.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"code\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"name\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"kind\":{\"type\":\"text\",\"required\":false,\"default\":\"warehouse\"},\"placeId\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"active\":{\"type\":\"boolean\",\"required\":false,\"default\":true}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"inventory_locations\",\"conflictColumns\":[\"code\",\"tenant_id\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"InventoryLocation\",\"collectionExportName\":\"InventoryLocationCollection\",\"validationRules\":[{\"field\":\"code\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"inventory_locations\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_locations\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"code\\\" TEXT NOT NULL DEFAULT '',\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"kind\\\" TEXT DEFAULT 'warehouse',\\n \\\"place_id\\\" TEXT DEFAULT '',\\n \\\"active\\\" BOOLEAN DEFAULT TRUE\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"code\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"kind\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"warehouse\"},\"place_id\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"unique\":false,\"default\":true}},\"indexes\":[{\"name\":\"inventory_locations_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_locations_code_tenant_id_idx\",\"columns\":[\"code\",\"tenant_id\"],\"unique\":true}],\"version\":\"401c28a1\"}},\"@happyvertical/smrt-inventory:StockLevel\":{\"name\":\"stocklevel\",\"className\":\"StockLevel\",\"qualifiedName\":\"@happyvertical/smrt-inventory:StockLevel\",\"collection\":\"stocklevels\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/models/StockLevel.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"skuId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"locationId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"state\":{\"type\":\"text\",\"required\":true,\"default\":\"available\",\"_meta\":{\"required\":true}},\"qty\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"inventory_stock_levels\",\"conflictColumns\":[\"sku_id\",\"location_id\",\"state\",\"tenant_id\"],\"api\":{\"include\":[\"list\",\"get\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":{\"include\":[\"list\",\"get\"]},\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"StockLevel\",\"collectionExportName\":\"StockLevelCollection\",\"validationRules\":[{\"field\":\"skuId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"locationId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"state\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"inventory_stock_levels\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_stock_levels\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"sku_id\\\" TEXT NOT NULL DEFAULT '',\\n \\\"location_id\\\" TEXT NOT NULL DEFAULT '',\\n \\\"state\\\" TEXT NOT NULL DEFAULT 'available',\\n \\\"qty\\\" REAL\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"sku_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"location_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"state\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"available\"},\"qty\":{\"type\":\"REAL\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"inventory_stock_levels_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_stock_levels_sku_id_location_id_idx\",\"columns\":[\"sku_id\",\"location_id\",\"state\",\"tenant_id\"],\"unique\":true}],\"version\":\"7b08362b\"}},\"@happyvertical/smrt-inventory:StockMovement\":{\"name\":\"stockmovement\",\"className\":\"StockMovement\",\"qualifiedName\":\"@happyvertical/smrt-inventory:StockMovement\",\"collection\":\"stockmovements\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/models/StockMovement.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"skuId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"locationId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"fromState\":{\"type\":\"text\",\"required\":false},\"toState\":{\"type\":\"text\",\"required\":false},\"qty\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}},\"reasonCode\":{\"type\":\"text\",\"required\":true,\"default\":\"adjustment\",\"_meta\":{\"required\":true}},\"sourceType\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"sourceId\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"note\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"occurredAt\":{\"type\":\"datetime\",\"required\":false}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"inventory_stock_movements\",\"conflictColumns\":[\"id\"],\"api\":{\"include\":[\"list\",\"get\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":{\"include\":[\"list\",\"get\"]},\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"StockMovement\",\"collectionExportName\":\"StockMovementCollection\",\"validationRules\":[{\"field\":\"skuId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"locationId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"reasonCode\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"inventory_stock_movements\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_stock_movements\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"sku_id\\\" TEXT NOT NULL DEFAULT '',\\n \\\"location_id\\\" TEXT NOT NULL DEFAULT '',\\n \\\"from_state\\\" TEXT,\\n \\\"to_state\\\" TEXT,\\n \\\"qty\\\" REAL,\\n \\\"reason_code\\\" TEXT NOT NULL DEFAULT 'adjustment',\\n \\\"source_type\\\" TEXT DEFAULT '',\\n \\\"source_id\\\" TEXT DEFAULT '',\\n \\\"note\\\" TEXT DEFAULT '',\\n \\\"occurred_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"sku_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"location_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"from_state\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"to_state\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"qty\":{\"type\":\"REAL\",\"notNull\":false,\"unique\":false},\"reason_code\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"adjustment\"},\"source_type\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"source_id\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"note\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"occurred_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"inventory_stock_movements_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_stock_movements_id_idx\",\"columns\":[\"id\"],\"unique\":true}],\"version\":\"3c5a0445\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
5
|
+
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-inventory\",\"packageVersion\":\"0.40.66\",\"objects\":{\"@happyvertical/smrt-inventory:InventoryLocationCollection\":{\"name\":\"inventorylocationcollection\",\"className\":\"InventoryLocationCollection\",\"qualifiedName\":\"@happyvertical/smrt-inventory:InventoryLocationCollection\",\"collection\":\"inventorylocations\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/collections/InventoryLocationCollection.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{},\"methods\":{\"findByCode\":{\"name\":\"findByCode\",\"async\":true,\"parameters\":[{\"name\":\"code\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<InventoryLocation | null>\",\"isStatic\":false,\"isPublic\":true},\"findByKind\":{\"name\":\"findByKind\",\"async\":true,\"parameters\":[{\"name\":\"kind\",\"type\":\"InventoryLocationKind\",\"optional\":false}],\"returnType\":\"Promise<InventoryLocation[]>\",\"isStatic\":false,\"isPublic\":true},\"findByPlace\":{\"name\":\"findByPlace\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<InventoryLocation[]>\",\"isStatic\":false,\"isPublic\":true},\"findActive\":{\"name\":\"findActive\",\"async\":true,\"parameters\":[{\"name\":\"kind\",\"type\":\"InventoryLocationKind\",\"optional\":true}],\"returnType\":\"Promise<InventoryLocation[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"inventory_locations\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"InventoryLocation\",\"exportName\":\"InventoryLocationCollection\",\"collectionExportName\":\"InventoryLocationCollectionCollection\",\"schema\":{\"tableName\":\"inventory_locations\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_locations\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"inventory_locations_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_locations_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"a8cccfa5\"}},\"@happyvertical/smrt-inventory:StockLevelCollection\":{\"name\":\"stocklevelcollection\",\"className\":\"StockLevelCollection\",\"qualifiedName\":\"@happyvertical/smrt-inventory:StockLevelCollection\",\"collection\":\"stocklevels\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/collections/StockLevelCollection.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{},\"methods\":{\"getLevel\":{\"name\":\"getLevel\",\"async\":true,\"parameters\":[{\"name\":\"skuId\",\"type\":\"string\",\"optional\":false},{\"name\":\"locationId\",\"type\":\"string\",\"optional\":false},{\"name\":\"state\",\"type\":\"StockState\",\"optional\":true,\"default\":\"available\"}],\"returnType\":\"Promise<StockLevel | null>\",\"isStatic\":false,\"isPublic\":true},\"findBySku\":{\"name\":\"findBySku\",\"async\":true,\"parameters\":[{\"name\":\"skuId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockLevel[]>\",\"isStatic\":false,\"isPublic\":true},\"findByLocation\":{\"name\":\"findByLocation\",\"async\":true,\"parameters\":[{\"name\":\"locationId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockLevel[]>\",\"isStatic\":false,\"isPublic\":true},\"totalForSku\":{\"name\":\"totalForSku\",\"async\":true,\"parameters\":[{\"name\":\"skuId\",\"type\":\"string\",\"optional\":false},{\"name\":\"state\",\"type\":\"StockState\",\"optional\":true}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true},\"totalForLocation\":{\"name\":\"totalForLocation\",\"async\":true,\"parameters\":[{\"name\":\"locationId\",\"type\":\"string\",\"optional\":false},{\"name\":\"state\",\"type\":\"StockState\",\"optional\":true}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"inventory_stock_levels\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"StockLevel\",\"exportName\":\"StockLevelCollection\",\"collectionExportName\":\"StockLevelCollectionCollection\",\"schema\":{\"tableName\":\"inventory_stock_levels\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_stock_levels\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"inventory_stock_levels_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_stock_levels_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"d858b8a5\"}},\"@happyvertical/smrt-inventory:StockMovementCollection\":{\"name\":\"stockmovementcollection\",\"className\":\"StockMovementCollection\",\"qualifiedName\":\"@happyvertical/smrt-inventory:StockMovementCollection\",\"collection\":\"stockmovements\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/collections/StockMovementCollection.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{},\"methods\":{\"findBySku\":{\"name\":\"findBySku\",\"async\":true,\"parameters\":[{\"name\":\"skuId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockMovement[]>\",\"isStatic\":false,\"isPublic\":true},\"findByLocation\":{\"name\":\"findByLocation\",\"async\":true,\"parameters\":[{\"name\":\"locationId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockMovement[]>\",\"isStatic\":false,\"isPublic\":true},\"findBySource\":{\"name\":\"findBySource\",\"async\":true,\"parameters\":[{\"name\":\"sourceType\",\"type\":\"string\",\"optional\":false},{\"name\":\"sourceId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<StockMovement[]>\",\"isStatic\":false,\"isPublic\":true},\"findByReason\":{\"name\":\"findByReason\",\"async\":true,\"parameters\":[{\"name\":\"reasonCode\",\"type\":\"StockMovementReason\",\"optional\":false}],\"returnType\":\"Promise<StockMovement[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"inventory_stock_movements\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"StockMovement\",\"exportName\":\"StockMovementCollection\",\"collectionExportName\":\"StockMovementCollectionCollection\",\"schema\":{\"tableName\":\"inventory_stock_movements\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_stock_movements\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"inventory_stock_movements_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_stock_movements_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"54d9d8f6\"}},\"@happyvertical/smrt-inventory:InventoryLocation\":{\"name\":\"inventorylocation\",\"className\":\"InventoryLocation\",\"qualifiedName\":\"@happyvertical/smrt-inventory:InventoryLocation\",\"collection\":\"inventorylocations\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/models/InventoryLocation.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"code\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"name\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"kind\":{\"type\":\"text\",\"required\":false,\"default\":\"warehouse\"},\"placeId\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"active\":{\"type\":\"boolean\",\"required\":false,\"default\":true}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"inventory_locations\",\"conflictColumns\":[\"code\",\"tenant_id\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"InventoryLocation\",\"collectionExportName\":\"InventoryLocationCollection\",\"validationRules\":[{\"field\":\"code\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"inventory_locations\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_locations\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"code\\\" TEXT NOT NULL DEFAULT '',\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"kind\\\" TEXT DEFAULT 'warehouse',\\n \\\"place_id\\\" TEXT DEFAULT '',\\n \\\"active\\\" BOOLEAN DEFAULT TRUE\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"code\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"kind\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"warehouse\"},\"place_id\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"unique\":false,\"default\":true}},\"indexes\":[{\"name\":\"inventory_locations_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_locations_code_tenant_id_idx\",\"columns\":[\"code\",\"tenant_id\"],\"unique\":true}],\"version\":\"401c28a1\"}},\"@happyvertical/smrt-inventory:StockLevel\":{\"name\":\"stocklevel\",\"className\":\"StockLevel\",\"qualifiedName\":\"@happyvertical/smrt-inventory:StockLevel\",\"collection\":\"stocklevels\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/models/StockLevel.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"skuId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"locationId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"state\":{\"type\":\"text\",\"required\":true,\"default\":\"available\",\"_meta\":{\"required\":true}},\"qty\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"inventory_stock_levels\",\"conflictColumns\":[\"sku_id\",\"location_id\",\"state\",\"tenant_id\"],\"api\":{\"include\":[\"list\",\"get\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":{\"include\":[\"list\",\"get\"]},\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"StockLevel\",\"collectionExportName\":\"StockLevelCollection\",\"validationRules\":[{\"field\":\"skuId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"locationId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"state\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"inventory_stock_levels\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_stock_levels\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"sku_id\\\" TEXT NOT NULL DEFAULT '',\\n \\\"location_id\\\" TEXT NOT NULL DEFAULT '',\\n \\\"state\\\" TEXT NOT NULL DEFAULT 'available',\\n \\\"qty\\\" REAL\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"sku_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"location_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"state\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"available\"},\"qty\":{\"type\":\"REAL\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"inventory_stock_levels_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_stock_levels_sku_id_location_id_idx\",\"columns\":[\"sku_id\",\"location_id\",\"state\",\"tenant_id\"],\"unique\":true}],\"version\":\"7b08362b\"}},\"@happyvertical/smrt-inventory:StockMovement\":{\"name\":\"stockmovement\",\"className\":\"StockMovement\",\"qualifiedName\":\"@happyvertical/smrt-inventory:StockMovement\",\"collection\":\"stockmovements\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/inventory/src/models/StockMovement.ts\",\"packageName\":\"@happyvertical/smrt-inventory\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"skuId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"locationId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"fromState\":{\"type\":\"text\",\"required\":false},\"toState\":{\"type\":\"text\",\"required\":false},\"qty\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}},\"reasonCode\":{\"type\":\"text\",\"required\":true,\"default\":\"adjustment\",\"_meta\":{\"required\":true}},\"sourceType\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"sourceId\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"note\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"occurredAt\":{\"type\":\"datetime\",\"required\":false}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"inventory_stock_movements\",\"conflictColumns\":[\"id\"],\"api\":{\"include\":[\"list\",\"get\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":{\"include\":[\"list\",\"get\"]},\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"StockMovement\",\"collectionExportName\":\"StockMovementCollection\",\"validationRules\":[{\"field\":\"skuId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"locationId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"reasonCode\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"inventory_stock_movements\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"inventory_stock_movements\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"sku_id\\\" TEXT NOT NULL DEFAULT '',\\n \\\"location_id\\\" TEXT NOT NULL DEFAULT '',\\n \\\"from_state\\\" TEXT,\\n \\\"to_state\\\" TEXT,\\n \\\"qty\\\" REAL,\\n \\\"reason_code\\\" TEXT NOT NULL DEFAULT 'adjustment',\\n \\\"source_type\\\" TEXT DEFAULT '',\\n \\\"source_id\\\" TEXT DEFAULT '',\\n \\\"note\\\" TEXT DEFAULT '',\\n \\\"occurred_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"sku_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"location_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"from_state\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"to_state\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"qty\":{\"type\":\"REAL\",\"notNull\":false,\"unique\":false},\"reason_code\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"adjustment\"},\"source_type\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"source_id\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"note\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"occurred_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"inventory_stock_movements_id_idx\",\"columns\":[\"id\"]},{\"name\":\"inventory_stock_movements_id_idx\",\"columns\":[\"id\"],\"unique\":true}],\"version\":\"3c5a0445\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/models/InventoryLocation.ts
|
|
8
8
|
var __defProp$2 = Object.defineProperty;
|
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-inventory",
|
|
5
|
-
"packageVersion": "0.40.
|
|
5
|
+
"packageVersion": "0.40.66",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-inventory:InventoryLocationCollection": {
|
|
8
8
|
"name": "inventorylocationcollection",
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
+
"sensitiveFieldsExcluded": true,
|
|
3
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
4
5
|
"packageName": "@happyvertical/smrt-inventory",
|
|
5
|
-
"packageVersion": "0.40.
|
|
6
|
+
"packageVersion": "0.40.66",
|
|
6
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
7
8
|
"agentDocPath": "AGENTS.md",
|
|
8
9
|
"sourceHashes": {
|
|
9
|
-
"manifest": "
|
|
10
|
-
"packageJson": "
|
|
10
|
+
"manifest": "4b77650dd330264e12675ce57f07a107b6eabfd3e6e9e45c76f2b8a273104690",
|
|
11
|
+
"packageJson": "55f8fb43ffab2f764e590d1a616a1714413f28fff57573d320c54865e2d33bb4",
|
|
11
12
|
"agents": "a771bf16d21cabbe43a77d5cb87ca7dedbf2e68d1928cf804cf4fefaad7a765f"
|
|
12
13
|
},
|
|
13
14
|
"exports": [
|
|
@@ -53,6 +54,40 @@
|
|
|
53
54
|
"findByKind",
|
|
54
55
|
"findByPlace"
|
|
55
56
|
],
|
|
57
|
+
"methodSignatures": [
|
|
58
|
+
{
|
|
59
|
+
"name": "findActive",
|
|
60
|
+
"async": true,
|
|
61
|
+
"params": [
|
|
62
|
+
"kind?: InventoryLocationKind"
|
|
63
|
+
],
|
|
64
|
+
"returns": "Promise<InventoryLocation[]>"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "findByCode",
|
|
68
|
+
"async": true,
|
|
69
|
+
"params": [
|
|
70
|
+
"code: string"
|
|
71
|
+
],
|
|
72
|
+
"returns": "Promise<InventoryLocation | null>"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "findByKind",
|
|
76
|
+
"async": true,
|
|
77
|
+
"params": [
|
|
78
|
+
"kind: InventoryLocationKind"
|
|
79
|
+
],
|
|
80
|
+
"returns": "Promise<InventoryLocation[]>"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "findByPlace",
|
|
84
|
+
"async": true,
|
|
85
|
+
"params": [
|
|
86
|
+
"placeId: string"
|
|
87
|
+
],
|
|
88
|
+
"returns": "Promise<InventoryLocation[]>"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
56
91
|
"surfaces": [],
|
|
57
92
|
"relationshipFeatures": [
|
|
58
93
|
"uuidColumns"
|
|
@@ -76,6 +111,52 @@
|
|
|
76
111
|
"totalForLocation",
|
|
77
112
|
"totalForSku"
|
|
78
113
|
],
|
|
114
|
+
"methodSignatures": [
|
|
115
|
+
{
|
|
116
|
+
"name": "findByLocation",
|
|
117
|
+
"async": true,
|
|
118
|
+
"params": [
|
|
119
|
+
"locationId: string"
|
|
120
|
+
],
|
|
121
|
+
"returns": "Promise<StockLevel[]>"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "findBySku",
|
|
125
|
+
"async": true,
|
|
126
|
+
"params": [
|
|
127
|
+
"skuId: string"
|
|
128
|
+
],
|
|
129
|
+
"returns": "Promise<StockLevel[]>"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "getLevel",
|
|
133
|
+
"async": true,
|
|
134
|
+
"params": [
|
|
135
|
+
"skuId: string",
|
|
136
|
+
"locationId: string",
|
|
137
|
+
"state?: StockState"
|
|
138
|
+
],
|
|
139
|
+
"returns": "Promise<StockLevel | null>"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "totalForLocation",
|
|
143
|
+
"async": true,
|
|
144
|
+
"params": [
|
|
145
|
+
"locationId: string",
|
|
146
|
+
"state?: StockState"
|
|
147
|
+
],
|
|
148
|
+
"returns": "Promise<number>"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "totalForSku",
|
|
152
|
+
"async": true,
|
|
153
|
+
"params": [
|
|
154
|
+
"skuId: string",
|
|
155
|
+
"state?: StockState"
|
|
156
|
+
],
|
|
157
|
+
"returns": "Promise<number>"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
79
160
|
"surfaces": [],
|
|
80
161
|
"relationshipFeatures": [
|
|
81
162
|
"uuidColumns"
|
|
@@ -98,6 +179,41 @@
|
|
|
98
179
|
"findBySku",
|
|
99
180
|
"findBySource"
|
|
100
181
|
],
|
|
182
|
+
"methodSignatures": [
|
|
183
|
+
{
|
|
184
|
+
"name": "findByLocation",
|
|
185
|
+
"async": true,
|
|
186
|
+
"params": [
|
|
187
|
+
"locationId: string"
|
|
188
|
+
],
|
|
189
|
+
"returns": "Promise<StockMovement[]>"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "findByReason",
|
|
193
|
+
"async": true,
|
|
194
|
+
"params": [
|
|
195
|
+
"reasonCode: StockMovementReason"
|
|
196
|
+
],
|
|
197
|
+
"returns": "Promise<StockMovement[]>"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "findBySku",
|
|
201
|
+
"async": true,
|
|
202
|
+
"params": [
|
|
203
|
+
"skuId: string"
|
|
204
|
+
],
|
|
205
|
+
"returns": "Promise<StockMovement[]>"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "findBySource",
|
|
209
|
+
"async": true,
|
|
210
|
+
"params": [
|
|
211
|
+
"sourceType: string",
|
|
212
|
+
"sourceId: string"
|
|
213
|
+
],
|
|
214
|
+
"returns": "Promise<StockMovement[]>"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
101
217
|
"surfaces": [],
|
|
102
218
|
"relationshipFeatures": [
|
|
103
219
|
"uuidColumns"
|
|
@@ -123,35 +239,49 @@
|
|
|
123
239
|
"name": "code",
|
|
124
240
|
"type": "text",
|
|
125
241
|
"required": true,
|
|
126
|
-
"columnType": "TEXT"
|
|
242
|
+
"columnType": "TEXT",
|
|
243
|
+
"default": ""
|
|
127
244
|
},
|
|
128
245
|
{
|
|
129
246
|
"name": "name",
|
|
130
247
|
"type": "text",
|
|
131
248
|
"required": false,
|
|
132
|
-
"columnType": "TEXT"
|
|
249
|
+
"columnType": "TEXT",
|
|
250
|
+
"default": ""
|
|
133
251
|
},
|
|
134
252
|
{
|
|
135
253
|
"name": "kind",
|
|
136
254
|
"type": "text",
|
|
137
255
|
"required": false,
|
|
138
|
-
"columnType": "TEXT"
|
|
256
|
+
"columnType": "TEXT",
|
|
257
|
+
"default": "warehouse"
|
|
139
258
|
},
|
|
140
259
|
{
|
|
141
260
|
"name": "placeId",
|
|
142
261
|
"type": "text",
|
|
143
262
|
"required": false,
|
|
144
|
-
"columnType": "TEXT"
|
|
263
|
+
"columnType": "TEXT",
|
|
264
|
+
"default": ""
|
|
145
265
|
},
|
|
146
266
|
{
|
|
147
267
|
"name": "active",
|
|
148
268
|
"type": "boolean",
|
|
149
269
|
"required": false,
|
|
150
|
-
"columnType": "BOOLEAN"
|
|
270
|
+
"columnType": "BOOLEAN",
|
|
271
|
+
"default": true
|
|
151
272
|
}
|
|
152
273
|
],
|
|
153
274
|
"relationships": [],
|
|
154
275
|
"methods": [],
|
|
276
|
+
"tenant": {
|
|
277
|
+
"scoped": true,
|
|
278
|
+
"mode": "optional",
|
|
279
|
+
"field": "tenantId"
|
|
280
|
+
},
|
|
281
|
+
"conflictColumns": [
|
|
282
|
+
"code",
|
|
283
|
+
"tenant_id"
|
|
284
|
+
],
|
|
155
285
|
"surfaces": [
|
|
156
286
|
{
|
|
157
287
|
"kind": "api",
|
|
@@ -252,19 +382,22 @@
|
|
|
252
382
|
"name": "skuId",
|
|
253
383
|
"type": "text",
|
|
254
384
|
"required": true,
|
|
255
|
-
"columnType": "TEXT"
|
|
385
|
+
"columnType": "TEXT",
|
|
386
|
+
"default": ""
|
|
256
387
|
},
|
|
257
388
|
{
|
|
258
389
|
"name": "locationId",
|
|
259
390
|
"type": "text",
|
|
260
391
|
"required": true,
|
|
261
|
-
"columnType": "TEXT"
|
|
392
|
+
"columnType": "TEXT",
|
|
393
|
+
"default": ""
|
|
262
394
|
},
|
|
263
395
|
{
|
|
264
396
|
"name": "state",
|
|
265
397
|
"type": "text",
|
|
266
398
|
"required": true,
|
|
267
|
-
"columnType": "TEXT"
|
|
399
|
+
"columnType": "TEXT",
|
|
400
|
+
"default": "available"
|
|
268
401
|
},
|
|
269
402
|
{
|
|
270
403
|
"name": "qty",
|
|
@@ -275,6 +408,17 @@
|
|
|
275
408
|
],
|
|
276
409
|
"relationships": [],
|
|
277
410
|
"methods": [],
|
|
411
|
+
"tenant": {
|
|
412
|
+
"scoped": true,
|
|
413
|
+
"mode": "optional",
|
|
414
|
+
"field": "tenantId"
|
|
415
|
+
},
|
|
416
|
+
"conflictColumns": [
|
|
417
|
+
"sku_id",
|
|
418
|
+
"location_id",
|
|
419
|
+
"state",
|
|
420
|
+
"tenant_id"
|
|
421
|
+
],
|
|
278
422
|
"surfaces": [
|
|
279
423
|
{
|
|
280
424
|
"kind": "api",
|
|
@@ -341,13 +485,15 @@
|
|
|
341
485
|
"name": "skuId",
|
|
342
486
|
"type": "text",
|
|
343
487
|
"required": true,
|
|
344
|
-
"columnType": "TEXT"
|
|
488
|
+
"columnType": "TEXT",
|
|
489
|
+
"default": ""
|
|
345
490
|
},
|
|
346
491
|
{
|
|
347
492
|
"name": "locationId",
|
|
348
493
|
"type": "text",
|
|
349
494
|
"required": true,
|
|
350
|
-
"columnType": "TEXT"
|
|
495
|
+
"columnType": "TEXT",
|
|
496
|
+
"default": ""
|
|
351
497
|
},
|
|
352
498
|
{
|
|
353
499
|
"name": "fromState",
|
|
@@ -371,25 +517,29 @@
|
|
|
371
517
|
"name": "reasonCode",
|
|
372
518
|
"type": "text",
|
|
373
519
|
"required": true,
|
|
374
|
-
"columnType": "TEXT"
|
|
520
|
+
"columnType": "TEXT",
|
|
521
|
+
"default": "adjustment"
|
|
375
522
|
},
|
|
376
523
|
{
|
|
377
524
|
"name": "sourceType",
|
|
378
525
|
"type": "text",
|
|
379
526
|
"required": false,
|
|
380
|
-
"columnType": "TEXT"
|
|
527
|
+
"columnType": "TEXT",
|
|
528
|
+
"default": ""
|
|
381
529
|
},
|
|
382
530
|
{
|
|
383
531
|
"name": "sourceId",
|
|
384
532
|
"type": "text",
|
|
385
533
|
"required": false,
|
|
386
|
-
"columnType": "TEXT"
|
|
534
|
+
"columnType": "TEXT",
|
|
535
|
+
"default": ""
|
|
387
536
|
},
|
|
388
537
|
{
|
|
389
538
|
"name": "note",
|
|
390
539
|
"type": "text",
|
|
391
540
|
"required": false,
|
|
392
|
-
"columnType": "TEXT"
|
|
541
|
+
"columnType": "TEXT",
|
|
542
|
+
"default": ""
|
|
393
543
|
},
|
|
394
544
|
{
|
|
395
545
|
"name": "occurredAt",
|
|
@@ -400,6 +550,14 @@
|
|
|
400
550
|
],
|
|
401
551
|
"relationships": [],
|
|
402
552
|
"methods": [],
|
|
553
|
+
"tenant": {
|
|
554
|
+
"scoped": true,
|
|
555
|
+
"mode": "optional",
|
|
556
|
+
"field": "tenantId"
|
|
557
|
+
},
|
|
558
|
+
"conflictColumns": [
|
|
559
|
+
"id"
|
|
560
|
+
],
|
|
403
561
|
"surfaces": [
|
|
404
562
|
{
|
|
405
563
|
"kind": "api",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-inventory",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.66",
|
|
4
4
|
"description": "Multi-location stock tracking for the SMRT framework — Sku, InventoryLocation, StockLevel, StockMovement, and a stock-mutation service",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"./manifest.json": "./dist/manifest.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@happyvertical/logger": "^0.86.
|
|
23
|
-
"@happyvertical/sql": "^0.86.
|
|
24
|
-
"@happyvertical/smrt-core": "0.40.
|
|
25
|
-
"@happyvertical/smrt-tenancy": "0.40.
|
|
22
|
+
"@happyvertical/logger": "^0.86.3",
|
|
23
|
+
"@happyvertical/sql": "^0.86.3",
|
|
24
|
+
"@happyvertical/smrt-core": "0.40.66",
|
|
25
|
+
"@happyvertical/smrt-tenancy": "0.40.66"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "24.13.2",
|
|
29
29
|
"typescript": "5.9.3",
|
|
30
30
|
"vite": "8.1.4",
|
|
31
31
|
"vitest": "4.1.10",
|
|
32
|
-
"@happyvertical/smrt-vitest": "0.40.
|
|
32
|
+
"@happyvertical/smrt-vitest": "0.40.66"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"smrt",
|