@happyvertical/smrt-manufacturing 0.54.3 → 0.54.4

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/AGENTS.md CHANGED
@@ -52,7 +52,7 @@ Detail: [agents/multilevel-and-runs.md](agents/multilevel-and-runs.md).
52
52
 
53
53
  ## Svelte components (`./svelte`)
54
54
 
55
- Props-driven; the host loads and persists. `AssemblyList` (a structural `policy` drops hidden columns), `AssemblyForm` (smrt-ui controls like `OperationForm`: `assembly`, `onsubmit`, `operations` for the default-operation picker, a retired or unlisted current operation stays selected and marked, `hiddenFields`/`readonlyFields` for the reader's field policy; price is major units in the form and integer minor units in `onsubmit`; `validateAssemblyForm` mirrors the model's whole-minutes rule). `smrt-fields` is not a dependency: never add `ObjectForm`, `BomEditor` (add/edit/remove lines through host handlers; a sub-assembly shows whether it has its own bill and expands read-only through `loadBill`), `BomStructureTree` (the read-only nested view). `ProductionRunList` (progress, status, and with `oncomplete` a quantity field per open run; rows from `toProductionRunView`), `RequirementsTree` (read-only `explode` / `planRequirements` result by level with totals; `toRequirementTree`, `toRequirementTotals`; internal `RequirementsTreeLevel`). Adapters: `toAssemblyView`, `toBomEditorLines`. Strings are under `manufacturing.` in `src/svelte/i18n.ts`; the package is strict for raw primitives, hardcoded strings and JSDoc.
55
+ Props-driven; the host loads and persists. `AssemblyList` (a structural `policy` drops hidden columns), `AssemblyForm` (smrt-ui controls like `OperationForm`: `assembly`, `onsubmit(values, formData)`, `operations` for the default-operation picker, `showSkuCode` for a required part-number field (`values.skuCode`; host-reported messages through `errors.fields.skuCode`), `extraFields` snippet inside the form, a retired or unlisted current operation stays selected and marked, `hiddenFields`/`readonlyFields` for the reader's field policy; price is major units in the form and integer minor units in `onsubmit`; `validateAssemblyForm` mirrors the model's whole-minutes rule). `smrt-fields` is not a dependency: never add `ObjectForm`, `BomEditor` (add/edit/remove lines through host handlers; a sub-assembly shows whether it has its own bill and expands read-only through `loadBill`), `BomStructureTree` (the read-only nested view). `ProductionRunList` (progress, status, and with `oncomplete` a quantity field per open run; `onsettarget`/`onfinish`/`oncancel` each add their control only when given, finish and cancel behind a `ConfirmDialog`; rows from `toProductionRunView`), `RequirementsTree` (read-only `explode` / `planRequirements` result by level with totals; `toRequirementTree`, `toRequirementTotals`; internal `RequirementsTreeLevel`). Adapters: `toAssemblyView`, `toBomEditorLines`; the BOM and requirement adapters live in `src/views.ts` (no runtime imports, exported as `./views`, re-exported by `./svelte`: keep it component-free). Strings are under `manufacturing.` in `src/svelte/i18n.ts`; the package is strict for raw primitives, hardcoded strings and JSDoc.
56
56
 
57
57
 
58
58
  ## BomService — planning helpers
package/README.md CHANGED
@@ -354,11 +354,21 @@ Per-handler toggles (`installProductionPosted`, `installProductionCompleted`) le
354
354
  <AssemblyList {assemblies} {policy} onselect={(id) => goto(`/assemblies/${id}`)} />
355
355
  <AssemblyForm {assembly} {operations} hiddenFields={['price']} onsubmit={save} />
356
356
  <BomEditor {lines} {components} onadd={addLine} loadBill={loadLines} error={saveError} />
357
- <ProductionRunList {runs} oncomplete={(runId, qty) => report(runId, qty)} />
357
+ <ProductionRunList
358
+ {runs}
359
+ oncomplete={(runId, qty) => report(runId, qty)}
360
+ onsettarget={(run, target) => runService.setTarget(run.id, target)}
361
+ onfinish={(run) => runService.finish(run.id)}
362
+ oncancel={(run) => runService.cancel(run.id)}
363
+ />
358
364
  <RequirementsTree lines={toRequirementTree(plan)} totals={toRequirementTotals(plan)} />
359
365
  ```
360
366
 
361
- `AssemblyList` takes the resolved field `policy` for Assembly and drops the columns it hides (a hidden price is not shown). `AssemblyForm` is a plain form on smrt-ui controls: name, description, category, part reference, price (typed in major units, checked against the `currency` prop's minor-unit exponent, handed over as integer minor units; a field the reader leaves untouched keeps its stored value exactly), estimated labour (whole minutes, zero or more), a default-operation picker over the `operations` you pass (pass the active ones; a retired or unlisted current operation stays selected, marked, and can be cleared) and tags. Pass the `assembly` being edited (omit to add), and map the reader's field policy onto `hiddenFields` (not rendered) and `readonlyFields` (shown, not editable); both carry their initial value through `onsubmit` unchanged, so save only what the reader may write. `onsubmit` receives checked values and the form never persists. Build rows with `toAssemblyView` and editor lines with `toBomEditorLines(await assemblyService.getBillStructure(bomId))`. A sub-assembly line in `BomEditor` says whether it has its own bill and expands read-only through `loadBill`. `ProductionRunList` shows each run's progress and status and, with `oncomplete`, a field to report finished units (rows from `toProductionRunView`). `RequirementsTree` shows an `explode` or `planRequirements` result by level, with available and short per line for a plan.
367
+ `AssemblyList` takes the resolved field `policy` for Assembly and drops the columns it hides (a hidden price is not shown). `AssemblyForm` is a plain form on smrt-ui controls: name, description, category, part reference, price (typed in major units, checked against the `currency` prop's minor-unit exponent, handed over as integer minor units; a field the reader leaves untouched keeps its stored value exactly), estimated labour (whole minutes, zero or more), a default-operation picker over the `operations` you pass (pass the active ones; a retired or unlisted current operation stays selected, marked, and can be cleared) and tags. Pass the `assembly` being edited (omit to add), and map the reader's field policy onto `hiddenFields` (not rendered) and `readonlyFields` (shown, not editable); both carry their initial value through `onsubmit` unchanged, so save only what the reader may write. `onsubmit(values, formData)` receives checked values and the form's `FormData`; the form never persists. `showSkuCode` adds a required part-number field (the code of the assembly's `Sku`; trimmed into `values.skuCode`, absent from `values` when not shown; give the stored code as `assembly.skuCode`); report a duplicate code from your save with `errors={{ fields: { skuCode: 'FR-100 is already in use.' } }}` (`errors.form` shows a whole-form message). `extraFields` is a snippet rendered inside the form before its actions, so a host's own named controls submit with it and arrive in `formData`. Build rows with `toAssemblyView` and editor lines with `toBomEditorLines(await assemblyService.getBillStructure(bomId))`. A sub-assembly line in `BomEditor` says whether it has its own bill and expands read-only through `loadBill`. `ProductionRunList` shows each run's progress and status and, with `oncomplete`, a field to report finished units (rows from `toProductionRunView`). `onsettarget(run, target)`, `onfinish(run)` and `oncancel(run)` each add their own control to open runs, and only when given: a target field (checked above zero and not below what is done), and Finish and Cancel run buttons that ask through a `ConfirmDialog` first. A handler that returns `false` or throws keeps the input and shows a failure message; the host calls `ProductionRunService.setTarget`, `finish` or `cancel` and refreshes `runs`. `RequirementsTree` shows an `explode` or `planRequirements` result by level, with available and short per line for a plan.
368
+
369
+ ### Component-free view adapters
370
+
371
+ `@happyvertical/smrt-manufacturing/views` exports `toBomEditorLine`, `toBomEditorLines`, `toRequirementTree` and `toRequirementTotals` (and their `BomEditorLine`, `RequirementLineView` and `RequirementTotalView` types) from a module that imports no component, so a server load can adapt service results without compiling any `.svelte` file. `./svelte` re-exports the same functions unchanged.
362
372
 
363
373
  ## API
364
374
 
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.54.3","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"},"extends":"SmrtCollection","extendsTypeArg":"BillOfMaterials","exportName":"BillOfMaterialsCollection","collectionExportName":"BillOfMaterialsCollectionCollection","schema":{"tableName":"manufacturing_boms","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_boms\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"product_id\\" TEXT NOT NULL DEFAULT '',\\n \\"version\\" INTEGER NOT NULL DEFAULT 1,\\n \\"effective_date\\" TIMESTAMP,\\n \\"status\\" TEXT NOT NULL DEFAULT 'draft',\\n \\"notes\\" TEXT DEFAULT '',\\n \\"currency\\" TEXT DEFAULT 'USD'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"product_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"version":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"effective_date":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"draft"},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""},"currency":{"type":"TEXT","notNull":false,"unique":false,"default":"USD"}},"indexes":[{"name":"manufacturing_boms_product_id_version_idx","columns":["product_id","version","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_boms_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_boms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"b2691adc"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BomLineCollection":{"name":"bomlinecollection","className":"BomLineCollection","qualifiedName":"@happyvertical/smrt-manufacturing:BomLineCollection","collection":"bomlines","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/BomLineCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<BomLine[]>","isStatic":false,"isPublic":true},"findByComponent":{"name":"findByComponent","async":true,"parameters":[{"name":"componentSkuId","type":"string","optional":false}],"returnType":"Promise<BomLine[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_bom_lines"},"extends":"SmrtCollection","extendsTypeArg":"BomLine","exportName":"BomLineCollection","collectionExportName":"BomLineCollectionCollection","schema":{"tableName":"manufacturing_bom_lines","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_bom_lines\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" TEXT NOT NULL DEFAULT '',\\n \\"component_sku_id\\" TEXT NOT NULL DEFAULT '',\\n \\"qty_per_unit\\" REAL,\\n \\"uom\\" TEXT DEFAULT 'each',\\n \\"waste_percent\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"component_sku_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"qty_per_unit":{"type":"REAL","notNull":false,"unique":false},"uom":{"type":"TEXT","notNull":false,"unique":false,"default":"each"},"waste_percent":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_bom_lines_bom_id_component_sku_id_idx","columns":["bom_id","component_sku_id","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_bom_lines_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_bom_lines_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"cfbae7e8"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:OperationCollection":{"name":"operationcollection","className":"OperationCollection","qualifiedName":"@happyvertical/smrt-manufacturing:OperationCollection","collection":"operations","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/OperationCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByCode":{"name":"findByCode","async":true,"parameters":[{"name":"code","type":"string","optional":false}],"returnType":"Promise<Operation | null>","isStatic":false,"isPublic":true},"listOperations":{"name":"listOperations","async":true,"parameters":[{"name":"options","type":"object","optional":true,"memberTypes":["boolean"]}],"returnType":"Promise<Operation[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_operations"},"extends":"SmrtCollection","extendsTypeArg":"Operation","exportName":"OperationCollection","collectionExportName":"OperationCollectionCollection","schema":{"tableName":"manufacturing_operations","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_operations\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"code\\" TEXT NOT NULL DEFAULT '',\\n \\"name\\" TEXT NOT NULL DEFAULT '',\\n \\"category\\" TEXT DEFAULT '',\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"required_qualification_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"code":{"type":"TEXT","notNull":true,"unique":false,"default":""},"name":{"type":"TEXT","notNull":true,"unique":false,"default":""},"category":{"type":"TEXT","notNull":false,"unique":false,"default":""},"is_active":{"type":"BOOLEAN","notNull":false,"unique":false,"default":true},"required_qualification_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_operations_code_tenant_id_idx","columns":["code","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_operations_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_operations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_operations_required_qualification_id_idx","columns":["required_qualification_id"]}],"version":"0b3134d6"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCollection":{"name":"productionruncollection","className":"ProductionRunCollection","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCollection","collection":"productionruns","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/ProductionRunCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<ProductionRun[]>","isStatic":false,"isPublic":true},"findByStatus":{"name":"findByStatus","async":true,"parameters":[{"name":"status","type":"ProductionRunStatus","optional":false}],"returnType":"Promise<ProductionRun[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_runs"},"extends":"SmrtCollection","extendsTypeArg":"ProductionRun","exportName":"ProductionRunCollection","collectionExportName":"ProductionRunCollectionCollection","schema":{"tableName":"manufacturing_production_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_runs\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" UUID NOT NULL,\\n \\"target_qty\\" REAL,\\n \\"completed_qty\\" REAL,\\n \\"status\\" TEXT NOT NULL DEFAULT 'planned'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"target_qty":{"type":"REAL","notNull":false,"unique":false},"completed_qty":{"type":"REAL","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"planned"}},"indexes":[{"name":"manufacturing_production_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_runs_bom_id_idx","columns":["bom_id"]}],"version":"2ca8147d"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCompletionCollection":{"name":"productionruncompletioncollection","className":"ProductionRunCompletionCollection","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCompletionCollection","collection":"productionruncompletions","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/ProductionRunCompletionCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByRun":{"name":"findByRun","async":true,"parameters":[{"name":"runId","type":"string","optional":false}],"returnType":"Promise<ProductionRunCompletion[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_run_completions"},"extends":"SmrtCollection","extendsTypeArg":"ProductionRunCompletion","exportName":"ProductionRunCompletionCollection","collectionExportName":"ProductionRunCompletionCollectionCollection","schema":{"tableName":"manufacturing_production_run_completions","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_run_completions\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"run_id\\" UUID NOT NULL,\\n \\"qty\\" REAL,\\n \\"completed_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"run_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_production_runs","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"qty":{"type":"REAL","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_production_run_completions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_run_completions_tenant_ea7a0d0125_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_run_completions_run_id_idx","columns":["run_id"]}],"version":"c940de6c"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:RoutingStepCollection":{"name":"routingstepcollection","className":"RoutingStepCollection","qualifiedName":"@happyvertical/smrt-manufacturing:RoutingStepCollection","collection":"routingsteps","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/RoutingStepCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<RoutingStep[]>","isStatic":false,"isPublic":true},"findByOperation":{"name":"findByOperation","async":true,"parameters":[{"name":"operationId","type":"string","optional":false}],"returnType":"Promise<RoutingStep[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_routing_steps"},"extends":"SmrtCollection","extendsTypeArg":"RoutingStep","exportName":"RoutingStepCollection","collectionExportName":"RoutingStepCollectionCollection","schema":{"tableName":"manufacturing_routing_steps","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_routing_steps\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" UUID NOT NULL,\\n \\"operation_id\\" UUID NOT NULL,\\n \\"sequence\\" INTEGER NOT NULL DEFAULT 1,\\n \\"estimated_minutes\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"sequence":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"estimated_minutes":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_routing_steps_bom_id_sequence_idx","columns":["bom_id","sequence","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_routing_steps_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_routing_steps_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_routing_steps_operation_id_idx","columns":["operation_id"]}],"version":"41ac3c66"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:Assembly":{"name":"assembly","className":"Assembly","qualifiedName":"@happyvertical/smrt-manufacturing:Assembly","collection":"products","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Assembly.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"generated":true,"source":"tenantScoped_decorator","sqlType":"UUID","__tenancy":{"isTenantIdField":true,"mode":"optional","field":"tenantId","autoFilter":true,"autoPopulate":true,"allowSuperAdminBypass":false}}},"productType":{"type":"json","required":false},"name":{"type":"text","required":false},"description":{"type":"text","required":false},"category":{"type":"text","required":false},"manufacturer":{"type":"text","required":false},"model":{"type":"text","required":false},"price":{"type":"integer","required":true,"default":0},"inStock":{"type":"boolean","required":true,"default":true},"specifications":{"type":"json","required":false,"default":{}},"tags":{"type":"json","required":false,"default":[]},"estimatedLabourMinutes":{"type":"integer","required":false,"default":0},"defaultOperationId":{"type":"foreignKey","required":false,"related":"Operation","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"partReference":{"type":"text","required":false,"default":""}},"methods":{"getSpecification":{"name":"getSpecification","async":true,"parameters":[{"name":"key","type":"string","optional":false}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true},"updateSpecification":{"name":"updateSpecification","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"value","type":"unknown","optional":false}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"getAssets":{"name":"getAssets","async":true,"parameters":[{"name":"relationship","type":"string","optional":true}],"returnType":"Promise<Asset[]>","isStatic":false,"isPublic":true},"addAsset":{"name":"addAsset","async":true,"parameters":[{"name":"asset","type":"Asset","optional":false},{"name":"relationship","type":"any","optional":true,"default":"attachment"},{"name":"sortOrder","type":"any","optional":true}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"removeAsset":{"name":"removeAsset","async":true,"parameters":[{"name":"assetId","type":"string","optional":false},{"name":"relationship","type":"string","optional":true}],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"},"tableName":"products","tableStrategy":"sti"},"extends":"Product","exportName":"Assembly","collectionExportName":"AssemblyCollection","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 \\"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},"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_operation_id_idx","columns":["default_operation_id"]}],"version":"f2f2bf95"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BillOfMaterials":{"name":"billofmaterials","className":"BillOfMaterials","qualifiedName":"@happyvertical/smrt-manufacturing:BillOfMaterials","collection":"billofmaterialses","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BillOfMaterials.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"productId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"version":{"type":"integer","required":true,"default":1,"_meta":{"required":true}},"effectiveDate":{"type":"datetime","required":false},"status":{"type":"text","required":true,"default":"draft","_meta":{"required":true}},"notes":{"type":"text","required":false,"default":""},"currency":{"type":"text","required":false,"default":"USD"}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_boms","conflictColumns":["product_id","version","tenant_id"],"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":true,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"BillOfMaterials","collectionExportName":"BillOfMaterialsCollection","validationRules":[{"field":"productId","rule":"required","fieldType":"text"},{"field":"version","rule":"required","fieldType":"integer"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_boms","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_boms\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"product_id\\" TEXT NOT NULL DEFAULT '',\\n \\"version\\" INTEGER NOT NULL DEFAULT 1,\\n \\"effective_date\\" TIMESTAMP,\\n \\"status\\" TEXT NOT NULL DEFAULT 'draft',\\n \\"notes\\" TEXT DEFAULT '',\\n \\"currency\\" TEXT DEFAULT 'USD'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"product_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"version":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"effective_date":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"draft"},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""},"currency":{"type":"TEXT","notNull":false,"unique":false,"default":"USD"}},"indexes":[{"name":"manufacturing_boms_product_id_version_idx","columns":["product_id","version","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_boms_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_boms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"b2691adc"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BomLine":{"name":"bomline","className":"BomLine","qualifiedName":"@happyvertical/smrt-manufacturing:BomLine","collection":"bomlines","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BomLine.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"bomId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"componentSkuId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"qtyPerUnit":{"type":"decimal","required":false,"_meta":{}},"uom":{"type":"text","required":false,"default":"each"},"wastePercent":{"type":"decimal","required":false,"_meta":{}},"notes":{"type":"text","required":false,"default":""}},"methods":{"effectiveQtyPerUnit":{"name":"effectiveQtyPerUnit","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_bom_lines","conflictColumns":["bom_id","component_sku_id","tenant_id"],"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"BomLine","collectionExportName":"BomLineCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"text"},{"field":"componentSkuId","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_bom_lines","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_bom_lines\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" TEXT NOT NULL DEFAULT '',\\n \\"component_sku_id\\" TEXT NOT NULL DEFAULT '',\\n \\"qty_per_unit\\" REAL,\\n \\"uom\\" TEXT DEFAULT 'each',\\n \\"waste_percent\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"component_sku_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"qty_per_unit":{"type":"REAL","notNull":false,"unique":false},"uom":{"type":"TEXT","notNull":false,"unique":false,"default":"each"},"waste_percent":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_bom_lines_bom_id_component_sku_id_idx","columns":["bom_id","component_sku_id","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_bom_lines_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_bom_lines_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"cfbae7e8"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:Operation":{"name":"operation","className":"Operation","qualifiedName":"@happyvertical/smrt-manufacturing:Operation","collection":"operations","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Operation.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"code":{"type":"text","required":true,"default":"","_meta":{"required":true}},"name":{"type":"text","required":true,"default":"","_meta":{"required":true}},"category":{"type":"text","required":false,"default":""},"isActive":{"type":"boolean","required":false,"default":true},"requiredQualificationId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-human-resources:Qualification","_meta":{"nullable":true}}},"methods":{"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_operations","conflictColumns":["code","tenant_id"],"api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"Operation","collectionExportName":"OperationCollection","validationRules":[{"field":"code","rule":"required","fieldType":"text"},{"field":"name","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_operations","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_operations\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"code\\" TEXT NOT NULL DEFAULT '',\\n \\"name\\" TEXT NOT NULL DEFAULT '',\\n \\"category\\" TEXT DEFAULT '',\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"required_qualification_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"code":{"type":"TEXT","notNull":true,"unique":false,"default":""},"name":{"type":"TEXT","notNull":true,"unique":false,"default":""},"category":{"type":"TEXT","notNull":false,"unique":false,"default":""},"is_active":{"type":"BOOLEAN","notNull":false,"unique":false,"default":true},"required_qualification_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_operations_code_tenant_id_idx","columns":["code","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_operations_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_operations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_operations_required_qualification_id_idx","columns":["required_qualification_id"]}],"version":"0b3134d6"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRun":{"name":"productionrun","className":"ProductionRun","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRun","collection":"productionruns","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/ProductionRun.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"bomId":{"type":"foreignKey","required":true,"related":"BillOfMaterials","_meta":{"required":true,"onDelete":"RESTRICT"}},"targetQty":{"type":"decimal","required":false,"_meta":{}},"completedQty":{"type":"decimal","required":false,"_meta":{}},"status":{"type":"text","required":true,"default":"planned","_meta":{"required":true}}},"methods":{"remainingQty":{"name":"remainingQty","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"ProductionRun","collectionExportName":"ProductionRunCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"foreignKey"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_production_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_runs\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" UUID NOT NULL,\\n \\"target_qty\\" REAL,\\n \\"completed_qty\\" REAL,\\n \\"status\\" TEXT NOT NULL DEFAULT 'planned'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"target_qty":{"type":"REAL","notNull":false,"unique":false},"completed_qty":{"type":"REAL","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"planned"}},"indexes":[{"name":"manufacturing_production_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_runs_bom_id_idx","columns":["bom_id"]}],"version":"2ca8147d"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCompletion":{"name":"productionruncompletion","className":"ProductionRunCompletion","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCompletion","collection":"productionruncompletions","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/ProductionRunCompletion.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"runId":{"type":"foreignKey","required":true,"related":"ProductionRun","_meta":{"required":true,"onDelete":"CASCADE"}},"qty":{"type":"decimal","required":false,"_meta":{}},"completedAt":{"type":"datetime","required":false}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_production_run_completions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"ProductionRunCompletion","collectionExportName":"ProductionRunCompletionCollection","validationRules":[{"field":"runId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"manufacturing_production_run_completions","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_run_completions\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"run_id\\" UUID NOT NULL,\\n \\"qty\\" REAL,\\n \\"completed_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"run_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_production_runs","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"qty":{"type":"REAL","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_production_run_completions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_run_completions_tenant_ea7a0d0125_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_run_completions_run_id_idx","columns":["run_id"]}],"version":"c940de6c"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:RoutingStep":{"name":"routingstep","className":"RoutingStep","qualifiedName":"@happyvertical/smrt-manufacturing:RoutingStep","collection":"routingsteps","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/RoutingStep.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"bomId":{"type":"foreignKey","required":true,"related":"BillOfMaterials","_meta":{"required":true,"onDelete":"CASCADE"}},"operationId":{"type":"foreignKey","required":true,"related":"Operation","_meta":{"required":true,"onDelete":"RESTRICT"}},"sequence":{"type":"integer","required":true,"default":1,"_meta":{"required":true}},"estimatedMinutes":{"type":"decimal","required":false,"_meta":{}},"notes":{"type":"text","required":false,"default":""}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_routing_steps","conflictColumns":["bom_id","sequence","tenant_id"],"api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"RoutingStep","collectionExportName":"RoutingStepCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"foreignKey"},{"field":"operationId","rule":"required","fieldType":"foreignKey"},{"field":"sequence","rule":"required","fieldType":"integer"}],"schema":{"tableName":"manufacturing_routing_steps","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_routing_steps\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" UUID NOT NULL,\\n \\"operation_id\\" UUID NOT NULL,\\n \\"sequence\\" INTEGER NOT NULL DEFAULT 1,\\n \\"estimated_minutes\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"sequence":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"estimated_minutes":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_routing_steps_bom_id_sequence_idx","columns":["bom_id","sequence","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_routing_steps_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_routing_steps_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_routing_steps_operation_id_idx","columns":["operation_id"]}],"version":"41ac3c66"},"importPath":"@happyvertical/smrt-manufacturing"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-inventory","@happyvertical/smrt-products","@happyvertical/smrt-tenancy"],"stampsConstructors":true}`));
21
+ ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-manufacturing","packageVersion":"0.54.4","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"},"extends":"SmrtCollection","extendsTypeArg":"BillOfMaterials","exportName":"BillOfMaterialsCollection","collectionExportName":"BillOfMaterialsCollectionCollection","schema":{"tableName":"manufacturing_boms","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_boms\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"product_id\\" TEXT NOT NULL DEFAULT '',\\n \\"version\\" INTEGER NOT NULL DEFAULT 1,\\n \\"effective_date\\" TIMESTAMP,\\n \\"status\\" TEXT NOT NULL DEFAULT 'draft',\\n \\"notes\\" TEXT DEFAULT '',\\n \\"currency\\" TEXT DEFAULT 'USD'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"product_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"version":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"effective_date":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"draft"},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""},"currency":{"type":"TEXT","notNull":false,"unique":false,"default":"USD"}},"indexes":[{"name":"manufacturing_boms_product_id_version_idx","columns":["product_id","version","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_boms_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_boms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"b2691adc"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BomLineCollection":{"name":"bomlinecollection","className":"BomLineCollection","qualifiedName":"@happyvertical/smrt-manufacturing:BomLineCollection","collection":"bomlines","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/BomLineCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<BomLine[]>","isStatic":false,"isPublic":true},"findByComponent":{"name":"findByComponent","async":true,"parameters":[{"name":"componentSkuId","type":"string","optional":false}],"returnType":"Promise<BomLine[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_bom_lines"},"extends":"SmrtCollection","extendsTypeArg":"BomLine","exportName":"BomLineCollection","collectionExportName":"BomLineCollectionCollection","schema":{"tableName":"manufacturing_bom_lines","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_bom_lines\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" TEXT NOT NULL DEFAULT '',\\n \\"component_sku_id\\" TEXT NOT NULL DEFAULT '',\\n \\"qty_per_unit\\" REAL,\\n \\"uom\\" TEXT DEFAULT 'each',\\n \\"waste_percent\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"component_sku_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"qty_per_unit":{"type":"REAL","notNull":false,"unique":false},"uom":{"type":"TEXT","notNull":false,"unique":false,"default":"each"},"waste_percent":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_bom_lines_bom_id_component_sku_id_idx","columns":["bom_id","component_sku_id","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_bom_lines_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_bom_lines_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"cfbae7e8"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:OperationCollection":{"name":"operationcollection","className":"OperationCollection","qualifiedName":"@happyvertical/smrt-manufacturing:OperationCollection","collection":"operations","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/OperationCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByCode":{"name":"findByCode","async":true,"parameters":[{"name":"code","type":"string","optional":false}],"returnType":"Promise<Operation | null>","isStatic":false,"isPublic":true},"listOperations":{"name":"listOperations","async":true,"parameters":[{"name":"options","type":"object","optional":true,"memberTypes":["boolean"]}],"returnType":"Promise<Operation[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_operations"},"extends":"SmrtCollection","extendsTypeArg":"Operation","exportName":"OperationCollection","collectionExportName":"OperationCollectionCollection","schema":{"tableName":"manufacturing_operations","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_operations\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"code\\" TEXT NOT NULL DEFAULT '',\\n \\"name\\" TEXT NOT NULL DEFAULT '',\\n \\"category\\" TEXT DEFAULT '',\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"required_qualification_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"code":{"type":"TEXT","notNull":true,"unique":false,"default":""},"name":{"type":"TEXT","notNull":true,"unique":false,"default":""},"category":{"type":"TEXT","notNull":false,"unique":false,"default":""},"is_active":{"type":"BOOLEAN","notNull":false,"unique":false,"default":true},"required_qualification_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_operations_code_tenant_id_idx","columns":["code","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_operations_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_operations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_operations_required_qualification_id_idx","columns":["required_qualification_id"]}],"version":"0b3134d6"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCollection":{"name":"productionruncollection","className":"ProductionRunCollection","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCollection","collection":"productionruns","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/ProductionRunCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<ProductionRun[]>","isStatic":false,"isPublic":true},"findByStatus":{"name":"findByStatus","async":true,"parameters":[{"name":"status","type":"ProductionRunStatus","optional":false}],"returnType":"Promise<ProductionRun[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_runs"},"extends":"SmrtCollection","extendsTypeArg":"ProductionRun","exportName":"ProductionRunCollection","collectionExportName":"ProductionRunCollectionCollection","schema":{"tableName":"manufacturing_production_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_runs\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" UUID NOT NULL,\\n \\"target_qty\\" REAL,\\n \\"completed_qty\\" REAL,\\n \\"status\\" TEXT NOT NULL DEFAULT 'planned'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"target_qty":{"type":"REAL","notNull":false,"unique":false},"completed_qty":{"type":"REAL","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"planned"}},"indexes":[{"name":"manufacturing_production_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_runs_bom_id_idx","columns":["bom_id"]}],"version":"2ca8147d"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCompletionCollection":{"name":"productionruncompletioncollection","className":"ProductionRunCompletionCollection","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCompletionCollection","collection":"productionruncompletions","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/ProductionRunCompletionCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByRun":{"name":"findByRun","async":true,"parameters":[{"name":"runId","type":"string","optional":false}],"returnType":"Promise<ProductionRunCompletion[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_run_completions"},"extends":"SmrtCollection","extendsTypeArg":"ProductionRunCompletion","exportName":"ProductionRunCompletionCollection","collectionExportName":"ProductionRunCompletionCollectionCollection","schema":{"tableName":"manufacturing_production_run_completions","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_run_completions\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"run_id\\" UUID NOT NULL,\\n \\"qty\\" REAL,\\n \\"completed_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"run_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_production_runs","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"qty":{"type":"REAL","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_production_run_completions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_run_completions_tenant_ea7a0d0125_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_run_completions_run_id_idx","columns":["run_id"]}],"version":"c940de6c"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:RoutingStepCollection":{"name":"routingstepcollection","className":"RoutingStepCollection","qualifiedName":"@happyvertical/smrt-manufacturing:RoutingStepCollection","collection":"routingsteps","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/RoutingStepCollection.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{},"methods":{"findByBom":{"name":"findByBom","async":true,"parameters":[{"name":"bomId","type":"string","optional":false}],"returnType":"Promise<RoutingStep[]>","isStatic":false,"isPublic":true},"findByOperation":{"name":"findByOperation","async":true,"parameters":[{"name":"operationId","type":"string","optional":false}],"returnType":"Promise<RoutingStep[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_routing_steps"},"extends":"SmrtCollection","extendsTypeArg":"RoutingStep","exportName":"RoutingStepCollection","collectionExportName":"RoutingStepCollectionCollection","schema":{"tableName":"manufacturing_routing_steps","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_routing_steps\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" UUID NOT NULL,\\n \\"operation_id\\" UUID NOT NULL,\\n \\"sequence\\" INTEGER NOT NULL DEFAULT 1,\\n \\"estimated_minutes\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"sequence":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"estimated_minutes":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_routing_steps_bom_id_sequence_idx","columns":["bom_id","sequence","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_routing_steps_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_routing_steps_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_routing_steps_operation_id_idx","columns":["operation_id"]}],"version":"41ac3c66"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:Assembly":{"name":"assembly","className":"Assembly","qualifiedName":"@happyvertical/smrt-manufacturing:Assembly","collection":"products","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Assembly.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"generated":true,"source":"tenantScoped_decorator","sqlType":"UUID","__tenancy":{"isTenantIdField":true,"mode":"optional","field":"tenantId","autoFilter":true,"autoPopulate":true,"allowSuperAdminBypass":false}}},"productType":{"type":"json","required":false},"name":{"type":"text","required":false},"description":{"type":"text","required":false},"category":{"type":"text","required":false},"manufacturer":{"type":"text","required":false},"model":{"type":"text","required":false},"price":{"type":"integer","required":true,"default":0},"inStock":{"type":"boolean","required":true,"default":true},"specifications":{"type":"json","required":false,"default":{}},"tags":{"type":"json","required":false,"default":[]},"estimatedLabourMinutes":{"type":"integer","required":false,"default":0},"defaultOperationId":{"type":"foreignKey","required":false,"related":"Operation","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"partReference":{"type":"text","required":false,"default":""}},"methods":{"getSpecification":{"name":"getSpecification","async":true,"parameters":[{"name":"key","type":"string","optional":false}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true},"updateSpecification":{"name":"updateSpecification","async":true,"parameters":[{"name":"key","type":"string","optional":false},{"name":"value","type":"unknown","optional":false}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"getAssets":{"name":"getAssets","async":true,"parameters":[{"name":"relationship","type":"string","optional":true}],"returnType":"Promise<Asset[]>","isStatic":false,"isPublic":true},"addAsset":{"name":"addAsset","async":true,"parameters":[{"name":"asset","type":"Asset","optional":false},{"name":"relationship","type":"any","optional":true,"default":"attachment"},{"name":"sortOrder","type":"any","optional":true}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"removeAsset":{"name":"removeAsset","async":true,"parameters":[{"name":"assetId","type":"string","optional":false},{"name":"relationship","type":"string","optional":true}],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"},"tableName":"products","tableStrategy":"sti"},"extends":"Product","exportName":"Assembly","collectionExportName":"AssemblyCollection","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 \\"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},"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_operation_id_idx","columns":["default_operation_id"]}],"version":"f2f2bf95"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BillOfMaterials":{"name":"billofmaterials","className":"BillOfMaterials","qualifiedName":"@happyvertical/smrt-manufacturing:BillOfMaterials","collection":"billofmaterialses","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BillOfMaterials.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"productId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"version":{"type":"integer","required":true,"default":1,"_meta":{"required":true}},"effectiveDate":{"type":"datetime","required":false},"status":{"type":"text","required":true,"default":"draft","_meta":{"required":true}},"notes":{"type":"text","required":false,"default":""},"currency":{"type":"text","required":false,"default":"USD"}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_boms","conflictColumns":["product_id","version","tenant_id"],"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":true,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"BillOfMaterials","collectionExportName":"BillOfMaterialsCollection","validationRules":[{"field":"productId","rule":"required","fieldType":"text"},{"field":"version","rule":"required","fieldType":"integer"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_boms","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_boms\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"product_id\\" TEXT NOT NULL DEFAULT '',\\n \\"version\\" INTEGER NOT NULL DEFAULT 1,\\n \\"effective_date\\" TIMESTAMP,\\n \\"status\\" TEXT NOT NULL DEFAULT 'draft',\\n \\"notes\\" TEXT DEFAULT '',\\n \\"currency\\" TEXT DEFAULT 'USD'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"product_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"version":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"effective_date":{"type":"TIMESTAMP","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"draft"},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""},"currency":{"type":"TEXT","notNull":false,"unique":false,"default":"USD"}},"indexes":[{"name":"manufacturing_boms_product_id_version_idx","columns":["product_id","version","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_boms_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_boms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"b2691adc"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:BomLine":{"name":"bomline","className":"BomLine","qualifiedName":"@happyvertical/smrt-manufacturing:BomLine","collection":"bomlines","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BomLine.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"bomId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"componentSkuId":{"type":"text","required":true,"default":"","_meta":{"required":true}},"qtyPerUnit":{"type":"decimal","required":false,"_meta":{}},"uom":{"type":"text","required":false,"default":"each"},"wastePercent":{"type":"decimal","required":false,"_meta":{}},"notes":{"type":"text","required":false,"default":""}},"methods":{"effectiveQtyPerUnit":{"name":"effectiveQtyPerUnit","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_bom_lines","conflictColumns":["bom_id","component_sku_id","tenant_id"],"api":{"include":["list","get","create","update"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"BomLine","collectionExportName":"BomLineCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"text"},{"field":"componentSkuId","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_bom_lines","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_bom_lines\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" TEXT NOT NULL DEFAULT '',\\n \\"component_sku_id\\" TEXT NOT NULL DEFAULT '',\\n \\"qty_per_unit\\" REAL,\\n \\"uom\\" TEXT DEFAULT 'each',\\n \\"waste_percent\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"component_sku_id":{"type":"TEXT","notNull":true,"unique":false,"default":""},"qty_per_unit":{"type":"REAL","notNull":false,"unique":false},"uom":{"type":"TEXT","notNull":false,"unique":false,"default":"each"},"waste_percent":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_bom_lines_bom_id_component_sku_id_idx","columns":["bom_id","component_sku_id","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_bom_lines_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_bom_lines_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"cfbae7e8"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:Operation":{"name":"operation","className":"Operation","qualifiedName":"@happyvertical/smrt-manufacturing:Operation","collection":"operations","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Operation.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"code":{"type":"text","required":true,"default":"","_meta":{"required":true}},"name":{"type":"text","required":true,"default":"","_meta":{"required":true}},"category":{"type":"text","required":false,"default":""},"isActive":{"type":"boolean","required":false,"default":true},"requiredQualificationId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-human-resources:Qualification","_meta":{"nullable":true}}},"methods":{"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_operations","conflictColumns":["code","tenant_id"],"api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"Operation","collectionExportName":"OperationCollection","validationRules":[{"field":"code","rule":"required","fieldType":"text"},{"field":"name","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_operations","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_operations\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"code\\" TEXT NOT NULL DEFAULT '',\\n \\"name\\" TEXT NOT NULL DEFAULT '',\\n \\"category\\" TEXT DEFAULT '',\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"required_qualification_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"code":{"type":"TEXT","notNull":true,"unique":false,"default":""},"name":{"type":"TEXT","notNull":true,"unique":false,"default":""},"category":{"type":"TEXT","notNull":false,"unique":false,"default":""},"is_active":{"type":"BOOLEAN","notNull":false,"unique":false,"default":true},"required_qualification_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_operations_code_tenant_id_idx","columns":["code","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_operations_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_operations_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_operations_required_qualification_id_idx","columns":["required_qualification_id"]}],"version":"0b3134d6"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRun":{"name":"productionrun","className":"ProductionRun","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRun","collection":"productionruns","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/ProductionRun.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"bomId":{"type":"foreignKey","required":true,"related":"BillOfMaterials","_meta":{"required":true,"onDelete":"RESTRICT"}},"targetQty":{"type":"decimal","required":false,"_meta":{}},"completedQty":{"type":"decimal","required":false,"_meta":{}},"status":{"type":"text","required":true,"default":"planned","_meta":{"required":true}}},"methods":{"remainingQty":{"name":"remainingQty","async":false,"parameters":[],"returnType":"number","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"manufacturing_production_runs","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"ProductionRun","collectionExportName":"ProductionRunCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"foreignKey"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"manufacturing_production_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_runs\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" UUID NOT NULL,\\n \\"target_qty\\" REAL,\\n \\"completed_qty\\" REAL,\\n \\"status\\" TEXT NOT NULL DEFAULT 'planned'\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"target_qty":{"type":"REAL","notNull":false,"unique":false},"completed_qty":{"type":"REAL","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false,"default":"planned"}},"indexes":[{"name":"manufacturing_production_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_runs_bom_id_idx","columns":["bom_id"]}],"version":"2ca8147d"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:ProductionRunCompletion":{"name":"productionruncompletion","className":"ProductionRunCompletion","qualifiedName":"@happyvertical/smrt-manufacturing:ProductionRunCompletion","collection":"productionruncompletions","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/ProductionRunCompletion.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"runId":{"type":"foreignKey","required":true,"related":"ProductionRun","_meta":{"required":true,"onDelete":"CASCADE"}},"qty":{"type":"decimal","required":false,"_meta":{}},"completedAt":{"type":"datetime","required":false}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_production_run_completions","api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"ProductionRunCompletion","collectionExportName":"ProductionRunCompletionCollection","validationRules":[{"field":"runId","rule":"required","fieldType":"foreignKey"}],"schema":{"tableName":"manufacturing_production_run_completions","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_production_run_completions\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"run_id\\" UUID NOT NULL,\\n \\"qty\\" REAL,\\n \\"completed_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"run_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_production_runs","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"qty":{"type":"REAL","notNull":false,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"manufacturing_production_run_completions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_production_run_completions_tenant_ea7a0d0125_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_production_run_completions_run_id_idx","columns":["run_id"]}],"version":"c940de6c"},"importPath":"@happyvertical/smrt-manufacturing"},"@happyvertical/smrt-manufacturing:RoutingStep":{"name":"routingstep","className":"RoutingStep","qualifiedName":"@happyvertical/smrt-manufacturing:RoutingStep","collection":"routingsteps","filePath":"/home/runner/work/smrt/smrt/packages/manufacturing/src/models/RoutingStep.ts","packageName":"@happyvertical/smrt-manufacturing","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"bomId":{"type":"foreignKey","required":true,"related":"BillOfMaterials","_meta":{"required":true,"onDelete":"CASCADE"}},"operationId":{"type":"foreignKey","required":true,"related":"Operation","_meta":{"required":true,"onDelete":"RESTRICT"}},"sequence":{"type":"integer","required":true,"default":1,"_meta":{"required":true}},"estimatedMinutes":{"type":"decimal","required":false,"_meta":{}},"notes":{"type":"text","required":false,"default":""}},"methods":{},"decoratorConfig":{"tableName":"manufacturing_routing_steps","conflictColumns":["bom_id","sequence","tenant_id"],"api":{"include":["list","get"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"RoutingStep","collectionExportName":"RoutingStepCollection","validationRules":[{"field":"bomId","rule":"required","fieldType":"foreignKey"},{"field":"operationId","rule":"required","fieldType":"foreignKey"},{"field":"sequence","rule":"required","fieldType":"integer"}],"schema":{"tableName":"manufacturing_routing_steps","ddl":"CREATE TABLE IF NOT EXISTS \\"manufacturing_routing_steps\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"bom_id\\" UUID NOT NULL,\\n \\"operation_id\\" UUID NOT NULL,\\n \\"sequence\\" INTEGER NOT NULL DEFAULT 1,\\n \\"estimated_minutes\\" REAL,\\n \\"notes\\" TEXT DEFAULT ''\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"bom_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_boms","column":"id","onDelete":"CASCADE","onUpdate":"CASCADE"}},"operation_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"manufacturing_operations","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"sequence":{"type":"INTEGER","notNull":true,"unique":false,"default":1},"estimated_minutes":{"type":"REAL","notNull":false,"unique":false},"notes":{"type":"TEXT","notNull":false,"unique":false,"default":""}},"indexes":[{"name":"manufacturing_routing_steps_bom_id_sequence_idx","columns":["bom_id","sequence","tenant_id"],"unique":true,"nullsNotDistinct":true},{"name":"manufacturing_routing_steps_slug_context_idx","columns":["slug","context"]},{"name":"manufacturing_routing_steps_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"manufacturing_routing_steps_operation_id_idx","columns":["operation_id"]}],"version":"41ac3c66"},"importPath":"@happyvertical/smrt-manufacturing"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-inventory","@happyvertical/smrt-products","@happyvertical/smrt-tenancy"],"stampsConstructors":true}`));
22
22
  //#endregion
23
23
  //#region src/models/Operation.ts
24
24
  var __defProp$6 = Object.defineProperty;