@happyvertical/smrt-manufacturing 0.54.2 → 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,17 +18,24 @@ 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.2\",\"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\"]}"));
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;
25
25
  var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
26
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value
31
+ }) : obj[key] = value;
26
32
  var __decorateClass$6 = (decorators, target, key, kind) => {
27
33
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
28
34
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
29
35
  if (kind && result) __defProp$6(target, key, result);
30
36
  return result;
31
37
  };
38
+ var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
32
39
  var Operation = class extends SmrtObject {
33
40
  tenantId = null;
34
41
  code = "";
@@ -58,6 +65,7 @@ var Operation = class extends SmrtObject {
58
65
  throw new Error(`Operation ${this.code || this.id} cannot be deleted; retire it instead.`);
59
66
  }
60
67
  };
68
+ __publicField$6(Operation, "__smrtPackage__", "@happyvertical/smrt-manufacturing");
61
69
  __decorateClass$6([tenantId({ nullable: true })], Operation.prototype, "tenantId", 2);
62
70
  __decorateClass$6([field({ required: true })], Operation.prototype, "code", 2);
63
71
  __decorateClass$6([field({ required: true })], Operation.prototype, "name", 2);
@@ -73,12 +81,19 @@ Operation = __decorateClass$6([TenantScoped({ mode: "optional" }), smrt({
73
81
  //#region src/models/Assembly.ts
74
82
  var __defProp$5 = Object.defineProperty;
75
83
  var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
84
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {
85
+ enumerable: true,
86
+ configurable: true,
87
+ writable: true,
88
+ value
89
+ }) : obj[key] = value;
76
90
  var __decorateClass$5 = (decorators, target, key, kind) => {
77
91
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
78
92
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
79
93
  if (kind && result) __defProp$5(target, key, result);
80
94
  return result;
81
95
  };
96
+ var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
82
97
  var Assembly = class extends Product {
83
98
  productType = ProductType.ASSEMBLY;
84
99
  estimatedLabourMinutes = 0;
@@ -100,6 +115,7 @@ var Assembly = class extends Product {
100
115
  if (!Number.isSafeInteger(minutes) || minutes < 0) throw ValidationError.invalidValue("estimatedLabourMinutes", minutes, "a whole number of minutes, zero or more");
101
116
  }
102
117
  };
118
+ __publicField$5(Assembly, "__smrtPackage__", "@happyvertical/smrt-manufacturing");
103
119
  __decorateClass$5([field()], Assembly.prototype, "estimatedLabourMinutes", 2);
104
120
  __decorateClass$5([foreignKey(Operation, {
105
121
  nullable: true,
@@ -125,12 +141,19 @@ var AssemblyCollection = class extends ProductCollection {
125
141
  //#region src/models/BillOfMaterials.ts
126
142
  var __defProp$4 = Object.defineProperty;
127
143
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
144
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
145
+ enumerable: true,
146
+ configurable: true,
147
+ writable: true,
148
+ value
149
+ }) : obj[key] = value;
128
150
  var __decorateClass$4 = (decorators, target, key, kind) => {
129
151
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
130
152
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
131
153
  if (kind && result) __defProp$4(target, key, result);
132
154
  return result;
133
155
  };
156
+ var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
134
157
  var BillOfMaterials = class extends SmrtObject {
135
158
  tenantId = null;
136
159
  productId = "";
@@ -177,6 +200,7 @@ var BillOfMaterials = class extends SmrtObject {
177
200
  await (await AssemblyService.create({ db: this.db })).assertBillAcyclic(this);
178
201
  }
179
202
  };
203
+ __publicField$4(BillOfMaterials, "__smrtPackage__", "@happyvertical/smrt-manufacturing");
180
204
  __decorateClass$4([tenantId({ nullable: true })], BillOfMaterials.prototype, "tenantId", 2);
181
205
  __decorateClass$4([field({ required: true })], BillOfMaterials.prototype, "productId", 2);
182
206
  __decorateClass$4([field({ required: true })], BillOfMaterials.prototype, "version", 2);
@@ -243,12 +267,19 @@ var BillOfMaterialsCollection = class extends SmrtCollection {
243
267
  //#region src/models/BomLine.ts
244
268
  var __defProp$3 = Object.defineProperty;
245
269
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
270
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
271
+ enumerable: true,
272
+ configurable: true,
273
+ writable: true,
274
+ value
275
+ }) : obj[key] = value;
246
276
  var __decorateClass$3 = (decorators, target, key, kind) => {
247
277
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
248
278
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
249
279
  if (kind && result) __defProp$3(target, key, result);
250
280
  return result;
251
281
  };
282
+ var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
252
283
  var BomLine = class extends SmrtObject {
253
284
  tenantId = null;
254
285
  bomId = "";
@@ -299,6 +330,7 @@ var BomLine = class extends SmrtObject {
299
330
  await (await AssemblyService.create({ db: this.db })).assertLineAcyclic(this);
300
331
  }
301
332
  };
333
+ __publicField$3(BomLine, "__smrtPackage__", "@happyvertical/smrt-manufacturing");
302
334
  __decorateClass$3([tenantId({ nullable: true })], BomLine.prototype, "tenantId", 2);
303
335
  __decorateClass$3([field({ required: true })], BomLine.prototype, "bomId", 2);
304
336
  __decorateClass$3([field({ required: true })], BomLine.prototype, "componentSkuId", 2);
@@ -387,12 +419,19 @@ function fromMillionths(millionths) {
387
419
  //#region src/models/ProductionRun.ts
388
420
  var __defProp$2 = Object.defineProperty;
389
421
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
422
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
423
+ enumerable: true,
424
+ configurable: true,
425
+ writable: true,
426
+ value
427
+ }) : obj[key] = value;
390
428
  var __decorateClass$2 = (decorators, target, key, kind) => {
391
429
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
392
430
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
393
431
  if (kind && result) __defProp$2(target, key, result);
394
432
  return result;
395
433
  };
434
+ var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
396
435
  var PRODUCTION_RUN_STATUSES = [
397
436
  "planned",
398
437
  "in_progress",
@@ -430,6 +469,7 @@ var ProductionRun = class extends SmrtObject {
430
469
  if (!Number.isFinite(completed) || completed < 0) throw new ValidationError("A production run cannot have a negative completed quantity.", "MANUFACTURING_PRODUCTION_RUN_INVALID", { field: "completedQty" });
431
470
  }
432
471
  };
472
+ __publicField$2(ProductionRun, "__smrtPackage__", "@happyvertical/smrt-manufacturing");
433
473
  __decorateClass$2([tenantId({ nullable: true })], ProductionRun.prototype, "tenantId", 2);
434
474
  __decorateClass$2([foreignKey(BillOfMaterials, {
435
475
  required: true,
@@ -467,12 +507,19 @@ var ProductionRunCollection = class extends SmrtCollection {
467
507
  //#region src/models/ProductionRunCompletion.ts
468
508
  var __defProp$1 = Object.defineProperty;
469
509
  var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
510
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
511
+ enumerable: true,
512
+ configurable: true,
513
+ writable: true,
514
+ value
515
+ }) : obj[key] = value;
470
516
  var __decorateClass$1 = (decorators, target, key, kind) => {
471
517
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
472
518
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
473
519
  if (kind && result) __defProp$1(target, key, result);
474
520
  return result;
475
521
  };
522
+ var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
476
523
  var ProductionRunCompletion = class extends SmrtObject {
477
524
  tenantId = null;
478
525
  runId = "";
@@ -493,6 +540,7 @@ var ProductionRunCompletion = class extends SmrtObject {
493
540
  if (!Number.isFinite(qty) || qty <= 0) throw new ValidationError("A completion needs a quantity greater than zero.", "MANUFACTURING_PRODUCTION_RUN_INVALID", { field: "qty" });
494
541
  }
495
542
  };
543
+ __publicField$1(ProductionRunCompletion, "__smrtPackage__", "@happyvertical/smrt-manufacturing");
496
544
  __decorateClass$1([tenantId({ nullable: true })], ProductionRunCompletion.prototype, "tenantId", 2);
497
545
  __decorateClass$1([foreignKey(ProductionRun, {
498
546
  required: true,
@@ -521,12 +569,19 @@ var ProductionRunCompletionCollection = class extends SmrtCollection {
521
569
  //#region src/models/RoutingStep.ts
522
570
  var __defProp = Object.defineProperty;
523
571
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
572
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
573
+ enumerable: true,
574
+ configurable: true,
575
+ writable: true,
576
+ value
577
+ }) : obj[key] = value;
524
578
  var __decorateClass = (decorators, target, key, kind) => {
525
579
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
526
580
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
527
581
  if (kind && result) __defProp(target, key, result);
528
582
  return result;
529
583
  };
584
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
530
585
  var RoutingStep = class extends SmrtObject {
531
586
  tenantId = null;
532
587
  bomId = "";
@@ -545,6 +600,7 @@ var RoutingStep = class extends SmrtObject {
545
600
  if (options.notes !== void 0) this.notes = options.notes;
546
601
  }
547
602
  };
603
+ __publicField(RoutingStep, "__smrtPackage__", "@happyvertical/smrt-manufacturing");
548
604
  __decorateClass([tenantId({ nullable: true })], RoutingStep.prototype, "tenantId", 2);
549
605
  __decorateClass([foreignKey(BillOfMaterials, {
550
606
  required: true,