@happyvertical/smrt-manufacturing 0.57.47 → 0.57.48

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 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.47","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","collectionOf":"@happyvertical/smrt-manufacturing:BillOfMaterials","inheritedExposure":["api","mcp"],"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","collectionOf":"@happyvertical/smrt-manufacturing:BomLine","inheritedExposure":["api","mcp"],"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","collectionOf":"@happyvertical/smrt-manufacturing:Operation","inheritedExposure":["api","mcp","cli"],"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","collectionOf":"@happyvertical/smrt-manufacturing:ProductionRun","inheritedExposure":["api","mcp","cli"],"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","collectionOf":"@happyvertical/smrt-manufacturing:ProductionRunCompletion","inheritedExposure":["api","mcp","cli"],"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","collectionOf":"@happyvertical/smrt-manufacturing:RoutingStep","inheritedExposure":["api","mcp"],"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,"enum":["product","material","assembly"]},"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,"description":"About how many minutes it takes to make one.","_meta":{"description":"About how many minutes it takes to make one."}},"defaultOperationId":{"type":"foreignKey","required":false,"related":"Operation","description":"The kind of work usually booked to this assembly.","_meta":{"description":"The kind of work usually booked to this assembly.","nullable":true,"onDelete":"RESTRICT"}},"partReference":{"type":"text","required":false,"default":"","description":"Your own drawing or part number for this assembly.","_meta":{"description":"Your own drawing or part number for this assembly."}}},"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":"","description":"The assembly this list of parts is for.","_meta":{"required":true,"description":"The assembly this list of parts is for."}},"version":{"type":"integer","required":true,"default":1,"description":"The revision number, so you can change a list and keep the old one.","_meta":{"required":true,"description":"The revision number, so you can change a list and keep the old one."}},"effectiveDate":{"type":"datetime","required":false,"description":"The day this list starts to be used.","_meta":{"description":"The day this list starts to be used."}},"status":{"type":"text","required":true,"default":"draft","description":"Whether this list is a draft, in use or retired.","_meta":{"required":true,"description":"Whether this list is a draft, in use or retired."},"enum":["draft","active","superseded"]},"notes":{"type":"text","required":false,"default":"","description":"Anything people making it should know.","_meta":{"description":"Anything people making it should know."}},"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":"","description":"The list of parts this line belongs to.","_meta":{"required":true,"description":"The list of parts this line belongs to."}},"componentSkuId":{"type":"text","required":true,"default":"","description":"The part that goes into the assembly.","_meta":{"required":true,"description":"The part that goes into the assembly."}},"qtyPerUnit":{"type":"decimal","required":false,"description":"How much of this part goes into one unit.","_meta":{"description":"How much of this part goes into one unit."}},"uom":{"type":"text","required":false,"default":"each","description":"What the amount is counted in, such as each or kilograms.","_meta":{"description":"What the amount is counted in, such as each or kilograms."}},"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":"","description":"A short code for this kind of work.","_meta":{"required":true,"description":"A short code for this kind of work."}},"name":{"type":"text","required":true,"default":"","description":"What this kind of work is called, such as cutting.","_meta":{"required":true,"description":"What this kind of work is called, such as cutting."}},"category":{"type":"text","required":false,"default":"","description":"A group to sort similar work together.","_meta":{"description":"A group to sort similar work together."}},"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","description":"The list of parts this run makes from.","_meta":{"description":"The list of parts this run makes from.","required":true,"onDelete":"RESTRICT"}},"targetQty":{"type":"decimal","required":false,"description":"How many you plan to make.","_meta":{"description":"How many you plan to make."}},"completedQty":{"type":"decimal","required":false,"description":"How many have been finished so far.","_meta":{"description":"How many have been finished so far."}},"status":{"type":"text","required":true,"default":"planned","description":"Whether the run is planned, under way, done or cancelled.","_meta":{"required":true,"description":"Whether the run is planned, under way, done or cancelled."},"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","description":"The production run this batch belongs to.","_meta":{"description":"The production run this batch belongs to.","required":true,"onDelete":"CASCADE"}},"qty":{"type":"decimal","required":false,"description":"How many were finished in this batch.","_meta":{"description":"How many were finished in this batch."}},"completedAt":{"type":"datetime","required":false,"description":"When this batch was finished.","_meta":{"description":"When this batch was finished."}}},"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","description":"The list of parts this step is part of.","_meta":{"description":"The list of parts this step is part of.","required":true,"onDelete":"CASCADE"}},"operationId":{"type":"foreignKey","required":true,"related":"Operation","description":"The kind of work done in this step.","_meta":{"description":"The kind of work done in this step.","required":true,"onDelete":"RESTRICT"}},"sequence":{"type":"integer","required":true,"default":1,"description":"The order of this step, starting at 1.","_meta":{"required":true,"description":"The order of this step, starting at 1."}},"estimatedMinutes":{"type":"decimal","required":false,"description":"About how many minutes this step takes.","_meta":{"description":"About how many minutes this step takes."}},"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","recipes":[{"id":"manufacturing.assemblies","className":"AssembliesRecipe","label":"Assemblies","summary":"Define what you make, what goes into it and the steps to make it.","synonyms":["bill of materials","bills of materials","bom","recipes","products you make","routing"],"models":["@happyvertical/smrt-manufacturing:Assembly","@happyvertical/smrt-manufacturing:BillOfMaterials","@happyvertical/smrt-manufacturing:BomLine","@happyvertical/smrt-manufacturing:Operation","@happyvertical/smrt-manufacturing:RoutingStep"],"nav":[{"label":"Assemblies","model":"@happyvertical/smrt-manufacturing:Assembly","icon":"package","description":"The things you make, each built from parts.","noun":"assembly"},{"label":"Bills of materials","model":"@happyvertical/smrt-manufacturing:BillOfMaterials","icon":"fileText","description":"The list of parts and amounts that go into each assembly.","noun":"bill of materials"},{"label":"Operations","model":"@happyvertical/smrt-manufacturing:Operation","icon":"wrench","description":"The kinds of work done to make something, like cutting."}],"requires":[],"requiresAny":[["products.simple","products.clothing"]],"section":{"id":"make","label":"Make","icon":"wrench","description":"Make what you sell from the parts you hold."},"options":{"@happyvertical/smrt-manufacturing:Assembly":{"fields":{"name":{"order":1},"partReference":{"order":2},"description":{"order":3},"price":{"order":4},"estimatedLabourMinutes":{"label":"Minutes to make one","order":5},"defaultOperationId":{"label":"Usual operation","order":6},"tenantId":{"visibility":"hidden"},"productType":{"visibility":"hidden"},"category":{"visibility":"advanced"},"manufacturer":{"visibility":"hidden"},"model":{"visibility":"hidden"},"inStock":{"visibility":"hidden","default":true},"specifications":{"visibility":"hidden"},"tags":{"visibility":"advanced"},"defaultSalesTaxCodeId":{"visibility":"hidden"},"defaultPurchaseTaxCodeId":{"visibility":"hidden"}}},"@happyvertical/smrt-manufacturing:BillOfMaterials":{"fields":{"productId":{"label":"Assembly","order":1},"version":{"order":2},"status":{"order":3},"effectiveDate":{"order":4},"notes":{"order":5},"tenantId":{"visibility":"hidden"},"currency":{"visibility":"advanced"}}},"@happyvertical/smrt-manufacturing:BomLine":{"fields":{"bomId":{"label":"Bill of materials","order":1},"componentSkuId":{"label":"Part","order":2},"qtyPerUnit":{"label":"Amount per unit","order":3},"uom":{"label":"Unit of measure","order":4},"wastePercent":{"visibility":"advanced"},"notes":{"visibility":"advanced"},"tenantId":{"visibility":"hidden"}}},"@happyvertical/smrt-manufacturing:Operation":{"fields":{"name":{"order":1},"code":{"order":2},"category":{"order":3},"isActive":{"visibility":"advanced"},"requiredQualificationId":{"visibility":"advanced"},"tenantId":{"visibility":"hidden"}}},"@happyvertical/smrt-manufacturing:RoutingStep":{"fields":{"bomId":{"label":"Bill of materials","order":1},"operationId":{"label":"Operation","order":2},"sequence":{"label":"Step number","order":3},"estimatedMinutes":{"order":4},"notes":{"visibility":"advanced"},"tenantId":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nAssemblies is where you describe what you make. An assembly is a product built\\nfrom parts. Its bill of materials lists those parts and how much of each goes\\ninto one unit, and its steps say which operations, such as cutting or painting,\\nit passes through and how long each takes.\\n\\n## Tasks\\n\\n### Add something you make\\n\\n1. Open the list of assemblies and choose **New**.\\n2. Give it a **{field:Assembly.name}** and your own **{field:Assembly.partReference}**, such as a drawing or part number.\\n3. Note roughly how long one takes in **{field:Assembly.estimatedLabourMinutes}**.\\n4. Save.\\n\\n### List what goes into it\\n\\n1. Open the bills of materials and choose **New**.\\n2. Pick the **{field:BillOfMaterials.productId}** the list is for.\\n3. Save, then add a line for each part.\\n4. For each line pick the **{field:BomLine.componentSkuId}** and set the **{field:BomLine.qtyPerUnit}** that goes into one unit.\\n\\n### Change how something is made\\n\\n1. Create a new bill of materials with a higher **{field:BillOfMaterials.version}**.\\n2. Set its **{field:BillOfMaterials.status}** to active when it is ready to use.\\n3. Set the old version's **{field:BillOfMaterials.status}** to superseded so only one version is in use.\\n4. The old version stays on file, so past runs still make sense.\\n\\n### See the kinds of work\\n\\nOperations are set up by the manufacturing service, not by hand in the app.\\n\\n1. Open the operations.\\n2. Read each **{field:Operation.name}** and its short **{field:Operation.code}**.\\n3. The steps of a bill of materials use these, each with its **{field:RoutingStep.estimatedMinutes}**.\\n","fieldRefs":["Assembly.estimatedLabourMinutes","Assembly.name","Assembly.partReference","BillOfMaterials.productId","BillOfMaterials.status","BillOfMaterials.version","BomLine.componentSkuId","BomLine.qtyPerUnit","Operation.code","Operation.name","RoutingStep.estimatedMinutes"]},"demo":{"mode":"server","reasons":["Needs a server because its package depends on @happyvertical/smrt-products, @happyvertical/smrt-tenancy, which do not build for a browser (#3616, #3624, #3626)."]}},{"id":"manufacturing.production","className":"ProductionRecipe","label":"Production","summary":"Plan how many to make, record what came out and see each run through to done.","synonyms":["production runs","work orders","manufacturing","batches","build orders"],"models":["@happyvertical/smrt-manufacturing:ProductionRun","@happyvertical/smrt-manufacturing:ProductionRunCompletion"],"nav":[{"label":"Production runs","model":"@happyvertical/smrt-manufacturing:ProductionRun","icon":"layers","description":"Each batch you plan to make, and how far along it is.","noun":"production run"}],"requires":["manufacturing.assemblies"],"section":{"id":"make","label":"Make","icon":"wrench","description":"Make what you sell from the parts you hold."},"options":{"@happyvertical/smrt-manufacturing:ProductionRun":{"fields":{"bomId":{"label":"Bill of materials","order":1},"targetQty":{"label":"How many to make","order":2},"completedQty":{"label":"How many made so far","locked":true,"order":3},"status":{"locked":true,"order":4},"tenantId":{"visibility":"hidden"}}},"@happyvertical/smrt-manufacturing:ProductionRunCompletion":{"fields":{"runId":{"label":"Production run","order":1},"qty":{"label":"How many finished","order":2},"completedAt":{"label":"Finished on","order":3},"tenantId":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nProduction is where you plan and follow what you make. A production run says\\nhow many of an assembly you intend to make, using one of its bills of\\nmaterials. As batches come off the line they are recorded against it, and the run\\nkeeps count until it is done.\\n\\n## Tasks\\n\\nProduction runs and their finished batches are created and updated by the\\nproduction service, not by hand in the app. Here you follow them.\\n\\n### Find a run\\n\\n1. Open the production runs.\\n2. Check the **{field:ProductionRun.bomId}** it makes from and the **{field:ProductionRun.targetQty}** you want.\\n\\n### See how a run is going\\n\\nOpen the run and compare **{field:ProductionRun.completedQty}** with\\n**{field:ProductionRun.targetQty}**. Its **{field:ProductionRun.status}** shows\\nwhether it is planned, under way, finished or cancelled.\\n\\n### See what was finished\\n\\n1. Open the run's finished batches.\\n2. Each one shows the **{field:ProductionRunCompletion.runId}** it belongs to and **{field:ProductionRunCompletion.qty}**, how many came out.\\n","fieldRefs":["ProductionRun.bomId","ProductionRun.completedQty","ProductionRun.status","ProductionRun.targetQty","ProductionRunCompletion.qty","ProductionRunCompletion.runId"]},"demo":{"mode":"server","reasons":["Needs a server because its package depends on @happyvertical/smrt-products, @happyvertical/smrt-tenancy, which do not build for a browser (#3616, #3624, #3626)."]}}],"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.48","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","collectionOf":"@happyvertical/smrt-manufacturing:BillOfMaterials","inheritedExposure":["api","mcp"],"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","collectionOf":"@happyvertical/smrt-manufacturing:BomLine","inheritedExposure":["api","mcp"],"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","collectionOf":"@happyvertical/smrt-manufacturing:Operation","inheritedExposure":["api","mcp","cli"],"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","collectionOf":"@happyvertical/smrt-manufacturing:ProductionRun","inheritedExposure":["api","mcp","cli"],"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","collectionOf":"@happyvertical/smrt-manufacturing:ProductionRunCompletion","inheritedExposure":["api","mcp","cli"],"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","collectionOf":"@happyvertical/smrt-manufacturing:RoutingStep","inheritedExposure":["api","mcp"],"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,"enum":["product","material","assembly"]},"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,"description":"About how many minutes it takes to make one.","_meta":{"description":"About how many minutes it takes to make one."}},"defaultOperationId":{"type":"foreignKey","required":false,"related":"Operation","description":"The kind of work usually booked to this assembly.","_meta":{"description":"The kind of work usually booked to this assembly.","nullable":true,"onDelete":"RESTRICT"}},"partReference":{"type":"text","required":false,"default":"","description":"Your own drawing or part number for this assembly.","_meta":{"description":"Your own drawing or part number for this assembly."}}},"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":"","description":"The assembly this list of parts is for.","_meta":{"required":true,"description":"The assembly this list of parts is for."}},"version":{"type":"integer","required":true,"default":1,"description":"The revision number, so you can change a list and keep the old one.","_meta":{"required":true,"description":"The revision number, so you can change a list and keep the old one."}},"effectiveDate":{"type":"datetime","required":false,"description":"The day this list starts to be used.","_meta":{"description":"The day this list starts to be used."}},"status":{"type":"text","required":true,"default":"draft","description":"Whether this list is a draft, in use or retired.","_meta":{"required":true,"description":"Whether this list is a draft, in use or retired."},"enum":["draft","active","superseded"]},"notes":{"type":"text","required":false,"default":"","description":"Anything people making it should know.","_meta":{"description":"Anything people making it should know."}},"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":"","description":"The list of parts this line belongs to.","_meta":{"required":true,"description":"The list of parts this line belongs to."}},"componentSkuId":{"type":"text","required":true,"default":"","description":"The part that goes into the assembly.","_meta":{"required":true,"description":"The part that goes into the assembly."}},"qtyPerUnit":{"type":"decimal","required":false,"description":"How much of this part goes into one unit.","_meta":{"description":"How much of this part goes into one unit."}},"uom":{"type":"text","required":false,"default":"each","description":"What the amount is counted in, such as each or kilograms.","_meta":{"description":"What the amount is counted in, such as each or kilograms."}},"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":"","description":"A short code for this kind of work.","_meta":{"required":true,"description":"A short code for this kind of work."}},"name":{"type":"text","required":true,"default":"","description":"What this kind of work is called, such as cutting.","_meta":{"required":true,"description":"What this kind of work is called, such as cutting."}},"category":{"type":"text","required":false,"default":"","description":"A group to sort similar work together.","_meta":{"description":"A group to sort similar work together."}},"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","description":"The list of parts this run makes from.","_meta":{"description":"The list of parts this run makes from.","required":true,"onDelete":"RESTRICT"}},"targetQty":{"type":"decimal","required":false,"description":"How many you plan to make.","_meta":{"description":"How many you plan to make."}},"completedQty":{"type":"decimal","required":false,"description":"How many have been finished so far.","_meta":{"description":"How many have been finished so far."}},"status":{"type":"text","required":true,"default":"planned","description":"Whether the run is planned, under way, done or cancelled.","_meta":{"required":true,"description":"Whether the run is planned, under way, done or cancelled."},"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","description":"The production run this batch belongs to.","_meta":{"description":"The production run this batch belongs to.","required":true,"onDelete":"CASCADE"}},"qty":{"type":"decimal","required":false,"description":"How many were finished in this batch.","_meta":{"description":"How many were finished in this batch."}},"completedAt":{"type":"datetime","required":false,"description":"When this batch was finished.","_meta":{"description":"When this batch was finished."}}},"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","description":"The list of parts this step is part of.","_meta":{"description":"The list of parts this step is part of.","required":true,"onDelete":"CASCADE"}},"operationId":{"type":"foreignKey","required":true,"related":"Operation","description":"The kind of work done in this step.","_meta":{"description":"The kind of work done in this step.","required":true,"onDelete":"RESTRICT"}},"sequence":{"type":"integer","required":true,"default":1,"description":"The order of this step, starting at 1.","_meta":{"required":true,"description":"The order of this step, starting at 1."}},"estimatedMinutes":{"type":"decimal","required":false,"description":"About how many minutes this step takes.","_meta":{"description":"About how many minutes this step takes."}},"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","recipes":[{"id":"manufacturing.assemblies","className":"AssembliesRecipe","label":"Assemblies","summary":"Define what you make, what goes into it and the steps to make it.","synonyms":["bill of materials","bills of materials","bom","recipes","products you make","routing"],"models":["@happyvertical/smrt-manufacturing:Assembly","@happyvertical/smrt-manufacturing:BillOfMaterials","@happyvertical/smrt-manufacturing:BomLine","@happyvertical/smrt-manufacturing:Operation","@happyvertical/smrt-manufacturing:RoutingStep"],"nav":[{"label":"Assemblies","model":"@happyvertical/smrt-manufacturing:Assembly","icon":"package","description":"The things you make, each built from parts.","noun":"assembly"},{"label":"Bills of materials","model":"@happyvertical/smrt-manufacturing:BillOfMaterials","icon":"fileText","description":"The list of parts and amounts that go into each assembly.","noun":"bill of materials"},{"label":"Operations","model":"@happyvertical/smrt-manufacturing:Operation","icon":"wrench","description":"The kinds of work done to make something, like cutting."}],"requires":[],"requiresAny":[["products.simple","products.clothing"]],"section":{"id":"make","label":"Make","icon":"wrench","description":"Make what you sell from the parts you hold."},"options":{"@happyvertical/smrt-manufacturing:Assembly":{"fields":{"name":{"order":1},"partReference":{"order":2},"description":{"order":3},"price":{"order":4},"estimatedLabourMinutes":{"label":"Minutes to make one","order":5},"defaultOperationId":{"label":"Usual operation","order":6},"tenantId":{"visibility":"hidden"},"productType":{"visibility":"hidden"},"category":{"visibility":"advanced"},"manufacturer":{"visibility":"hidden"},"model":{"visibility":"hidden"},"inStock":{"visibility":"hidden","default":true},"specifications":{"visibility":"hidden"},"tags":{"visibility":"advanced"},"defaultSalesTaxCodeId":{"visibility":"hidden"},"defaultPurchaseTaxCodeId":{"visibility":"hidden"}}},"@happyvertical/smrt-manufacturing:BillOfMaterials":{"fields":{"productId":{"label":"Assembly","order":1},"version":{"order":2},"status":{"order":3},"effectiveDate":{"order":4},"notes":{"order":5},"tenantId":{"visibility":"hidden"},"currency":{"visibility":"advanced"}}},"@happyvertical/smrt-manufacturing:BomLine":{"fields":{"bomId":{"label":"Bill of materials","order":1},"componentSkuId":{"label":"Part","order":2},"qtyPerUnit":{"label":"Amount per unit","order":3},"uom":{"label":"Unit of measure","order":4},"wastePercent":{"visibility":"advanced"},"notes":{"visibility":"advanced"},"tenantId":{"visibility":"hidden"}}},"@happyvertical/smrt-manufacturing:Operation":{"fields":{"name":{"order":1},"code":{"order":2},"category":{"order":3},"isActive":{"visibility":"advanced"},"requiredQualificationId":{"visibility":"advanced"},"tenantId":{"visibility":"hidden"}}},"@happyvertical/smrt-manufacturing:RoutingStep":{"fields":{"bomId":{"label":"Bill of materials","order":1},"operationId":{"label":"Operation","order":2},"sequence":{"label":"Step number","order":3},"estimatedMinutes":{"order":4},"notes":{"visibility":"advanced"},"tenantId":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nAssemblies is where you describe what you make. An assembly is a product built\\nfrom parts. Its bill of materials lists those parts and how much of each goes\\ninto one unit, and its steps say which operations, such as cutting or painting,\\nit passes through and how long each takes.\\n\\n## Tasks\\n\\n### Add something you make\\n\\n1. Open the list of assemblies and choose **New**.\\n2. Give it a **{field:Assembly.name}** and your own **{field:Assembly.partReference}**, such as a drawing or part number.\\n3. Note roughly how long one takes in **{field:Assembly.estimatedLabourMinutes}**.\\n4. Save.\\n\\n### List what goes into it\\n\\n1. Open the bills of materials and choose **New**.\\n2. Pick the **{field:BillOfMaterials.productId}** the list is for.\\n3. Save, then add a line for each part.\\n4. For each line pick the **{field:BomLine.componentSkuId}** and set the **{field:BomLine.qtyPerUnit}** that goes into one unit.\\n\\n### Change how something is made\\n\\n1. Create a new bill of materials with a higher **{field:BillOfMaterials.version}**.\\n2. Set its **{field:BillOfMaterials.status}** to active when it is ready to use.\\n3. Set the old version's **{field:BillOfMaterials.status}** to superseded so only one version is in use.\\n4. The old version stays on file, so past runs still make sense.\\n\\n### See the kinds of work\\n\\nOperations are set up by the manufacturing service, not by hand in the app.\\n\\n1. Open the operations.\\n2. Read each **{field:Operation.name}** and its short **{field:Operation.code}**.\\n3. The steps of a bill of materials use these, each with its **{field:RoutingStep.estimatedMinutes}**.\\n","fieldRefs":["Assembly.estimatedLabourMinutes","Assembly.name","Assembly.partReference","BillOfMaterials.productId","BillOfMaterials.status","BillOfMaterials.version","BomLine.componentSkuId","BomLine.qtyPerUnit","Operation.code","Operation.name","RoutingStep.estimatedMinutes"]},"demo":{"mode":"server","reasons":["Needs a server because its package depends on @happyvertical/smrt-products, @happyvertical/smrt-tenancy, which do not build for a browser (#3616, #3624, #3626)."]}},{"id":"manufacturing.production","className":"ProductionRecipe","label":"Production","summary":"Plan how many to make, record what came out and see each run through to done.","synonyms":["production runs","work orders","manufacturing","batches","build orders"],"models":["@happyvertical/smrt-manufacturing:ProductionRun","@happyvertical/smrt-manufacturing:ProductionRunCompletion"],"nav":[{"label":"Production runs","model":"@happyvertical/smrt-manufacturing:ProductionRun","icon":"layers","description":"Each batch you plan to make, and how far along it is.","noun":"production run"}],"requires":["manufacturing.assemblies"],"section":{"id":"make","label":"Make","icon":"wrench","description":"Make what you sell from the parts you hold."},"options":{"@happyvertical/smrt-manufacturing:ProductionRun":{"fields":{"bomId":{"label":"Bill of materials","order":1},"targetQty":{"label":"How many to make","order":2},"completedQty":{"label":"How many made so far","locked":true,"order":3},"status":{"locked":true,"order":4},"tenantId":{"visibility":"hidden"}}},"@happyvertical/smrt-manufacturing:ProductionRunCompletion":{"fields":{"runId":{"label":"Production run","order":1},"qty":{"label":"How many finished","order":2},"completedAt":{"label":"Finished on","order":3},"tenantId":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nProduction is where you plan and follow what you make. A production run says\\nhow many of an assembly you intend to make, using one of its bills of\\nmaterials. As batches come off the line they are recorded against it, and the run\\nkeeps count until it is done.\\n\\n## Tasks\\n\\nProduction runs and their finished batches are created and updated by the\\nproduction service, not by hand in the app. Here you follow them.\\n\\n### Find a run\\n\\n1. Open the production runs.\\n2. Check the **{field:ProductionRun.bomId}** it makes from and the **{field:ProductionRun.targetQty}** you want.\\n\\n### See how a run is going\\n\\nOpen the run and compare **{field:ProductionRun.completedQty}** with\\n**{field:ProductionRun.targetQty}**. Its **{field:ProductionRun.status}** shows\\nwhether it is planned, under way, finished or cancelled.\\n\\n### See what was finished\\n\\n1. Open the run's finished batches.\\n2. Each one shows the **{field:ProductionRunCompletion.runId}** it belongs to and **{field:ProductionRunCompletion.qty}**, how many came out.\\n","fieldRefs":["ProductionRun.bomId","ProductionRun.completedQty","ProductionRun.status","ProductionRun.targetQty","ProductionRunCompletion.qty","ProductionRunCompletion.runId"]},"demo":{"mode":"server","reasons":["Needs a server because its package depends on @happyvertical/smrt-products, @happyvertical/smrt-tenancy, which do not build for a browser (#3616, #3624, #3626)."]}}],"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;