@happyvertical/smrt-manufacturing 0.57.17 → 0.57.18
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/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
18
18
|
};
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/__smrt-register__.ts
|
|
21
|
-
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-manufacturing","packageVersion":"0.57.17","objects":{"@happyvertical/smrt-manufacturing:BillOfMaterialsCollection":{"name":"billofmaterialscollection","className":"BillOfMaterialsCollection","qualifiedName":"@happyvertical/smrt-manufacturing:BillOfMaterialsCollection","collection":"billofmaterialses","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/BillOfMaterialsCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByProduct":{"name":"findByProduct","async":true,"parameters":[{"name":"productId","type":"string","optional":false}],"returnType":"Promise<BillOfMaterials[]>","isStatic":false,"isPublic":true},"findActiveForProduct":{"name":"findActiveForProduct","async":true,"parameters":[{"name":"productId","type":"string","optional":false}],"returnType":"Promise<BillOfMaterials | null>","isStatic":false,"isPublic":true},"findByStatus":{"name":"findByStatus","async":true,"parameters":[{"name":"status","type":"BomStatus","optional":false}],"returnType":"Promise<BillOfMaterials[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_boms","api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"BillOfMaterials","exportName":"BillOfMaterialsCollection","collectionExportName":"BillOfMaterialsCollectionCollection","schema":{"tableName":"manufacturing_boms","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_boms\\" (\\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 \\"product_id\\" TEXT NOT NULL DEFAULT '',\\n \\"version\\" INTEGER NOT NULL DEFAULT 1,\\n \\"effective_date\\" TIMESTAMP,\\n \\"status\\" TEXT NOT NULL DEFAULT 'draft',\\n \\"notes\\" TEXT DEFAULT '',\\n \\"currency\\" TEXT DEFAULT 'USD'\\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},"product_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"version":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"effective_date":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"draft"},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""},"currency":{"type":"TEXT","notNull":false,"unique":false,"default":"USD"}},"indexes":[{"name":"manufacturing_boms_product_id_version_idx","columns":["product_id","version","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_boms_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_boms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"b2691adc"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BomLineCollection":{"name":"bomlinecollection","className":"BomLineCollection","qualifiedName":"@happyvertical/smrt-manufacturing:BomLineCollection","collection":"bomlines","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/BomLineCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<BomLine[]>","isStatic":false,"isPublic":true},"findByComponent":{"name":"findByComponent","async":true,"parameters":[{"name":"componentSkuId","type":"string","optional":false}],"returnType":"Promise<BomLine[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_bom_lines","api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"BomLine","exportName":"BomLineCollection","collectionExportName":"BomLineCollectionCollection","schema":{"tableName":"manufacturing_bom_lines","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_bom_lines\\" (\\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 \\"bom_id\\" TEXT NOT NULL DEFAULT '',\\n \\"component_sku_id\\" TEXT NOT NULL DEFAULT '',\\n \\"qty_per_unit\\" REAL,\\n \\"uom\\" TEXT DEFAULT 'each',\\n \\"waste_percent\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\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},"bom_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"component_sku_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"qty_per_unit":{"type":"REAL","notNull":false,"unique":false},"uom":{"type":"TEXT","notNull":false,"unique":false,"default":"each"},"waste_percent":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_bom_lines_bom_id_component_sku_id_idx","columns":["bom_id","component_sku_id","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_bom_lines_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_bom_lines_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"cfbae7e8"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:OperationCollection":{"name":"operationcollection","className":"OperationCollection","qualifiedName":"@happyvertical/smrt-manufacturing:OperationCollection","collection":"operations","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/OperationCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByCode":{"name":"findByCode","async":true,"parameters":[{"name":"code","type":"string","optional":false}],"returnType":"Promise<Operation | null>","isStatic":false,"isPublic":true},"listOperations":{"name":"listOperations","async":true,"parameters":[{"name":"options","type":"object","optional":true,"memberTypes":["boolean"]}],"returnType":"Promise<Operation[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_operations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"Operation","exportName":"OperationCollection","collectionExportName":"OperationCollectionCollection","schema":{"tableName":"manufacturing_operations","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_operations\\" (\\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 NOT NULL DEFAULT '',\\n \\"category\\" TEXT DEFAULT '',\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"required_qualification_id\\" UUID\\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":true,"unique":false,"default":""},"category":{"type":"TEXT","notNull":false,"unique":false,"default":""},"is_active":{"type":"BOOLEAN","notNull":false,"unique":false,"default":true},"required_qualification_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_operations_code_tenant_id_idx","columns":["code","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_operations_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_operations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_operations_required_qualification_id_idx","columns":["required_qualification_id"]}],"version":"0b3134d6"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCollection":{"name":"productionruncollection","className":"ProductionRunCollection","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCollection","collection":"productionruns","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/ProductionRunCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<ProductionRun[]>","isStatic":false,"isPublic":true},"findByStatus":{"name":"findByStatus","async":true,"parameters":[{"name":"status","type":"ProductionRunStatus","optional":false}],"returnType":"Promise<ProductionRun[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"ProductionRun","exportName":"ProductionRunCollection","collectionExportName":"ProductionRunCollectionCollection","schema":{"tableName":"manufacturing_production_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_runs\\" (\\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 \\"bom_id\\" UUID NOT NULL,\\n \\"target_qty\\" REAL,\\n \\"completed_qty\\" REAL,\\n \\"status\\" TEXT NOT NULL DEFAULT 'planned'\\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},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"target_qty":{"type":"REAL","notNull":false,"unique":false},"completed_qty":{"type":"REAL","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"planned"}},"indexes":[{"name":"manufacturing_production_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_runs_bom_id_idx","columns":["bom_id"]}],"version":"2ca8147d"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCompletionCollection":{"name":"productionruncompletioncollection","className":"ProductionRunCompletionCollection","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCompletionCollection","collection":"productionruncompletions","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/ProductionRunCompletionCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByRun":{"name":"findByRun","async":true,"parameters":[{"name":"runId","type":"string","optional":false}],"returnType":"Promise<ProductionRunCompletion[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_run_completions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"ProductionRunCompletion","exportName":"ProductionRunCompletionCollection","collectionExportName":"ProductionRunCompletionCollectionCollection","schema":{"tableName":"manufacturing_production_run_completions","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_run_completions\\" (\\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 \\"run_id\\" UUID NOT NULL,\\n \\"qty\\" REAL,\\n \\"completed_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},"run_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_production_runs","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"qty":{"type":"REAL","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_production_run_completions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_run_completions_tenant_ea7a0d0125_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_run_completions_run_id_idx","columns":["run_id"]}],"version":"c940de6c"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:RoutingStepCollection":{"name":"routingstepcollection","className":"RoutingStepCollection","qualifiedName":"@happyvertical/smrt-manufacturing:RoutingStepCollection","collection":"routingsteps","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/RoutingStepCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<RoutingStep[]>","isStatic":false,"isPublic":true},"findByOperation":{"name":"findByOperation","async":true,"parameters":[{"name":"operationId","type":"string","optional":false}],"returnType":"Promise<RoutingStep[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_routing_steps","api":{"include":["list","get"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"RoutingStep","exportName":"RoutingStepCollection","collectionExportName":"RoutingStepCollectionCollection","schema":{"tableName":"manufacturing_routing_steps","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_routing_steps\\" (\\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 \\"bom_id\\" UUID NOT NULL,\\n \\"operation_id\\" UUID NOT NULL,\\n \\"sequence\\" INTEGER NOT NULL DEFAULT 1,\\n \\"estimated_minutes\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\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},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"sequence":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"estimated_minutes":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_routing_steps_bom_id_sequence_idx","columns":["bom_id","sequence","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_routing_steps_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_routing_steps_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_routing_steps_operation_id_idx","columns":["operation_id"]}],"version":"41ac3c66"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:Assembly":{"name":"assembly","className":"Assembly","qualifiedName":"@happyvertical/smrt-manufacturing:Assembly","collection":"products","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Assembly.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"generated":true,"source":"tenantScoped_decorator","sqlType":"UUID","__tenancy":{"isTenantIdField":true,"mode":"optional","field":"tenantId","autoFilter":true,"autoPopulate":true,"allowSuperAdminBypass":false}}},"productType":{"type":"json","required":false},"name":{"type":"text","required":false,"description":"The product name, as customers see it.","_meta":{"description":"The product name, as customers see it."}},"description":{"type":"text","required":false,"description":"A few words on what the product is and who it is for.","_meta":{"description":"A few words on what the product is and who it is for."}},"category":{"type":"text","required":false},"manufacturer":{"type":"text","required":false},"model":{"type":"text","required":false},"price":{"type":"integer","required":true,"default":0,"description":"The price in minor units (cents), for example 1999 for 19.99.","_meta":{"description":"The price in minor units (cents), for example 1999 for 19.99."}},"defaultSalesTaxCodeId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-commerce:TaxCode","_meta":{"description":"The tax code normally used when this product is sold."}},"defaultPurchaseTaxCodeId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-commerce:TaxCode","_meta":{"description":"The tax code normally used when this product is purchased."}},"inStock":{"type":"boolean","required":true,"default":true},"specifications":{"type":"json","required":false,"default":{}},"tags":{"type":"json","required":false,"default":[]},"estimatedLabourMinutes":{"type":"integer","required":false,"default":0},"defaultOperationId":{"type":"foreignKey","required":false,"related":"Operation","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"partReference":{"type":"text","required":false,"default":""}},"methods":{"getSpecification":{"name":"getSpecification","async":true,"parameters":[{"name":"key","type":"string","optional":false}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true},"updateSpecification":{"name":"updateSpecification","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"value","type":"unknown","optional":false}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"getAssets":{"name":"getAssets","async":true,"parameters":[{"name":"relationship","type":"string","optional":true}],"returnType":"Promise<Asset[]>","isStatic":false,"isPublic":true},"addAsset":{"name":"addAsset","async":true,"parameters":[{"name":"asset","type":"Asset","optional":false},{"name":"relationship","type":"any","optional":true,"default":"attachment"},{"name":"sortOrder","type":"any","optional":true}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"removeAsset":{"name":"removeAsset","async":true,"parameters":[{"name":"assetId","type":"string","optional":false},{"name":"relationship","type":"string","optional":true}],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"},"tableName":"products","tableStrategy":"sti"},"extends":"Product","extendsQualified":"@happyvertical/smrt-products:Product","exportName":"Assembly","collectionExportName":"AssemblyCollection","displayLabelField":"name","validationRules":[{"field":"price","rule":"required","fieldType":"integer"},{"field":"inStock","rule":"required","fieldType":"boolean"}],"schema":{"tableName":"products","ddl":"CREATE TABLE IF NOT EXISTS \\"products\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"product_type\\" TEXT,\\n \\"name\\" TEXT,\\n \\"description\\" TEXT,\\n \\"category\\" TEXT,\\n \\"manufacturer\\" TEXT,\\n \\"model\\" TEXT,\\n \\"price\\" INTEGER DEFAULT 0,\\n \\"default_sales_tax_code_id\\" UUID,\\n \\"default_purchase_tax_code_id\\" UUID,\\n \\"in_stock\\" BOOLEAN DEFAULT TRUE,\\n \\"specifications\\" JSON DEFAULT '{}',\\n \\"tags\\" JSON DEFAULT '[]',\\n \\"estimated_labour_minutes\\" INTEGER DEFAULT 0,\\n \\"default_operation_id\\" UUID,\\n \\"part_reference\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"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},"product_type":{"type":"TEXT","notNull":false},"name":{"type":"TEXT","notNull":false},"description":{"type":"TEXT","notNull":false},"category":{"type":"TEXT","notNull":false},"manufacturer":{"type":"TEXT","notNull":false},"model":{"type":"TEXT","notNull":false},"price":{"type":"INTEGER","notNull":false,"default":0},"default_sales_tax_code_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"default_purchase_tax_code_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"in_stock":{"type":"BOOLEAN","notNull":false,"default":true},"specifications":{"type":"JSON","notNull":false,"default":{}},"tags":{"type":"JSON","notNull":false,"default":[]},"estimated_labour_minutes":{"type":"INTEGER","notNull":false,"default":0},"default_operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"part_reference":{"type":"TEXT","notNull":false,"default":""}},"indexes":[{"name":"products_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"products_meta_type_idx","columns":["_meta_type"]},{"name":"products_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"products_default_sales_tax_code_id_idx","columns":["default_sales_tax_code_id"]},{"name":"products_default_purchase_tax_code_id_idx","columns":["default_purchase_tax_code_id"]},{"name":"products_default_operation_id_idx","columns":["default_operation_id"]}],"version":"e1a54866"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BillOfMaterials":{"name":"billofmaterials","className":"BillOfMaterials","qualifiedName":"@happyvertical/smrt-manufacturing:BillOfMaterials","collection":"billofmaterialses","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BillOfMaterials.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"productId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"version":{"type":"integer","required":true,"default":1,"_meta":{"required":true}},"effectiveDate":{"type":"datetime","required":false},"status":{"type":"text","required":true,"default":"draft","_meta":{"required":true},"enum":["draft","active","superseded"]},"notes":{"type":"text","required":false,"default":""},"currency":{"type":"text","required":false,"default":"USD"}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_boms","conflictColumns":["product_id","version","tenant_id"],"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":true,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"BillOfMaterials","collectionExportName":"BillOfMaterialsCollection","validationRules":[{"field":"productId","rule":"required","fieldType":"text"},{"field":"version","rule":"required","fieldType":"integer"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_boms","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_boms\\" (\\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 \\"product_id\\" TEXT NOT NULL DEFAULT '',\\n \\"version\\" INTEGER NOT NULL DEFAULT 1,\\n \\"effective_date\\" TIMESTAMP,\\n \\"status\\" TEXT NOT NULL DEFAULT 'draft',\\n \\"notes\\" TEXT DEFAULT '',\\n \\"currency\\" TEXT DEFAULT 'USD'\\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},"product_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"version":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"effective_date":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"draft"},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""},"currency":{"type":"TEXT","notNull":false,"unique":false,"default":"USD"}},"indexes":[{"name":"manufacturing_boms_product_id_version_idx","columns":["product_id","version","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_boms_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_boms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"b2691adc"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BomLine":{"name":"bomline","className":"BomLine","qualifiedName":"@happyvertical/smrt-manufacturing:BomLine","collection":"bomlines","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BomLine.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"bomId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"componentSkuId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"qtyPerUnit":{"type":"decimal","required":false,"_meta":{}},"uom":{"type":"text","required":false,"default":"each"},"wastePercent":{"type":"decimal","required":false,"_meta":{}},"notes":{"type":"text","required":false,"default":""}},"methods":{"effectiveQtyPerUnit":{"name":"effectiveQtyPerUnit","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_bom_lines","conflictColumns":["bom_id","component_sku_id","tenant_id"],"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"BomLine","collectionExportName":"BomLineCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"text"},{"field":"componentSkuId","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_bom_lines","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_bom_lines\\" (\\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 \\"bom_id\\" TEXT NOT NULL DEFAULT '',\\n \\"component_sku_id\\" TEXT NOT NULL DEFAULT '',\\n \\"qty_per_unit\\" REAL,\\n \\"uom\\" TEXT DEFAULT 'each',\\n \\"waste_percent\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\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},"bom_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"component_sku_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"qty_per_unit":{"type":"REAL","notNull":false,"unique":false},"uom":{"type":"TEXT","notNull":false,"unique":false,"default":"each"},"waste_percent":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_bom_lines_bom_id_component_sku_id_idx","columns":["bom_id","component_sku_id","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_bom_lines_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_bom_lines_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"cfbae7e8"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:Operation":{"name":"operation","className":"Operation","qualifiedName":"@happyvertical/smrt-manufacturing:Operation","collection":"operations","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Operation.ts","packageName":"@happyvertical/smrt-manufacturing","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":true,"default":"","_meta":{"required":true}},"category":{"type":"text","required":false,"default":""},"isActive":{"type":"boolean","required":false,"default":true},"requiredQualificationId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-human-resources:Qualification","_meta":{"nullable":true}}},"methods":{"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_operations","conflictColumns":["code","tenant_id"],"api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"Operation","collectionExportName":"OperationCollection","displayLabelField":"name","validationRules":[{"field":"code","rule":"required","fieldType":"text"},{"field":"name","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_operations","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_operations\\" (\\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 NOT NULL DEFAULT '',\\n \\"category\\" TEXT DEFAULT '',\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"required_qualification_id\\" UUID\\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":true,"unique":false,"default":""},"category":{"type":"TEXT","notNull":false,"unique":false,"default":""},"is_active":{"type":"BOOLEAN","notNull":false,"unique":false,"default":true},"required_qualification_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_operations_code_tenant_id_idx","columns":["code","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_operations_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_operations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_operations_required_qualification_id_idx","columns":["required_qualification_id"]}],"version":"0b3134d6"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRun":{"name":"productionrun","className":"ProductionRun","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRun","collection":"productionruns","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/ProductionRun.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"bomId":{"type":"foreignKey","required":true,"related":"BillOfMaterials","_meta":{"required":true,"onDelete":"RESTRICT"}},"targetQty":{"type":"decimal","required":false,"_meta":{}},"completedQty":{"type":"decimal","required":false,"_meta":{}},"status":{"type":"text","required":true,"default":"planned","_meta":{"required":true},"enum":["planned","in_progress","done","cancelled"]}},"methods":{"remainingQty":{"name":"remainingQty","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"ProductionRun","collectionExportName":"ProductionRunCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"foreignKey"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_production_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_runs\\" (\\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 \\"bom_id\\" UUID NOT NULL,\\n \\"target_qty\\" REAL,\\n \\"completed_qty\\" REAL,\\n \\"status\\" TEXT NOT NULL DEFAULT 'planned'\\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},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"target_qty":{"type":"REAL","notNull":false,"unique":false},"completed_qty":{"type":"REAL","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"planned"}},"indexes":[{"name":"manufacturing_production_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_runs_bom_id_idx","columns":["bom_id"]}],"version":"2ca8147d"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCompletion":{"name":"productionruncompletion","className":"ProductionRunCompletion","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCompletion","collection":"productionruncompletions","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/ProductionRunCompletion.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"runId":{"type":"foreignKey","required":true,"related":"ProductionRun","_meta":{"required":true,"onDelete":"CASCADE"}},"qty":{"type":"decimal","required":false,"_meta":{}},"completedAt":{"type":"datetime","required":false}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_production_run_completions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"ProductionRunCompletion","collectionExportName":"ProductionRunCompletionCollection","validationRules":[{"field":"runId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"manufacturing_production_run_completions","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_run_completions\\" (\\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 \\"run_id\\" UUID NOT NULL,\\n \\"qty\\" REAL,\\n \\"completed_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},"run_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_production_runs","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"qty":{"type":"REAL","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_production_run_completions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_run_completions_tenant_ea7a0d0125_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_run_completions_run_id_idx","columns":["run_id"]}],"version":"c940de6c"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:RoutingStep":{"name":"routingstep","className":"RoutingStep","qualifiedName":"@happyvertical/smrt-manufacturing:RoutingStep","collection":"routingsteps","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/RoutingStep.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"bomId":{"type":"foreignKey","required":true,"related":"BillOfMaterials","_meta":{"required":true,"onDelete":"CASCADE"}},"operationId":{"type":"foreignKey","required":true,"related":"Operation","_meta":{"required":true,"onDelete":"RESTRICT"}},"sequence":{"type":"integer","required":true,"default":1,"_meta":{"required":true}},"estimatedMinutes":{"type":"decimal","required":false,"_meta":{}},"notes":{"type":"text","required":false,"default":""}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_routing_steps","conflictColumns":["bom_id","sequence","tenant_id"],"api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"RoutingStep","collectionExportName":"RoutingStepCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"foreignKey"},{"field":"operationId","rule":"required","fieldType":"foreignKey"},{"field":"sequence","rule":"required","fieldType":"integer"}],"schema":{"tableName":"manufacturing_routing_steps","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_routing_steps\\" (\\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 \\"bom_id\\" UUID NOT NULL,\\n \\"operation_id\\" UUID NOT NULL,\\n \\"sequence\\" INTEGER NOT NULL DEFAULT 1,\\n \\"estimated_minutes\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\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},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"sequence":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"estimated_minutes":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_routing_steps_bom_id_sequence_idx","columns":["bom_id","sequence","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_routing_steps_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_routing_steps_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_routing_steps_operation_id_idx","columns":["operation_id"]}],"version":"41ac3c66"},"importPath":"@happyvertical/smrt-manufacturing"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-inventory","@happyvertical/smrt-products","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3616","#3624","#3626"],"via":["@happyvertical/smrt-products","@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
21
|
+
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-manufacturing","packageVersion":"0.57.18","objects":{"@happyvertical/smrt-manufacturing:BillOfMaterialsCollection":{"name":"billofmaterialscollection","className":"BillOfMaterialsCollection","qualifiedName":"@happyvertical/smrt-manufacturing:BillOfMaterialsCollection","collection":"billofmaterialses","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/BillOfMaterialsCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByProduct":{"name":"findByProduct","async":true,"parameters":[{"name":"productId","type":"string","optional":false}],"returnType":"Promise<BillOfMaterials[]>","isStatic":false,"isPublic":true},"findActiveForProduct":{"name":"findActiveForProduct","async":true,"parameters":[{"name":"productId","type":"string","optional":false}],"returnType":"Promise<BillOfMaterials | null>","isStatic":false,"isPublic":true},"findByStatus":{"name":"findByStatus","async":true,"parameters":[{"name":"status","type":"BomStatus","optional":false}],"returnType":"Promise<BillOfMaterials[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_boms","api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"BillOfMaterials","exportName":"BillOfMaterialsCollection","collectionExportName":"BillOfMaterialsCollectionCollection","schema":{"tableName":"manufacturing_boms","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_boms\\" (\\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 \\"product_id\\" TEXT NOT NULL DEFAULT '',\\n \\"version\\" INTEGER NOT NULL DEFAULT 1,\\n \\"effective_date\\" TIMESTAMP,\\n \\"status\\" TEXT NOT NULL DEFAULT 'draft',\\n \\"notes\\" TEXT DEFAULT '',\\n \\"currency\\" TEXT DEFAULT 'USD'\\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},"product_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"version":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"effective_date":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"draft"},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""},"currency":{"type":"TEXT","notNull":false,"unique":false,"default":"USD"}},"indexes":[{"name":"manufacturing_boms_product_id_version_idx","columns":["product_id","version","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_boms_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_boms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"b2691adc"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BomLineCollection":{"name":"bomlinecollection","className":"BomLineCollection","qualifiedName":"@happyvertical/smrt-manufacturing:BomLineCollection","collection":"bomlines","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/BomLineCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<BomLine[]>","isStatic":false,"isPublic":true},"findByComponent":{"name":"findByComponent","async":true,"parameters":[{"name":"componentSkuId","type":"string","optional":false}],"returnType":"Promise<BomLine[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_bom_lines","api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"BomLine","exportName":"BomLineCollection","collectionExportName":"BomLineCollectionCollection","schema":{"tableName":"manufacturing_bom_lines","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_bom_lines\\" (\\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 \\"bom_id\\" TEXT NOT NULL DEFAULT '',\\n \\"component_sku_id\\" TEXT NOT NULL DEFAULT '',\\n \\"qty_per_unit\\" REAL,\\n \\"uom\\" TEXT DEFAULT 'each',\\n \\"waste_percent\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\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},"bom_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"component_sku_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"qty_per_unit":{"type":"REAL","notNull":false,"unique":false},"uom":{"type":"TEXT","notNull":false,"unique":false,"default":"each"},"waste_percent":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_bom_lines_bom_id_component_sku_id_idx","columns":["bom_id","component_sku_id","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_bom_lines_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_bom_lines_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"cfbae7e8"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:OperationCollection":{"name":"operationcollection","className":"OperationCollection","qualifiedName":"@happyvertical/smrt-manufacturing:OperationCollection","collection":"operations","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/OperationCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByCode":{"name":"findByCode","async":true,"parameters":[{"name":"code","type":"string","optional":false}],"returnType":"Promise<Operation | null>","isStatic":false,"isPublic":true},"listOperations":{"name":"listOperations","async":true,"parameters":[{"name":"options","type":"object","optional":true,"memberTypes":["boolean"]}],"returnType":"Promise<Operation[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_operations","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"Operation","exportName":"OperationCollection","collectionExportName":"OperationCollectionCollection","schema":{"tableName":"manufacturing_operations","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_operations\\" (\\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 NOT NULL DEFAULT '',\\n \\"category\\" TEXT DEFAULT '',\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"required_qualification_id\\" UUID\\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":true,"unique":false,"default":""},"category":{"type":"TEXT","notNull":false,"unique":false,"default":""},"is_active":{"type":"BOOLEAN","notNull":false,"unique":false,"default":true},"required_qualification_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_operations_code_tenant_id_idx","columns":["code","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_operations_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_operations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_operations_required_qualification_id_idx","columns":["required_qualification_id"]}],"version":"0b3134d6"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCollection":{"name":"productionruncollection","className":"ProductionRunCollection","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCollection","collection":"productionruns","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/ProductionRunCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<ProductionRun[]>","isStatic":false,"isPublic":true},"findByStatus":{"name":"findByStatus","async":true,"parameters":[{"name":"status","type":"ProductionRunStatus","optional":false}],"returnType":"Promise<ProductionRun[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"ProductionRun","exportName":"ProductionRunCollection","collectionExportName":"ProductionRunCollectionCollection","schema":{"tableName":"manufacturing_production_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_runs\\" (\\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 \\"bom_id\\" UUID NOT NULL,\\n \\"target_qty\\" REAL,\\n \\"completed_qty\\" REAL,\\n \\"status\\" TEXT NOT NULL DEFAULT 'planned'\\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},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"target_qty":{"type":"REAL","notNull":false,"unique":false},"completed_qty":{"type":"REAL","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"planned"}},"indexes":[{"name":"manufacturing_production_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_runs_bom_id_idx","columns":["bom_id"]}],"version":"2ca8147d"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCompletionCollection":{"name":"productionruncompletioncollection","className":"ProductionRunCompletionCollection","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCompletionCollection","collection":"productionruncompletions","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/ProductionRunCompletionCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByRun":{"name":"findByRun","async":true,"parameters":[{"name":"runId","type":"string","optional":false}],"returnType":"Promise<ProductionRunCompletion[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_run_completions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"ProductionRunCompletion","exportName":"ProductionRunCompletionCollection","collectionExportName":"ProductionRunCompletionCollectionCollection","schema":{"tableName":"manufacturing_production_run_completions","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_run_completions\\" (\\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 \\"run_id\\" UUID NOT NULL,\\n \\"qty\\" REAL,\\n \\"completed_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},"run_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_production_runs","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"qty":{"type":"REAL","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_production_run_completions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_run_completions_tenant_ea7a0d0125_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_run_completions_run_id_idx","columns":["run_id"]}],"version":"c940de6c"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:RoutingStepCollection":{"name":"routingstepcollection","className":"RoutingStepCollection","qualifiedName":"@happyvertical/smrt-manufacturing:RoutingStepCollection","collection":"routingsteps","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/RoutingStepCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<RoutingStep[]>","isStatic":false,"isPublic":true},"findByOperation":{"name":"findByOperation","async":true,"parameters":[{"name":"operationId","type":"string","optional":false}],"returnType":"Promise<RoutingStep[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_routing_steps","api":{"include":["list","get"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"RoutingStep","exportName":"RoutingStepCollection","collectionExportName":"RoutingStepCollectionCollection","schema":{"tableName":"manufacturing_routing_steps","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_routing_steps\\" (\\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 \\"bom_id\\" UUID NOT NULL,\\n \\"operation_id\\" UUID NOT NULL,\\n \\"sequence\\" INTEGER NOT NULL DEFAULT 1,\\n \\"estimated_minutes\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\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},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"sequence":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"estimated_minutes":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_routing_steps_bom_id_sequence_idx","columns":["bom_id","sequence","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_routing_steps_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_routing_steps_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_routing_steps_operation_id_idx","columns":["operation_id"]}],"version":"41ac3c66"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:Assembly":{"name":"assembly","className":"Assembly","qualifiedName":"@happyvertical/smrt-manufacturing:Assembly","collection":"products","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Assembly.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"generated":true,"source":"tenantScoped_decorator","sqlType":"UUID","__tenancy":{"isTenantIdField":true,"mode":"optional","field":"tenantId","autoFilter":true,"autoPopulate":true,"allowSuperAdminBypass":false}}},"productType":{"type":"json","required":false},"name":{"type":"text","required":false,"description":"The product name, as customers see it.","_meta":{"description":"The product name, as customers see it."}},"description":{"type":"text","required":false,"description":"A few words on what the product is and who it is for.","_meta":{"description":"A few words on what the product is and who it is for."}},"category":{"type":"text","required":false},"manufacturer":{"type":"text","required":false},"model":{"type":"text","required":false},"price":{"type":"integer","required":true,"default":0,"description":"The price in minor units (cents), for example 1999 for 19.99.","_meta":{"description":"The price in minor units (cents), for example 1999 for 19.99."}},"defaultSalesTaxCodeId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-commerce:TaxCode","_meta":{"description":"The tax code normally used when this product is sold."}},"defaultPurchaseTaxCodeId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-commerce:TaxCode","_meta":{"description":"The tax code normally used when this product is purchased."}},"inStock":{"type":"boolean","required":true,"default":true},"specifications":{"type":"json","required":false,"default":{}},"tags":{"type":"json","required":false,"default":[]},"estimatedLabourMinutes":{"type":"integer","required":false,"default":0},"defaultOperationId":{"type":"foreignKey","required":false,"related":"Operation","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"partReference":{"type":"text","required":false,"default":""}},"methods":{"getSpecification":{"name":"getSpecification","async":true,"parameters":[{"name":"key","type":"string","optional":false}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true},"updateSpecification":{"name":"updateSpecification","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"value","type":"unknown","optional":false}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"getAssets":{"name":"getAssets","async":true,"parameters":[{"name":"relationship","type":"string","optional":true}],"returnType":"Promise<Asset[]>","isStatic":false,"isPublic":true},"addAsset":{"name":"addAsset","async":true,"parameters":[{"name":"asset","type":"Asset","optional":false},{"name":"relationship","type":"any","optional":true,"default":"attachment"},{"name":"sortOrder","type":"any","optional":true}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"removeAsset":{"name":"removeAsset","async":true,"parameters":[{"name":"assetId","type":"string","optional":false},{"name":"relationship","type":"string","optional":true}],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"},"tableName":"products","tableStrategy":"sti"},"extends":"Product","extendsQualified":"@happyvertical/smrt-products:Product","exportName":"Assembly","collectionExportName":"AssemblyCollection","displayLabelField":"name","validationRules":[{"field":"price","rule":"required","fieldType":"integer"},{"field":"inStock","rule":"required","fieldType":"boolean"}],"schema":{"tableName":"products","ddl":"CREATE TABLE IF NOT EXISTS \\"products\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"product_type\\" TEXT,\\n \\"name\\" TEXT,\\n \\"description\\" TEXT,\\n \\"category\\" TEXT,\\n \\"manufacturer\\" TEXT,\\n \\"model\\" TEXT,\\n \\"price\\" INTEGER DEFAULT 0,\\n \\"default_sales_tax_code_id\\" UUID,\\n \\"default_purchase_tax_code_id\\" UUID,\\n \\"in_stock\\" BOOLEAN DEFAULT TRUE,\\n \\"specifications\\" JSON DEFAULT '{}',\\n \\"tags\\" JSON DEFAULT '[]',\\n \\"estimated_labour_minutes\\" INTEGER DEFAULT 0,\\n \\"default_operation_id\\" UUID,\\n \\"part_reference\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"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},"product_type":{"type":"TEXT","notNull":false},"name":{"type":"TEXT","notNull":false},"description":{"type":"TEXT","notNull":false},"category":{"type":"TEXT","notNull":false},"manufacturer":{"type":"TEXT","notNull":false},"model":{"type":"TEXT","notNull":false},"price":{"type":"INTEGER","notNull":false,"default":0},"default_sales_tax_code_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"default_purchase_tax_code_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"in_stock":{"type":"BOOLEAN","notNull":false,"default":true},"specifications":{"type":"JSON","notNull":false,"default":{}},"tags":{"type":"JSON","notNull":false,"default":[]},"estimated_labour_minutes":{"type":"INTEGER","notNull":false,"default":0},"default_operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"part_reference":{"type":"TEXT","notNull":false,"default":""}},"indexes":[{"name":"products_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"products_meta_type_idx","columns":["_meta_type"]},{"name":"products_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"products_default_sales_tax_code_id_idx","columns":["default_sales_tax_code_id"]},{"name":"products_default_purchase_tax_code_id_idx","columns":["default_purchase_tax_code_id"]},{"name":"products_default_operation_id_idx","columns":["default_operation_id"]}],"version":"e1a54866"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BillOfMaterials":{"name":"billofmaterials","className":"BillOfMaterials","qualifiedName":"@happyvertical/smrt-manufacturing:BillOfMaterials","collection":"billofmaterialses","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BillOfMaterials.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"productId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"version":{"type":"integer","required":true,"default":1,"_meta":{"required":true}},"effectiveDate":{"type":"datetime","required":false},"status":{"type":"text","required":true,"default":"draft","_meta":{"required":true},"enum":["draft","active","superseded"]},"notes":{"type":"text","required":false,"default":""},"currency":{"type":"text","required":false,"default":"USD"}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_boms","conflictColumns":["product_id","version","tenant_id"],"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":true,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"BillOfMaterials","collectionExportName":"BillOfMaterialsCollection","validationRules":[{"field":"productId","rule":"required","fieldType":"text"},{"field":"version","rule":"required","fieldType":"integer"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_boms","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_boms\\" (\\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 \\"product_id\\" TEXT NOT NULL DEFAULT '',\\n \\"version\\" INTEGER NOT NULL DEFAULT 1,\\n \\"effective_date\\" TIMESTAMP,\\n \\"status\\" TEXT NOT NULL DEFAULT 'draft',\\n \\"notes\\" TEXT DEFAULT '',\\n \\"currency\\" TEXT DEFAULT 'USD'\\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},"product_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"version":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"effective_date":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"draft"},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""},"currency":{"type":"TEXT","notNull":false,"unique":false,"default":"USD"}},"indexes":[{"name":"manufacturing_boms_product_id_version_idx","columns":["product_id","version","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_boms_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_boms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"b2691adc"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BomLine":{"name":"bomline","className":"BomLine","qualifiedName":"@happyvertical/smrt-manufacturing:BomLine","collection":"bomlines","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BomLine.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"bomId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"componentSkuId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"qtyPerUnit":{"type":"decimal","required":false,"_meta":{}},"uom":{"type":"text","required":false,"default":"each"},"wastePercent":{"type":"decimal","required":false,"_meta":{}},"notes":{"type":"text","required":false,"default":""}},"methods":{"effectiveQtyPerUnit":{"name":"effectiveQtyPerUnit","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_bom_lines","conflictColumns":["bom_id","component_sku_id","tenant_id"],"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"BomLine","collectionExportName":"BomLineCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"text"},{"field":"componentSkuId","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_bom_lines","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_bom_lines\\" (\\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 \\"bom_id\\" TEXT NOT NULL DEFAULT '',\\n \\"component_sku_id\\" TEXT NOT NULL DEFAULT '',\\n \\"qty_per_unit\\" REAL,\\n \\"uom\\" TEXT DEFAULT 'each',\\n \\"waste_percent\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\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},"bom_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"component_sku_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"qty_per_unit":{"type":"REAL","notNull":false,"unique":false},"uom":{"type":"TEXT","notNull":false,"unique":false,"default":"each"},"waste_percent":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_bom_lines_bom_id_component_sku_id_idx","columns":["bom_id","component_sku_id","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_bom_lines_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_bom_lines_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"cfbae7e8"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:Operation":{"name":"operation","className":"Operation","qualifiedName":"@happyvertical/smrt-manufacturing:Operation","collection":"operations","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Operation.ts","packageName":"@happyvertical/smrt-manufacturing","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":true,"default":"","_meta":{"required":true}},"category":{"type":"text","required":false,"default":""},"isActive":{"type":"boolean","required":false,"default":true},"requiredQualificationId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-human-resources:Qualification","_meta":{"nullable":true}}},"methods":{"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_operations","conflictColumns":["code","tenant_id"],"api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"Operation","collectionExportName":"OperationCollection","displayLabelField":"name","validationRules":[{"field":"code","rule":"required","fieldType":"text"},{"field":"name","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_operations","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_operations\\" (\\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 NOT NULL DEFAULT '',\\n \\"category\\" TEXT DEFAULT '',\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"required_qualification_id\\" UUID\\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":true,"unique":false,"default":""},"category":{"type":"TEXT","notNull":false,"unique":false,"default":""},"is_active":{"type":"BOOLEAN","notNull":false,"unique":false,"default":true},"required_qualification_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_operations_code_tenant_id_idx","columns":["code","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_operations_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_operations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_operations_required_qualification_id_idx","columns":["required_qualification_id"]}],"version":"0b3134d6"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRun":{"name":"productionrun","className":"ProductionRun","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRun","collection":"productionruns","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/ProductionRun.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"bomId":{"type":"foreignKey","required":true,"related":"BillOfMaterials","_meta":{"required":true,"onDelete":"RESTRICT"}},"targetQty":{"type":"decimal","required":false,"_meta":{}},"completedQty":{"type":"decimal","required":false,"_meta":{}},"status":{"type":"text","required":true,"default":"planned","_meta":{"required":true},"enum":["planned","in_progress","done","cancelled"]}},"methods":{"remainingQty":{"name":"remainingQty","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"ProductionRun","collectionExportName":"ProductionRunCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"foreignKey"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_production_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_runs\\" (\\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 \\"bom_id\\" UUID NOT NULL,\\n \\"target_qty\\" REAL,\\n \\"completed_qty\\" REAL,\\n \\"status\\" TEXT NOT NULL DEFAULT 'planned'\\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},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"target_qty":{"type":"REAL","notNull":false,"unique":false},"completed_qty":{"type":"REAL","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"planned"}},"indexes":[{"name":"manufacturing_production_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_runs_bom_id_idx","columns":["bom_id"]}],"version":"2ca8147d"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCompletion":{"name":"productionruncompletion","className":"ProductionRunCompletion","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCompletion","collection":"productionruncompletions","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/ProductionRunCompletion.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"runId":{"type":"foreignKey","required":true,"related":"ProductionRun","_meta":{"required":true,"onDelete":"CASCADE"}},"qty":{"type":"decimal","required":false,"_meta":{}},"completedAt":{"type":"datetime","required":false}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_production_run_completions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"ProductionRunCompletion","collectionExportName":"ProductionRunCompletionCollection","validationRules":[{"field":"runId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"manufacturing_production_run_completions","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_run_completions\\" (\\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 \\"run_id\\" UUID NOT NULL,\\n \\"qty\\" REAL,\\n \\"completed_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},"run_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_production_runs","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"qty":{"type":"REAL","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_production_run_completions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_run_completions_tenant_ea7a0d0125_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_run_completions_run_id_idx","columns":["run_id"]}],"version":"c940de6c"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:RoutingStep":{"name":"routingstep","className":"RoutingStep","qualifiedName":"@happyvertical/smrt-manufacturing:RoutingStep","collection":"routingsteps","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/RoutingStep.ts","packageName":"@happyvertical/smrt-manufacturing","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}}},"bomId":{"type":"foreignKey","required":true,"related":"BillOfMaterials","_meta":{"required":true,"onDelete":"CASCADE"}},"operationId":{"type":"foreignKey","required":true,"related":"Operation","_meta":{"required":true,"onDelete":"RESTRICT"}},"sequence":{"type":"integer","required":true,"default":1,"_meta":{"required":true}},"estimatedMinutes":{"type":"decimal","required":false,"_meta":{}},"notes":{"type":"text","required":false,"default":""}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_routing_steps","conflictColumns":["bom_id","sequence","tenant_id"],"api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"RoutingStep","collectionExportName":"RoutingStepCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"foreignKey"},{"field":"operationId","rule":"required","fieldType":"foreignKey"},{"field":"sequence","rule":"required","fieldType":"integer"}],"schema":{"tableName":"manufacturing_routing_steps","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_routing_steps\\" (\\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 \\"bom_id\\" UUID NOT NULL,\\n \\"operation_id\\" UUID NOT NULL,\\n \\"sequence\\" INTEGER NOT NULL DEFAULT 1,\\n \\"estimated_minutes\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\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},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"sequence":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"estimated_minutes":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_routing_steps_bom_id_sequence_idx","columns":["bom_id","sequence","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_routing_steps_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_routing_steps_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_routing_steps_operation_id_idx","columns":["operation_id"]}],"version":"41ac3c66"},"importPath":"@happyvertical/smrt-manufacturing"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-inventory","@happyvertical/smrt-products","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3616","#3624","#3626"],"via":["@happyvertical/smrt-products","@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/models/Operation.ts
|
|
24
24
|
var __defProp$6 = Object.defineProperty;
|