@happyvertical/smrt-inventory 0.40.70 → 0.41.0
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 +45 -46
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +4 -4
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.70\",\"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},{\"name\":\"inventory_locations_tenant_id_idx\",\"columns\":[\"tenant_id\"]}],\"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},{\"name\":\"inventory_stock_levels_tenant_id_idx\",\"columns\":[\"tenant_id\"]}],\"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},{\"name\":\"inventory_stock_movements_tenant_id_idx\",\"columns\":[\"tenant_id\"]}],\"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.41.0\",\"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_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"inventory_locations_created_at_idx\",\"columns\":[\"created_at\"]}],\"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_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"inventory_stock_levels_created_at_idx\",\"columns\":[\"created_at\"]}],\"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_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"inventory_stock_movements_created_at_idx\",\"columns\":[\"created_at\"]}],\"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_code_tenant_id_idx\",\"columns\":[\"code\",\"tenant_id\"],\"unique\":true},{\"name\":\"inventory_locations_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"inventory_locations_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"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_sku_id_location_id_idx\",\"columns\":[\"sku_id\",\"location_id\",\"state\",\"tenant_id\"],\"unique\":true},{\"name\":\"inventory_stock_levels_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"inventory_stock_levels_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"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_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"inventory_stock_movements_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"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.
|
|
5
|
+
"packageVersion": "0.41.0",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-inventory:InventoryLocationCollection": {
|
|
8
8
|
"name": "inventorylocationcollection",
|
|
@@ -108,12 +108,6 @@
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"indexes": [
|
|
111
|
-
{
|
|
112
|
-
"name": "inventory_locations_id_idx",
|
|
113
|
-
"columns": [
|
|
114
|
-
"id"
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
111
|
{
|
|
118
112
|
"name": "inventory_locations_slug_context_idx",
|
|
119
113
|
"columns": [
|
|
@@ -121,6 +115,12 @@
|
|
|
121
115
|
"context"
|
|
122
116
|
],
|
|
123
117
|
"unique": true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "inventory_locations_created_at_idx",
|
|
121
|
+
"columns": [
|
|
122
|
+
"created_at"
|
|
123
|
+
]
|
|
124
124
|
}
|
|
125
125
|
],
|
|
126
126
|
"version": "a8cccfa5"
|
|
@@ -265,12 +265,6 @@
|
|
|
265
265
|
}
|
|
266
266
|
},
|
|
267
267
|
"indexes": [
|
|
268
|
-
{
|
|
269
|
-
"name": "inventory_stock_levels_id_idx",
|
|
270
|
-
"columns": [
|
|
271
|
-
"id"
|
|
272
|
-
]
|
|
273
|
-
},
|
|
274
268
|
{
|
|
275
269
|
"name": "inventory_stock_levels_slug_context_idx",
|
|
276
270
|
"columns": [
|
|
@@ -278,6 +272,12 @@
|
|
|
278
272
|
"context"
|
|
279
273
|
],
|
|
280
274
|
"unique": true
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "inventory_stock_levels_created_at_idx",
|
|
278
|
+
"columns": [
|
|
279
|
+
"created_at"
|
|
280
|
+
]
|
|
281
281
|
}
|
|
282
282
|
],
|
|
283
283
|
"version": "d858b8a5"
|
|
@@ -392,12 +392,6 @@
|
|
|
392
392
|
}
|
|
393
393
|
},
|
|
394
394
|
"indexes": [
|
|
395
|
-
{
|
|
396
|
-
"name": "inventory_stock_movements_id_idx",
|
|
397
|
-
"columns": [
|
|
398
|
-
"id"
|
|
399
|
-
]
|
|
400
|
-
},
|
|
401
395
|
{
|
|
402
396
|
"name": "inventory_stock_movements_slug_context_idx",
|
|
403
397
|
"columns": [
|
|
@@ -405,6 +399,12 @@
|
|
|
405
399
|
"context"
|
|
406
400
|
],
|
|
407
401
|
"unique": true
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"name": "inventory_stock_movements_created_at_idx",
|
|
405
|
+
"columns": [
|
|
406
|
+
"created_at"
|
|
407
|
+
]
|
|
408
408
|
}
|
|
409
409
|
],
|
|
410
410
|
"version": "54d9d8f6"
|
|
@@ -568,12 +568,6 @@
|
|
|
568
568
|
}
|
|
569
569
|
},
|
|
570
570
|
"indexes": [
|
|
571
|
-
{
|
|
572
|
-
"name": "inventory_locations_id_idx",
|
|
573
|
-
"columns": [
|
|
574
|
-
"id"
|
|
575
|
-
]
|
|
576
|
-
},
|
|
577
571
|
{
|
|
578
572
|
"name": "inventory_locations_code_tenant_id_idx",
|
|
579
573
|
"columns": [
|
|
@@ -583,9 +577,17 @@
|
|
|
583
577
|
"unique": true
|
|
584
578
|
},
|
|
585
579
|
{
|
|
586
|
-
"name": "
|
|
580
|
+
"name": "inventory_locations_slug_context_idx",
|
|
587
581
|
"columns": [
|
|
588
|
-
"
|
|
582
|
+
"slug",
|
|
583
|
+
"context"
|
|
584
|
+
]
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"name": "inventory_locations_tenant_id_created_at_idx",
|
|
588
|
+
"columns": [
|
|
589
|
+
"tenant_id",
|
|
590
|
+
"created_at"
|
|
589
591
|
]
|
|
590
592
|
}
|
|
591
593
|
],
|
|
@@ -759,12 +761,6 @@
|
|
|
759
761
|
}
|
|
760
762
|
},
|
|
761
763
|
"indexes": [
|
|
762
|
-
{
|
|
763
|
-
"name": "inventory_stock_levels_id_idx",
|
|
764
|
-
"columns": [
|
|
765
|
-
"id"
|
|
766
|
-
]
|
|
767
|
-
},
|
|
768
764
|
{
|
|
769
765
|
"name": "inventory_stock_levels_sku_id_location_id_idx",
|
|
770
766
|
"columns": [
|
|
@@ -776,9 +772,17 @@
|
|
|
776
772
|
"unique": true
|
|
777
773
|
},
|
|
778
774
|
{
|
|
779
|
-
"name": "
|
|
775
|
+
"name": "inventory_stock_levels_slug_context_idx",
|
|
780
776
|
"columns": [
|
|
781
|
-
"
|
|
777
|
+
"slug",
|
|
778
|
+
"context"
|
|
779
|
+
]
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"name": "inventory_stock_levels_tenant_id_created_at_idx",
|
|
783
|
+
"columns": [
|
|
784
|
+
"tenant_id",
|
|
785
|
+
"created_at"
|
|
782
786
|
]
|
|
783
787
|
}
|
|
784
788
|
],
|
|
@@ -1010,22 +1014,17 @@
|
|
|
1010
1014
|
},
|
|
1011
1015
|
"indexes": [
|
|
1012
1016
|
{
|
|
1013
|
-
"name": "
|
|
1017
|
+
"name": "inventory_stock_movements_slug_context_idx",
|
|
1014
1018
|
"columns": [
|
|
1015
|
-
"
|
|
1019
|
+
"slug",
|
|
1020
|
+
"context"
|
|
1016
1021
|
]
|
|
1017
1022
|
},
|
|
1018
1023
|
{
|
|
1019
|
-
"name": "
|
|
1024
|
+
"name": "inventory_stock_movements_tenant_id_created_at_idx",
|
|
1020
1025
|
"columns": [
|
|
1021
|
-
"
|
|
1022
|
-
|
|
1023
|
-
"unique": true
|
|
1024
|
-
},
|
|
1025
|
-
{
|
|
1026
|
-
"name": "inventory_stock_movements_tenant_id_idx",
|
|
1027
|
-
"columns": [
|
|
1028
|
-
"tenant_id"
|
|
1026
|
+
"tenant_id",
|
|
1027
|
+
"created_at"
|
|
1029
1028
|
]
|
|
1030
1029
|
}
|
|
1031
1030
|
],
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-inventory",
|
|
6
|
-
"packageVersion": "0.
|
|
6
|
+
"packageVersion": "0.41.0",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "a5f8a7eb299e3669919c10753f485ef42dd17ea4049bfc5aa03d23dc9529c3ce",
|
|
11
|
+
"packageJson": "f6ced73e8bca2d03a81513c8cb0353586e65bef8a6693df5aaad427e415eaa1d",
|
|
12
12
|
"agents": "a771bf16d21cabbe43a77d5cb87ca7dedbf2e68d1928cf804cf4fefaad7a765f"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-inventory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
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",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@happyvertical/logger": "^0.88.0",
|
|
23
23
|
"@happyvertical/sql": "^0.88.0",
|
|
24
|
-
"@happyvertical/smrt-core": "0.
|
|
25
|
-
"@happyvertical/smrt-tenancy": "0.
|
|
24
|
+
"@happyvertical/smrt-core": "0.41.0",
|
|
25
|
+
"@happyvertical/smrt-tenancy": "0.41.0"
|
|
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.
|
|
32
|
+
"@happyvertical/smrt-vitest": "0.41.0"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"smrt",
|