@happyvertical/smrt-manufacturing 0.53.4 → 0.53.5
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 +45 -6
- package/README.md +161 -3
- package/dist/collections/AssemblyCollection.d.ts +15 -0
- package/dist/collections/AssemblyCollection.d.ts.map +1 -0
- package/dist/collections/OperationCollection.d.ts +20 -0
- package/dist/collections/OperationCollection.d.ts.map +1 -0
- package/dist/collections/RoutingStepCollection.d.ts +15 -0
- package/dist/collections/RoutingStepCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +3 -0
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +756 -29
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1248 -128
- package/dist/models/Assembly.d.ts +62 -0
- package/dist/models/Assembly.d.ts.map +1 -0
- package/dist/models/BillOfMaterials.d.ts +12 -4
- package/dist/models/BillOfMaterials.d.ts.map +1 -1
- package/dist/models/BomLine.d.ts +11 -5
- package/dist/models/BomLine.d.ts.map +1 -1
- package/dist/models/Operation.d.ts +59 -0
- package/dist/models/Operation.d.ts.map +1 -0
- package/dist/models/RoutingStep.d.ts +46 -0
- package/dist/models/RoutingStep.d.ts.map +1 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/operation-types.d.ts +99 -0
- package/dist/operation-types.d.ts.map +1 -0
- package/dist/services/AssemblyService.d.ts +217 -0
- package/dist/services/AssemblyService.d.ts.map +1 -0
- package/dist/services/BomService.d.ts +25 -1
- package/dist/services/BomService.d.ts.map +1 -1
- package/dist/services/OperationService.d.ts +48 -0
- package/dist/services/OperationService.d.ts.map +1 -0
- package/dist/services/RoutingService.d.ts +50 -0
- package/dist/services/RoutingService.d.ts.map +1 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +1138 -81
- package/dist/svelte/components/AssemblyForm.svelte +69 -0
- package/dist/svelte/components/AssemblyForm.svelte.d.ts +38 -0
- package/dist/svelte/components/AssemblyForm.svelte.d.ts.map +1 -0
- package/dist/svelte/components/AssemblyList.svelte +229 -0
- package/dist/svelte/components/AssemblyList.svelte.d.ts +28 -0
- package/dist/svelte/components/AssemblyList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/BomEditor.svelte +575 -0
- package/dist/svelte/components/BomEditor.svelte.d.ts +29 -0
- package/dist/svelte/components/BomEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/BomStructureTree.svelte +164 -0
- package/dist/svelte/components/BomStructureTree.svelte.d.ts +16 -0
- package/dist/svelte/components/BomStructureTree.svelte.d.ts.map +1 -0
- package/dist/svelte/components/OperationForm.svelte +258 -0
- package/dist/svelte/components/OperationForm.svelte.d.ts +17 -0
- package/dist/svelte/components/OperationForm.svelte.d.ts.map +1 -0
- package/dist/svelte/components/OperationList.svelte +170 -0
- package/dist/svelte/components/OperationList.svelte.d.ts +17 -0
- package/dist/svelte/components/OperationList.svelte.d.ts.map +1 -0
- package/dist/svelte/i18n.d.ts +87 -0
- package/dist/svelte/i18n.d.ts.map +1 -0
- package/dist/svelte/i18n.js +87 -0
- package/dist/svelte/index.d.ts +28 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +29 -0
- package/dist/svelte/types.d.ts +170 -0
- package/dist/svelte/types.d.ts.map +1 -0
- package/dist/svelte/types.js +126 -0
- package/dist/ui.d.ts +17 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +72 -0
- package/dist/ui.js.map +1 -0
- package/package.json +39 -10
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,35 +3,49 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-manufacturing",
|
|
6
|
-
"packageVersion": "0.53.
|
|
6
|
+
"packageVersion": "0.53.5",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
12
|
-
"agents": "
|
|
10
|
+
"manifest": "c759bf5fb3f31d0d65da9b204e8d57a5b3c33210858c469d56b9835bccd551c2",
|
|
11
|
+
"packageJson": "e8b753814d42f7be3144fc1e6af8cbf038a00049e73a370dac674326e4396d24",
|
|
12
|
+
"agents": "8570930d07b32c59b20d9f4e69e5579395e6b8d2382b7303e17c36ba2e598097"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
15
15
|
".",
|
|
16
16
|
"./manifest",
|
|
17
|
-
"./manifest.json"
|
|
17
|
+
"./manifest.json",
|
|
18
|
+
"./svelte",
|
|
19
|
+
"./ui"
|
|
18
20
|
],
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"@happyvertical/logger": "catalog:",
|
|
21
23
|
"@happyvertical/smrt-core": "workspace:*",
|
|
24
|
+
"@happyvertical/smrt-fields": "workspace:*",
|
|
22
25
|
"@happyvertical/smrt-inventory": "workspace:*",
|
|
26
|
+
"@happyvertical/smrt-products": "workspace:*",
|
|
23
27
|
"@happyvertical/smrt-tenancy": "workspace:*",
|
|
28
|
+
"@happyvertical/smrt-types": "workspace:*",
|
|
29
|
+
"@happyvertical/smrt-ui": "workspace:*",
|
|
24
30
|
"@happyvertical/sql": "catalog:",
|
|
25
31
|
"@happyvertical/smrt-vitest": "workspace:*",
|
|
32
|
+
"@sveltejs/package": "^2.5.8",
|
|
33
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
26
34
|
"@types/node": "24.13.6",
|
|
35
|
+
"svelte": "^5.57.0",
|
|
36
|
+
"svelte-check": "^4.7.6",
|
|
27
37
|
"typescript": "6.0.3",
|
|
28
38
|
"vite": "8.1.4",
|
|
29
39
|
"vitest": "4.1.10"
|
|
30
40
|
},
|
|
31
41
|
"smrtDependencies": [
|
|
32
42
|
"@happyvertical/smrt-core",
|
|
43
|
+
"@happyvertical/smrt-fields",
|
|
33
44
|
"@happyvertical/smrt-inventory",
|
|
45
|
+
"@happyvertical/smrt-products",
|
|
34
46
|
"@happyvertical/smrt-tenancy",
|
|
47
|
+
"@happyvertical/smrt-types",
|
|
48
|
+
"@happyvertical/smrt-ui",
|
|
35
49
|
"@happyvertical/smrt-vitest"
|
|
36
50
|
],
|
|
37
51
|
"sdkDependencies": [
|
|
@@ -39,6 +53,7 @@
|
|
|
39
53
|
"@happyvertical/sql"
|
|
40
54
|
],
|
|
41
55
|
"tags": [
|
|
56
|
+
"assembly",
|
|
42
57
|
"bill-of-materials",
|
|
43
58
|
"bom",
|
|
44
59
|
"cost-rollup",
|
|
@@ -48,7 +63,9 @@
|
|
|
48
63
|
"smrt"
|
|
49
64
|
],
|
|
50
65
|
"risks": [
|
|
51
|
-
"
|
|
66
|
+
"cross-package-refs:1",
|
|
67
|
+
"sensitive-fields-excluded",
|
|
68
|
+
"sti-inheritance"
|
|
52
69
|
],
|
|
53
70
|
"objects": [
|
|
54
71
|
{
|
|
@@ -238,6 +255,494 @@
|
|
|
238
255
|
"tags": [],
|
|
239
256
|
"risks": []
|
|
240
257
|
},
|
|
258
|
+
{
|
|
259
|
+
"name": "OperationCollection",
|
|
260
|
+
"qualifiedName": "@happyvertical/smrt-manufacturing:OperationCollection",
|
|
261
|
+
"collection": "operations",
|
|
262
|
+
"tableName": "manufacturing_operations",
|
|
263
|
+
"packageName": "@happyvertical/smrt-manufacturing",
|
|
264
|
+
"extends": "SmrtCollection",
|
|
265
|
+
"fields": [],
|
|
266
|
+
"relationships": [],
|
|
267
|
+
"methods": [
|
|
268
|
+
"findByCode",
|
|
269
|
+
"listOperations"
|
|
270
|
+
],
|
|
271
|
+
"methodSignatures": [
|
|
272
|
+
{
|
|
273
|
+
"name": "findByCode",
|
|
274
|
+
"async": true,
|
|
275
|
+
"params": [
|
|
276
|
+
"code: string"
|
|
277
|
+
],
|
|
278
|
+
"returns": "Promise<Operation | null>"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"name": "listOperations",
|
|
282
|
+
"async": true,
|
|
283
|
+
"params": [
|
|
284
|
+
"options?: object"
|
|
285
|
+
],
|
|
286
|
+
"returns": "Promise<Operation[]>"
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
"surfaces": [
|
|
290
|
+
{
|
|
291
|
+
"kind": "api",
|
|
292
|
+
"name": "operations.findByCode",
|
|
293
|
+
"operation": "findByCode",
|
|
294
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection",
|
|
295
|
+
"path": "/operations/findByCode",
|
|
296
|
+
"method": "POST"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"kind": "api",
|
|
300
|
+
"name": "operations.listOperations",
|
|
301
|
+
"operation": "listOperations",
|
|
302
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection",
|
|
303
|
+
"path": "/operations/listOperations",
|
|
304
|
+
"method": "POST"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"kind": "cli",
|
|
308
|
+
"name": "operationcollection_findByCode",
|
|
309
|
+
"operation": "findByCode",
|
|
310
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"kind": "cli",
|
|
314
|
+
"name": "operationcollection_listOperations",
|
|
315
|
+
"operation": "listOperations",
|
|
316
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"kind": "mcp",
|
|
320
|
+
"name": "operationcollection_findbycode",
|
|
321
|
+
"operation": "findByCode",
|
|
322
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"kind": "mcp",
|
|
326
|
+
"name": "operationcollection_listoperations",
|
|
327
|
+
"operation": "listOperations",
|
|
328
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection"
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
"relationshipFeatures": [
|
|
332
|
+
"uuidColumns"
|
|
333
|
+
],
|
|
334
|
+
"tags": [],
|
|
335
|
+
"risks": []
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "RoutingStepCollection",
|
|
339
|
+
"qualifiedName": "@happyvertical/smrt-manufacturing:RoutingStepCollection",
|
|
340
|
+
"collection": "routingsteps",
|
|
341
|
+
"tableName": "manufacturing_routing_steps",
|
|
342
|
+
"packageName": "@happyvertical/smrt-manufacturing",
|
|
343
|
+
"extends": "SmrtCollection",
|
|
344
|
+
"fields": [],
|
|
345
|
+
"relationships": [],
|
|
346
|
+
"methods": [
|
|
347
|
+
"findByBom",
|
|
348
|
+
"findByOperation"
|
|
349
|
+
],
|
|
350
|
+
"methodSignatures": [
|
|
351
|
+
{
|
|
352
|
+
"name": "findByBom",
|
|
353
|
+
"async": true,
|
|
354
|
+
"params": [
|
|
355
|
+
"bomId: string"
|
|
356
|
+
],
|
|
357
|
+
"returns": "Promise<RoutingStep[]>"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"name": "findByOperation",
|
|
361
|
+
"async": true,
|
|
362
|
+
"params": [
|
|
363
|
+
"operationId: string"
|
|
364
|
+
],
|
|
365
|
+
"returns": "Promise<RoutingStep[]>"
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"surfaces": [
|
|
369
|
+
{
|
|
370
|
+
"kind": "api",
|
|
371
|
+
"name": "routingsteps.findByBom",
|
|
372
|
+
"operation": "findByBom",
|
|
373
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection",
|
|
374
|
+
"path": "/routingsteps/findByBom",
|
|
375
|
+
"method": "POST"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"kind": "api",
|
|
379
|
+
"name": "routingsteps.findByOperation",
|
|
380
|
+
"operation": "findByOperation",
|
|
381
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection",
|
|
382
|
+
"path": "/routingsteps/findByOperation",
|
|
383
|
+
"method": "POST"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"kind": "cli",
|
|
387
|
+
"name": "routingstepcollection_findByBom",
|
|
388
|
+
"operation": "findByBom",
|
|
389
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"kind": "cli",
|
|
393
|
+
"name": "routingstepcollection_findByOperation",
|
|
394
|
+
"operation": "findByOperation",
|
|
395
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"kind": "mcp",
|
|
399
|
+
"name": "routingstepcollection_findbybom",
|
|
400
|
+
"operation": "findByBom",
|
|
401
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"kind": "mcp",
|
|
405
|
+
"name": "routingstepcollection_findbyoperation",
|
|
406
|
+
"operation": "findByOperation",
|
|
407
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection"
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
"relationshipFeatures": [
|
|
411
|
+
"uuidColumns"
|
|
412
|
+
],
|
|
413
|
+
"tags": [],
|
|
414
|
+
"risks": []
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"name": "Assembly",
|
|
418
|
+
"qualifiedName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
419
|
+
"collection": "products",
|
|
420
|
+
"tableName": "products",
|
|
421
|
+
"packageName": "@happyvertical/smrt-manufacturing",
|
|
422
|
+
"extends": "Product",
|
|
423
|
+
"fields": [
|
|
424
|
+
{
|
|
425
|
+
"name": "created_at",
|
|
426
|
+
"type": "datetime",
|
|
427
|
+
"required": false,
|
|
428
|
+
"columnType": "TIMESTAMP"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"name": "updated_at",
|
|
432
|
+
"type": "datetime",
|
|
433
|
+
"required": false,
|
|
434
|
+
"columnType": "TIMESTAMP"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"name": "tenantId",
|
|
438
|
+
"type": "text",
|
|
439
|
+
"required": false,
|
|
440
|
+
"columnType": "UUID"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"name": "productType",
|
|
444
|
+
"type": "json",
|
|
445
|
+
"required": false,
|
|
446
|
+
"columnType": "TEXT"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"name": "name",
|
|
450
|
+
"type": "text",
|
|
451
|
+
"required": false,
|
|
452
|
+
"columnType": "TEXT"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "description",
|
|
456
|
+
"type": "text",
|
|
457
|
+
"required": false,
|
|
458
|
+
"columnType": "TEXT"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"name": "category",
|
|
462
|
+
"type": "text",
|
|
463
|
+
"required": false,
|
|
464
|
+
"columnType": "TEXT"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"name": "manufacturer",
|
|
468
|
+
"type": "text",
|
|
469
|
+
"required": false,
|
|
470
|
+
"columnType": "TEXT"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "model",
|
|
474
|
+
"type": "text",
|
|
475
|
+
"required": false,
|
|
476
|
+
"columnType": "TEXT"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "price",
|
|
480
|
+
"type": "integer",
|
|
481
|
+
"required": true,
|
|
482
|
+
"columnType": "INTEGER",
|
|
483
|
+
"default": 0
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "inStock",
|
|
487
|
+
"type": "boolean",
|
|
488
|
+
"required": true,
|
|
489
|
+
"columnType": "BOOLEAN",
|
|
490
|
+
"default": true
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "specifications",
|
|
494
|
+
"type": "json",
|
|
495
|
+
"required": false,
|
|
496
|
+
"columnType": "JSON",
|
|
497
|
+
"default": {}
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "tags",
|
|
501
|
+
"type": "json",
|
|
502
|
+
"required": false,
|
|
503
|
+
"columnType": "JSON",
|
|
504
|
+
"default": []
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "estimatedLabourMinutes",
|
|
508
|
+
"type": "integer",
|
|
509
|
+
"required": false,
|
|
510
|
+
"columnType": "INTEGER",
|
|
511
|
+
"default": 0
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "defaultOperationId",
|
|
515
|
+
"type": "foreignKey",
|
|
516
|
+
"required": false,
|
|
517
|
+
"related": "Operation",
|
|
518
|
+
"columnType": "UUID"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "partReference",
|
|
522
|
+
"type": "text",
|
|
523
|
+
"required": false,
|
|
524
|
+
"columnType": "TEXT",
|
|
525
|
+
"default": ""
|
|
526
|
+
}
|
|
527
|
+
],
|
|
528
|
+
"relationships": [
|
|
529
|
+
{
|
|
530
|
+
"name": "defaultOperationId",
|
|
531
|
+
"type": "foreignKey",
|
|
532
|
+
"required": false,
|
|
533
|
+
"related": "Operation",
|
|
534
|
+
"columnType": "UUID"
|
|
535
|
+
}
|
|
536
|
+
],
|
|
537
|
+
"methods": [
|
|
538
|
+
"addAsset",
|
|
539
|
+
"getAssets",
|
|
540
|
+
"getSpecification",
|
|
541
|
+
"removeAsset",
|
|
542
|
+
"updateSpecification"
|
|
543
|
+
],
|
|
544
|
+
"methodSignatures": [
|
|
545
|
+
{
|
|
546
|
+
"name": "addAsset",
|
|
547
|
+
"async": true,
|
|
548
|
+
"params": [
|
|
549
|
+
"asset: Asset",
|
|
550
|
+
"relationship?: any",
|
|
551
|
+
"sortOrder?: any"
|
|
552
|
+
],
|
|
553
|
+
"returns": "Promise<void>"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"name": "getAssets",
|
|
557
|
+
"async": true,
|
|
558
|
+
"params": [
|
|
559
|
+
"relationship?: string"
|
|
560
|
+
],
|
|
561
|
+
"returns": "Promise<Asset[]>"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"name": "getSpecification",
|
|
565
|
+
"async": true,
|
|
566
|
+
"params": [
|
|
567
|
+
"key: string"
|
|
568
|
+
],
|
|
569
|
+
"returns": "Promise<unknown>"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"name": "removeAsset",
|
|
573
|
+
"async": true,
|
|
574
|
+
"params": [
|
|
575
|
+
"assetId: string",
|
|
576
|
+
"relationship?: string"
|
|
577
|
+
],
|
|
578
|
+
"returns": "Promise<void>"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"name": "updateSpecification",
|
|
582
|
+
"async": true,
|
|
583
|
+
"params": [
|
|
584
|
+
"key: string",
|
|
585
|
+
"value: unknown"
|
|
586
|
+
],
|
|
587
|
+
"returns": "Promise<void>"
|
|
588
|
+
}
|
|
589
|
+
],
|
|
590
|
+
"tenant": {
|
|
591
|
+
"scoped": true,
|
|
592
|
+
"mode": "optional",
|
|
593
|
+
"field": "tenantId"
|
|
594
|
+
},
|
|
595
|
+
"tableStrategy": "sti",
|
|
596
|
+
"surfaces": [
|
|
597
|
+
{
|
|
598
|
+
"kind": "api",
|
|
599
|
+
"name": "products.list",
|
|
600
|
+
"operation": "list",
|
|
601
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
602
|
+
"path": "/products",
|
|
603
|
+
"method": "GET"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"kind": "api",
|
|
607
|
+
"name": "products.get",
|
|
608
|
+
"operation": "get",
|
|
609
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
610
|
+
"path": "/products/[id]",
|
|
611
|
+
"method": "GET"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"kind": "api",
|
|
615
|
+
"name": "products.create",
|
|
616
|
+
"operation": "create",
|
|
617
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
618
|
+
"path": "/products",
|
|
619
|
+
"method": "POST"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"kind": "api",
|
|
623
|
+
"name": "products.update",
|
|
624
|
+
"operation": "update",
|
|
625
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
626
|
+
"path": "/products/[id]",
|
|
627
|
+
"method": "PATCH"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"kind": "cli",
|
|
631
|
+
"name": "assembly_list",
|
|
632
|
+
"operation": "list",
|
|
633
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"kind": "cli",
|
|
637
|
+
"name": "assembly_get",
|
|
638
|
+
"operation": "get",
|
|
639
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"kind": "cli",
|
|
643
|
+
"name": "assembly_create",
|
|
644
|
+
"operation": "create",
|
|
645
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"kind": "cli",
|
|
649
|
+
"name": "assembly_update",
|
|
650
|
+
"operation": "update",
|
|
651
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"kind": "cli",
|
|
655
|
+
"name": "assembly_delete",
|
|
656
|
+
"operation": "delete",
|
|
657
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"kind": "cli",
|
|
661
|
+
"name": "assembly_getSpecification",
|
|
662
|
+
"operation": "getSpecification",
|
|
663
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"kind": "cli",
|
|
667
|
+
"name": "assembly_updateSpecification",
|
|
668
|
+
"operation": "updateSpecification",
|
|
669
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"kind": "cli",
|
|
673
|
+
"name": "assembly_getAssets",
|
|
674
|
+
"operation": "getAssets",
|
|
675
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"kind": "cli",
|
|
679
|
+
"name": "assembly_addAsset",
|
|
680
|
+
"operation": "addAsset",
|
|
681
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"kind": "cli",
|
|
685
|
+
"name": "assembly_removeAsset",
|
|
686
|
+
"operation": "removeAsset",
|
|
687
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"kind": "mcp",
|
|
691
|
+
"name": "assembly_list",
|
|
692
|
+
"operation": "list",
|
|
693
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"kind": "mcp",
|
|
697
|
+
"name": "assembly_get",
|
|
698
|
+
"operation": "get",
|
|
699
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
700
|
+
}
|
|
701
|
+
],
|
|
702
|
+
"withheldSurfaces": [
|
|
703
|
+
{
|
|
704
|
+
"kind": "api",
|
|
705
|
+
"operation": "addAsset",
|
|
706
|
+
"code": "not-included",
|
|
707
|
+
"reason": "not listed in api.include",
|
|
708
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"kind": "api",
|
|
712
|
+
"operation": "getAssets",
|
|
713
|
+
"code": "not-included",
|
|
714
|
+
"reason": "not listed in api.include",
|
|
715
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"kind": "api",
|
|
719
|
+
"operation": "getSpecification",
|
|
720
|
+
"code": "not-included",
|
|
721
|
+
"reason": "not listed in api.include",
|
|
722
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"kind": "api",
|
|
726
|
+
"operation": "removeAsset",
|
|
727
|
+
"code": "not-included",
|
|
728
|
+
"reason": "not listed in api.include",
|
|
729
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"kind": "api",
|
|
733
|
+
"operation": "updateSpecification",
|
|
734
|
+
"code": "not-included",
|
|
735
|
+
"reason": "not listed in api.include",
|
|
736
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
737
|
+
}
|
|
738
|
+
],
|
|
739
|
+
"relationshipFeatures": [
|
|
740
|
+
"foreignKey",
|
|
741
|
+
"uuidColumns"
|
|
742
|
+
],
|
|
743
|
+
"tags": [],
|
|
744
|
+
"risks": []
|
|
745
|
+
},
|
|
241
746
|
{
|
|
242
747
|
"name": "BillOfMaterials",
|
|
243
748
|
"qualifiedName": "@happyvertical/smrt-manufacturing:BillOfMaterials",
|
|
@@ -413,24 +918,317 @@
|
|
|
413
918
|
"name": "componentSkuId",
|
|
414
919
|
"type": "text",
|
|
415
920
|
"required": true,
|
|
416
|
-
"columnType": "TEXT",
|
|
417
|
-
"default": ""
|
|
921
|
+
"columnType": "TEXT",
|
|
922
|
+
"default": ""
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
"name": "qtyPerUnit",
|
|
926
|
+
"type": "decimal",
|
|
927
|
+
"required": false,
|
|
928
|
+
"columnType": "REAL"
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
"name": "uom",
|
|
932
|
+
"type": "text",
|
|
933
|
+
"required": false,
|
|
934
|
+
"columnType": "TEXT",
|
|
935
|
+
"default": "each"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"name": "wastePercent",
|
|
939
|
+
"type": "decimal",
|
|
940
|
+
"required": false,
|
|
941
|
+
"columnType": "REAL"
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
"name": "notes",
|
|
945
|
+
"type": "text",
|
|
946
|
+
"required": false,
|
|
947
|
+
"columnType": "TEXT",
|
|
948
|
+
"default": ""
|
|
949
|
+
}
|
|
950
|
+
],
|
|
951
|
+
"relationships": [],
|
|
952
|
+
"methods": [
|
|
953
|
+
"effectiveQtyPerUnit"
|
|
954
|
+
],
|
|
955
|
+
"methodSignatures": [
|
|
956
|
+
{
|
|
957
|
+
"name": "effectiveQtyPerUnit",
|
|
958
|
+
"returns": "number"
|
|
959
|
+
}
|
|
960
|
+
],
|
|
961
|
+
"tenant": {
|
|
962
|
+
"scoped": true,
|
|
963
|
+
"mode": "optional",
|
|
964
|
+
"field": "tenantId"
|
|
965
|
+
},
|
|
966
|
+
"conflictColumns": [
|
|
967
|
+
"bom_id",
|
|
968
|
+
"component_sku_id",
|
|
969
|
+
"tenant_id"
|
|
970
|
+
],
|
|
971
|
+
"surfaces": [
|
|
972
|
+
{
|
|
973
|
+
"kind": "api",
|
|
974
|
+
"name": "bomlines.list",
|
|
975
|
+
"operation": "list",
|
|
976
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine",
|
|
977
|
+
"path": "/bomlines",
|
|
978
|
+
"method": "GET"
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
"kind": "api",
|
|
982
|
+
"name": "bomlines.get",
|
|
983
|
+
"operation": "get",
|
|
984
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine",
|
|
985
|
+
"path": "/bomlines/[id]",
|
|
986
|
+
"method": "GET"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
"kind": "api",
|
|
990
|
+
"name": "bomlines.create",
|
|
991
|
+
"operation": "create",
|
|
992
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine",
|
|
993
|
+
"path": "/bomlines",
|
|
994
|
+
"method": "POST"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"kind": "api",
|
|
998
|
+
"name": "bomlines.update",
|
|
999
|
+
"operation": "update",
|
|
1000
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine",
|
|
1001
|
+
"path": "/bomlines/[id]",
|
|
1002
|
+
"method": "PATCH"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
"kind": "cli",
|
|
1006
|
+
"name": "bomline_list",
|
|
1007
|
+
"operation": "list",
|
|
1008
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
"kind": "cli",
|
|
1012
|
+
"name": "bomline_get",
|
|
1013
|
+
"operation": "get",
|
|
1014
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
"kind": "cli",
|
|
1018
|
+
"name": "bomline_create",
|
|
1019
|
+
"operation": "create",
|
|
1020
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
"kind": "cli",
|
|
1024
|
+
"name": "bomline_update",
|
|
1025
|
+
"operation": "update",
|
|
1026
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
"kind": "cli",
|
|
1030
|
+
"name": "bomline_delete",
|
|
1031
|
+
"operation": "delete",
|
|
1032
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
"kind": "cli",
|
|
1036
|
+
"name": "bomline_effectiveQtyPerUnit",
|
|
1037
|
+
"operation": "effectiveQtyPerUnit",
|
|
1038
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
"kind": "mcp",
|
|
1042
|
+
"name": "bomline_list",
|
|
1043
|
+
"operation": "list",
|
|
1044
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
"kind": "mcp",
|
|
1048
|
+
"name": "bomline_get",
|
|
1049
|
+
"operation": "get",
|
|
1050
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1051
|
+
}
|
|
1052
|
+
],
|
|
1053
|
+
"withheldSurfaces": [
|
|
1054
|
+
{
|
|
1055
|
+
"kind": "api",
|
|
1056
|
+
"operation": "effectiveQtyPerUnit",
|
|
1057
|
+
"code": "not-included",
|
|
1058
|
+
"reason": "not listed in api.include",
|
|
1059
|
+
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1060
|
+
}
|
|
1061
|
+
],
|
|
1062
|
+
"relationshipFeatures": [
|
|
1063
|
+
"uuidColumns"
|
|
1064
|
+
],
|
|
1065
|
+
"tags": [],
|
|
1066
|
+
"risks": []
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
"name": "Operation",
|
|
1070
|
+
"qualifiedName": "@happyvertical/smrt-manufacturing:Operation",
|
|
1071
|
+
"collection": "operations",
|
|
1072
|
+
"tableName": "manufacturing_operations",
|
|
1073
|
+
"packageName": "@happyvertical/smrt-manufacturing",
|
|
1074
|
+
"extends": "SmrtObject",
|
|
1075
|
+
"fields": [
|
|
1076
|
+
{
|
|
1077
|
+
"name": "tenantId",
|
|
1078
|
+
"type": "text",
|
|
1079
|
+
"required": false,
|
|
1080
|
+
"columnType": "UUID"
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"name": "code",
|
|
1084
|
+
"type": "text",
|
|
1085
|
+
"required": true,
|
|
1086
|
+
"columnType": "TEXT",
|
|
1087
|
+
"default": ""
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
"name": "name",
|
|
1091
|
+
"type": "text",
|
|
1092
|
+
"required": true,
|
|
1093
|
+
"columnType": "TEXT",
|
|
1094
|
+
"default": ""
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
"name": "category",
|
|
1098
|
+
"type": "text",
|
|
1099
|
+
"required": false,
|
|
1100
|
+
"columnType": "TEXT",
|
|
1101
|
+
"default": ""
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"name": "isActive",
|
|
1105
|
+
"type": "boolean",
|
|
1106
|
+
"required": false,
|
|
1107
|
+
"columnType": "BOOLEAN",
|
|
1108
|
+
"default": true
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
"name": "requiredQualificationId",
|
|
1112
|
+
"type": "crossPackageRef",
|
|
1113
|
+
"required": false,
|
|
1114
|
+
"related": "@happyvertical/smrt-human-resources:Qualification",
|
|
1115
|
+
"columnType": "UUID"
|
|
1116
|
+
}
|
|
1117
|
+
],
|
|
1118
|
+
"relationships": [
|
|
1119
|
+
{
|
|
1120
|
+
"name": "requiredQualificationId",
|
|
1121
|
+
"type": "crossPackageRef",
|
|
1122
|
+
"required": false,
|
|
1123
|
+
"related": "@happyvertical/smrt-human-resources:Qualification",
|
|
1124
|
+
"columnType": "UUID"
|
|
1125
|
+
}
|
|
1126
|
+
],
|
|
1127
|
+
"methods": [
|
|
1128
|
+
"delete"
|
|
1129
|
+
],
|
|
1130
|
+
"methodSignatures": [
|
|
1131
|
+
{
|
|
1132
|
+
"name": "delete",
|
|
1133
|
+
"async": true,
|
|
1134
|
+
"returns": "Promise<void>"
|
|
1135
|
+
}
|
|
1136
|
+
],
|
|
1137
|
+
"tenant": {
|
|
1138
|
+
"scoped": true,
|
|
1139
|
+
"mode": "optional",
|
|
1140
|
+
"field": "tenantId"
|
|
1141
|
+
},
|
|
1142
|
+
"conflictColumns": [
|
|
1143
|
+
"code",
|
|
1144
|
+
"tenant_id"
|
|
1145
|
+
],
|
|
1146
|
+
"surfaces": [
|
|
1147
|
+
{
|
|
1148
|
+
"kind": "api",
|
|
1149
|
+
"name": "operations.list",
|
|
1150
|
+
"operation": "list",
|
|
1151
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation",
|
|
1152
|
+
"path": "/operations",
|
|
1153
|
+
"method": "GET"
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
"kind": "api",
|
|
1157
|
+
"name": "operations.get",
|
|
1158
|
+
"operation": "get",
|
|
1159
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation",
|
|
1160
|
+
"path": "/operations/[id]",
|
|
1161
|
+
"method": "GET"
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
"kind": "cli",
|
|
1165
|
+
"name": "operation_list",
|
|
1166
|
+
"operation": "list",
|
|
1167
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation"
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
"kind": "cli",
|
|
1171
|
+
"name": "operation_get",
|
|
1172
|
+
"operation": "get",
|
|
1173
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation"
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"kind": "mcp",
|
|
1177
|
+
"name": "operation_list",
|
|
1178
|
+
"operation": "list",
|
|
1179
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation"
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
"kind": "mcp",
|
|
1183
|
+
"name": "operation_get",
|
|
1184
|
+
"operation": "get",
|
|
1185
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation"
|
|
1186
|
+
}
|
|
1187
|
+
],
|
|
1188
|
+
"relationshipFeatures": [
|
|
1189
|
+
"crossPackageRef",
|
|
1190
|
+
"uuidColumns"
|
|
1191
|
+
],
|
|
1192
|
+
"tags": [],
|
|
1193
|
+
"risks": []
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
"name": "RoutingStep",
|
|
1197
|
+
"qualifiedName": "@happyvertical/smrt-manufacturing:RoutingStep",
|
|
1198
|
+
"collection": "routingsteps",
|
|
1199
|
+
"tableName": "manufacturing_routing_steps",
|
|
1200
|
+
"packageName": "@happyvertical/smrt-manufacturing",
|
|
1201
|
+
"extends": "SmrtObject",
|
|
1202
|
+
"fields": [
|
|
1203
|
+
{
|
|
1204
|
+
"name": "tenantId",
|
|
1205
|
+
"type": "text",
|
|
1206
|
+
"required": false,
|
|
1207
|
+
"columnType": "UUID"
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
"name": "bomId",
|
|
1211
|
+
"type": "foreignKey",
|
|
1212
|
+
"required": true,
|
|
1213
|
+
"related": "BillOfMaterials",
|
|
1214
|
+
"columnType": "UUID"
|
|
418
1215
|
},
|
|
419
1216
|
{
|
|
420
|
-
"name": "
|
|
421
|
-
"type": "
|
|
422
|
-
"required":
|
|
423
|
-
"
|
|
1217
|
+
"name": "operationId",
|
|
1218
|
+
"type": "foreignKey",
|
|
1219
|
+
"required": true,
|
|
1220
|
+
"related": "Operation",
|
|
1221
|
+
"columnType": "UUID"
|
|
424
1222
|
},
|
|
425
1223
|
{
|
|
426
|
-
"name": "
|
|
427
|
-
"type": "
|
|
428
|
-
"required":
|
|
429
|
-
"columnType": "
|
|
430
|
-
"default":
|
|
1224
|
+
"name": "sequence",
|
|
1225
|
+
"type": "integer",
|
|
1226
|
+
"required": true,
|
|
1227
|
+
"columnType": "INTEGER",
|
|
1228
|
+
"default": 1
|
|
431
1229
|
},
|
|
432
1230
|
{
|
|
433
|
-
"name": "
|
|
1231
|
+
"name": "estimatedMinutes",
|
|
434
1232
|
"type": "decimal",
|
|
435
1233
|
"required": false,
|
|
436
1234
|
"columnType": "REAL"
|
|
@@ -443,16 +1241,23 @@
|
|
|
443
1241
|
"default": ""
|
|
444
1242
|
}
|
|
445
1243
|
],
|
|
446
|
-
"relationships": [
|
|
447
|
-
"methods": [
|
|
448
|
-
"effectiveQtyPerUnit"
|
|
449
|
-
],
|
|
450
|
-
"methodSignatures": [
|
|
1244
|
+
"relationships": [
|
|
451
1245
|
{
|
|
452
|
-
"name": "
|
|
453
|
-
"
|
|
1246
|
+
"name": "bomId",
|
|
1247
|
+
"type": "foreignKey",
|
|
1248
|
+
"required": true,
|
|
1249
|
+
"related": "BillOfMaterials",
|
|
1250
|
+
"columnType": "UUID"
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
"name": "operationId",
|
|
1254
|
+
"type": "foreignKey",
|
|
1255
|
+
"required": true,
|
|
1256
|
+
"related": "Operation",
|
|
1257
|
+
"columnType": "UUID"
|
|
454
1258
|
}
|
|
455
1259
|
],
|
|
1260
|
+
"methods": [],
|
|
456
1261
|
"tenant": {
|
|
457
1262
|
"scoped": true,
|
|
458
1263
|
"mode": "optional",
|
|
@@ -460,101 +1265,71 @@
|
|
|
460
1265
|
},
|
|
461
1266
|
"conflictColumns": [
|
|
462
1267
|
"bom_id",
|
|
463
|
-
"
|
|
1268
|
+
"sequence",
|
|
464
1269
|
"tenant_id"
|
|
465
1270
|
],
|
|
466
1271
|
"surfaces": [
|
|
467
1272
|
{
|
|
468
1273
|
"kind": "api",
|
|
469
|
-
"name": "
|
|
1274
|
+
"name": "routingsteps.list",
|
|
470
1275
|
"operation": "list",
|
|
471
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
472
|
-
"path": "/
|
|
1276
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep",
|
|
1277
|
+
"path": "/routingsteps",
|
|
473
1278
|
"method": "GET"
|
|
474
1279
|
},
|
|
475
1280
|
{
|
|
476
1281
|
"kind": "api",
|
|
477
|
-
"name": "
|
|
1282
|
+
"name": "routingsteps.get",
|
|
478
1283
|
"operation": "get",
|
|
479
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
480
|
-
"path": "/
|
|
1284
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep",
|
|
1285
|
+
"path": "/routingsteps/[id]",
|
|
481
1286
|
"method": "GET"
|
|
482
1287
|
},
|
|
483
|
-
{
|
|
484
|
-
"kind": "api",
|
|
485
|
-
"name": "bomlines.create",
|
|
486
|
-
"operation": "create",
|
|
487
|
-
"objectName": "@happyvertical/smrt-manufacturing:BomLine",
|
|
488
|
-
"path": "/bomlines",
|
|
489
|
-
"method": "POST"
|
|
490
|
-
},
|
|
491
|
-
{
|
|
492
|
-
"kind": "api",
|
|
493
|
-
"name": "bomlines.update",
|
|
494
|
-
"operation": "update",
|
|
495
|
-
"objectName": "@happyvertical/smrt-manufacturing:BomLine",
|
|
496
|
-
"path": "/bomlines/[id]",
|
|
497
|
-
"method": "PATCH"
|
|
498
|
-
},
|
|
499
1288
|
{
|
|
500
1289
|
"kind": "cli",
|
|
501
|
-
"name": "
|
|
1290
|
+
"name": "routingstep_list",
|
|
502
1291
|
"operation": "list",
|
|
503
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
1292
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
504
1293
|
},
|
|
505
1294
|
{
|
|
506
1295
|
"kind": "cli",
|
|
507
|
-
"name": "
|
|
1296
|
+
"name": "routingstep_get",
|
|
508
1297
|
"operation": "get",
|
|
509
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
1298
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
510
1299
|
},
|
|
511
1300
|
{
|
|
512
1301
|
"kind": "cli",
|
|
513
|
-
"name": "
|
|
1302
|
+
"name": "routingstep_create",
|
|
514
1303
|
"operation": "create",
|
|
515
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
1304
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
516
1305
|
},
|
|
517
1306
|
{
|
|
518
1307
|
"kind": "cli",
|
|
519
|
-
"name": "
|
|
1308
|
+
"name": "routingstep_update",
|
|
520
1309
|
"operation": "update",
|
|
521
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
1310
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
522
1311
|
},
|
|
523
1312
|
{
|
|
524
1313
|
"kind": "cli",
|
|
525
|
-
"name": "
|
|
1314
|
+
"name": "routingstep_delete",
|
|
526
1315
|
"operation": "delete",
|
|
527
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
"kind": "cli",
|
|
531
|
-
"name": "bomline_effectiveQtyPerUnit",
|
|
532
|
-
"operation": "effectiveQtyPerUnit",
|
|
533
|
-
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1316
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
534
1317
|
},
|
|
535
1318
|
{
|
|
536
1319
|
"kind": "mcp",
|
|
537
|
-
"name": "
|
|
1320
|
+
"name": "routingstep_list",
|
|
538
1321
|
"operation": "list",
|
|
539
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
1322
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
540
1323
|
},
|
|
541
1324
|
{
|
|
542
1325
|
"kind": "mcp",
|
|
543
|
-
"name": "
|
|
1326
|
+
"name": "routingstep_get",
|
|
544
1327
|
"operation": "get",
|
|
545
|
-
"objectName": "@happyvertical/smrt-manufacturing:
|
|
546
|
-
}
|
|
547
|
-
],
|
|
548
|
-
"withheldSurfaces": [
|
|
549
|
-
{
|
|
550
|
-
"kind": "api",
|
|
551
|
-
"operation": "effectiveQtyPerUnit",
|
|
552
|
-
"code": "not-included",
|
|
553
|
-
"reason": "not listed in api.include",
|
|
554
|
-
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1328
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
555
1329
|
}
|
|
556
1330
|
],
|
|
557
1331
|
"relationshipFeatures": [
|
|
1332
|
+
"foreignKey",
|
|
558
1333
|
"uuidColumns"
|
|
559
1334
|
],
|
|
560
1335
|
"tags": [],
|
|
@@ -662,6 +1437,190 @@
|
|
|
662
1437
|
"operation": "findByComponent",
|
|
663
1438
|
"objectName": "@happyvertical/smrt-manufacturing:BomLineCollection"
|
|
664
1439
|
},
|
|
1440
|
+
{
|
|
1441
|
+
"kind": "api",
|
|
1442
|
+
"name": "operations.findByCode",
|
|
1443
|
+
"operation": "findByCode",
|
|
1444
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection",
|
|
1445
|
+
"path": "/operations/findByCode",
|
|
1446
|
+
"method": "POST"
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
"kind": "api",
|
|
1450
|
+
"name": "operations.listOperations",
|
|
1451
|
+
"operation": "listOperations",
|
|
1452
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection",
|
|
1453
|
+
"path": "/operations/listOperations",
|
|
1454
|
+
"method": "POST"
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
"kind": "cli",
|
|
1458
|
+
"name": "operationcollection_findByCode",
|
|
1459
|
+
"operation": "findByCode",
|
|
1460
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection"
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"kind": "cli",
|
|
1464
|
+
"name": "operationcollection_listOperations",
|
|
1465
|
+
"operation": "listOperations",
|
|
1466
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection"
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
"kind": "mcp",
|
|
1470
|
+
"name": "operationcollection_findbycode",
|
|
1471
|
+
"operation": "findByCode",
|
|
1472
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection"
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
"kind": "mcp",
|
|
1476
|
+
"name": "operationcollection_listoperations",
|
|
1477
|
+
"operation": "listOperations",
|
|
1478
|
+
"objectName": "@happyvertical/smrt-manufacturing:OperationCollection"
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"kind": "api",
|
|
1482
|
+
"name": "routingsteps.findByBom",
|
|
1483
|
+
"operation": "findByBom",
|
|
1484
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection",
|
|
1485
|
+
"path": "/routingsteps/findByBom",
|
|
1486
|
+
"method": "POST"
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
"kind": "api",
|
|
1490
|
+
"name": "routingsteps.findByOperation",
|
|
1491
|
+
"operation": "findByOperation",
|
|
1492
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection",
|
|
1493
|
+
"path": "/routingsteps/findByOperation",
|
|
1494
|
+
"method": "POST"
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
"kind": "cli",
|
|
1498
|
+
"name": "routingstepcollection_findByBom",
|
|
1499
|
+
"operation": "findByBom",
|
|
1500
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection"
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
"kind": "cli",
|
|
1504
|
+
"name": "routingstepcollection_findByOperation",
|
|
1505
|
+
"operation": "findByOperation",
|
|
1506
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection"
|
|
1507
|
+
},
|
|
1508
|
+
{
|
|
1509
|
+
"kind": "mcp",
|
|
1510
|
+
"name": "routingstepcollection_findbybom",
|
|
1511
|
+
"operation": "findByBom",
|
|
1512
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection"
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
"kind": "mcp",
|
|
1516
|
+
"name": "routingstepcollection_findbyoperation",
|
|
1517
|
+
"operation": "findByOperation",
|
|
1518
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStepCollection"
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
"kind": "api",
|
|
1522
|
+
"name": "products.list",
|
|
1523
|
+
"operation": "list",
|
|
1524
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
1525
|
+
"path": "/products",
|
|
1526
|
+
"method": "GET"
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
"kind": "api",
|
|
1530
|
+
"name": "products.get",
|
|
1531
|
+
"operation": "get",
|
|
1532
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
1533
|
+
"path": "/products/[id]",
|
|
1534
|
+
"method": "GET"
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
"kind": "api",
|
|
1538
|
+
"name": "products.create",
|
|
1539
|
+
"operation": "create",
|
|
1540
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
1541
|
+
"path": "/products",
|
|
1542
|
+
"method": "POST"
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
"kind": "api",
|
|
1546
|
+
"name": "products.update",
|
|
1547
|
+
"operation": "update",
|
|
1548
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly",
|
|
1549
|
+
"path": "/products/[id]",
|
|
1550
|
+
"method": "PATCH"
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
"kind": "cli",
|
|
1554
|
+
"name": "assembly_list",
|
|
1555
|
+
"operation": "list",
|
|
1556
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1557
|
+
},
|
|
1558
|
+
{
|
|
1559
|
+
"kind": "cli",
|
|
1560
|
+
"name": "assembly_get",
|
|
1561
|
+
"operation": "get",
|
|
1562
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
"kind": "cli",
|
|
1566
|
+
"name": "assembly_create",
|
|
1567
|
+
"operation": "create",
|
|
1568
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
"kind": "cli",
|
|
1572
|
+
"name": "assembly_update",
|
|
1573
|
+
"operation": "update",
|
|
1574
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
"kind": "cli",
|
|
1578
|
+
"name": "assembly_delete",
|
|
1579
|
+
"operation": "delete",
|
|
1580
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1581
|
+
},
|
|
1582
|
+
{
|
|
1583
|
+
"kind": "cli",
|
|
1584
|
+
"name": "assembly_getSpecification",
|
|
1585
|
+
"operation": "getSpecification",
|
|
1586
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
"kind": "cli",
|
|
1590
|
+
"name": "assembly_updateSpecification",
|
|
1591
|
+
"operation": "updateSpecification",
|
|
1592
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
"kind": "cli",
|
|
1596
|
+
"name": "assembly_getAssets",
|
|
1597
|
+
"operation": "getAssets",
|
|
1598
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1599
|
+
},
|
|
1600
|
+
{
|
|
1601
|
+
"kind": "cli",
|
|
1602
|
+
"name": "assembly_addAsset",
|
|
1603
|
+
"operation": "addAsset",
|
|
1604
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"kind": "cli",
|
|
1608
|
+
"name": "assembly_removeAsset",
|
|
1609
|
+
"operation": "removeAsset",
|
|
1610
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
"kind": "mcp",
|
|
1614
|
+
"name": "assembly_list",
|
|
1615
|
+
"operation": "list",
|
|
1616
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
"kind": "mcp",
|
|
1620
|
+
"name": "assembly_get",
|
|
1621
|
+
"operation": "get",
|
|
1622
|
+
"objectName": "@happyvertical/smrt-manufacturing:Assembly"
|
|
1623
|
+
},
|
|
665
1624
|
{
|
|
666
1625
|
"kind": "api",
|
|
667
1626
|
"name": "billofmaterialses.list",
|
|
@@ -815,16 +1774,114 @@
|
|
|
815
1774
|
"name": "bomline_get",
|
|
816
1775
|
"operation": "get",
|
|
817
1776
|
"objectName": "@happyvertical/smrt-manufacturing:BomLine"
|
|
1777
|
+
},
|
|
1778
|
+
{
|
|
1779
|
+
"kind": "api",
|
|
1780
|
+
"name": "operations.list",
|
|
1781
|
+
"operation": "list",
|
|
1782
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation",
|
|
1783
|
+
"path": "/operations",
|
|
1784
|
+
"method": "GET"
|
|
1785
|
+
},
|
|
1786
|
+
{
|
|
1787
|
+
"kind": "api",
|
|
1788
|
+
"name": "operations.get",
|
|
1789
|
+
"operation": "get",
|
|
1790
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation",
|
|
1791
|
+
"path": "/operations/[id]",
|
|
1792
|
+
"method": "GET"
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
"kind": "cli",
|
|
1796
|
+
"name": "operation_list",
|
|
1797
|
+
"operation": "list",
|
|
1798
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation"
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
"kind": "cli",
|
|
1802
|
+
"name": "operation_get",
|
|
1803
|
+
"operation": "get",
|
|
1804
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation"
|
|
1805
|
+
},
|
|
1806
|
+
{
|
|
1807
|
+
"kind": "mcp",
|
|
1808
|
+
"name": "operation_list",
|
|
1809
|
+
"operation": "list",
|
|
1810
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation"
|
|
1811
|
+
},
|
|
1812
|
+
{
|
|
1813
|
+
"kind": "mcp",
|
|
1814
|
+
"name": "operation_get",
|
|
1815
|
+
"operation": "get",
|
|
1816
|
+
"objectName": "@happyvertical/smrt-manufacturing:Operation"
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
"kind": "api",
|
|
1820
|
+
"name": "routingsteps.list",
|
|
1821
|
+
"operation": "list",
|
|
1822
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep",
|
|
1823
|
+
"path": "/routingsteps",
|
|
1824
|
+
"method": "GET"
|
|
1825
|
+
},
|
|
1826
|
+
{
|
|
1827
|
+
"kind": "api",
|
|
1828
|
+
"name": "routingsteps.get",
|
|
1829
|
+
"operation": "get",
|
|
1830
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep",
|
|
1831
|
+
"path": "/routingsteps/[id]",
|
|
1832
|
+
"method": "GET"
|
|
1833
|
+
},
|
|
1834
|
+
{
|
|
1835
|
+
"kind": "cli",
|
|
1836
|
+
"name": "routingstep_list",
|
|
1837
|
+
"operation": "list",
|
|
1838
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
1839
|
+
},
|
|
1840
|
+
{
|
|
1841
|
+
"kind": "cli",
|
|
1842
|
+
"name": "routingstep_get",
|
|
1843
|
+
"operation": "get",
|
|
1844
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
"kind": "cli",
|
|
1848
|
+
"name": "routingstep_create",
|
|
1849
|
+
"operation": "create",
|
|
1850
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
"kind": "cli",
|
|
1854
|
+
"name": "routingstep_update",
|
|
1855
|
+
"operation": "update",
|
|
1856
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
"kind": "cli",
|
|
1860
|
+
"name": "routingstep_delete",
|
|
1861
|
+
"operation": "delete",
|
|
1862
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
"kind": "mcp",
|
|
1866
|
+
"name": "routingstep_list",
|
|
1867
|
+
"operation": "list",
|
|
1868
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
"kind": "mcp",
|
|
1872
|
+
"name": "routingstep_get",
|
|
1873
|
+
"operation": "get",
|
|
1874
|
+
"objectName": "@happyvertical/smrt-manufacturing:RoutingStep"
|
|
818
1875
|
}
|
|
819
1876
|
],
|
|
820
1877
|
"prompts": [],
|
|
821
1878
|
"relationshipsV2": {
|
|
822
|
-
"foreignKeyFields":
|
|
823
|
-
"crossPackageRefFields":
|
|
1879
|
+
"foreignKeyFields": 3,
|
|
1880
|
+
"crossPackageRefFields": 1,
|
|
824
1881
|
"junctionCollections": 0,
|
|
825
1882
|
"hierarchicalObjects": 0,
|
|
826
1883
|
"polymorphicAssociations": 0,
|
|
827
|
-
"uuidColumns":
|
|
1884
|
+
"uuidColumns": 25
|
|
828
1885
|
},
|
|
829
|
-
"agentDoc": "# @happyvertical/smrt-manufacturing\n\nBills of materials, cost rollup, and production-order operations. Strictly industry-neutral — the same primitives serve apparel, furniture, automotive, CPG, electronics, food production, custom hardware, and any vertical that builds finished goods from a recipe.\n\nSits on top of `@happyvertical/smrt-inventory` (stock) and works alongside the `ProductionOrder` Contract STI subtype already shipped in `@happyvertical/smrt-commerce`.\n\n## Models\n\n| Model | Purpose |\n|---|---|\n| `BillOfMaterials` | Recipe for a finished product. `productId` (plain string) references the upstream `Product` or any STI subtype. Multiple revisions per product via `version` + `status` (`draft` / `active` / `superseded`). `conflictColumns: ['product_id', 'version', 'tenant_id']`. |\n| `BomLine` | One component on a BOM. `bomId` (FK), `componentSkuId` (plain string ref — the `Sku` model lives in `@happyvertical/smrt-products`; inventory tracks stock motion against the id), `qtyPerUnit`, `uom` (open-ended — `yards`, `each`, `grams`, `kg`, ...), `wastePercent`, `notes`. `conflictColumns: ['bom_id', 'component_sku_id', 'tenant_id']`. |\n\nBoth models are `@TenantScoped({ mode: 'optional' })` with a nullable `tenantId` so they can be used either tenant-scoped or globally.\n\n`RoutingStep` (labor cost) is intentionally out of scope for v1 — see issue [#1245](https://github.com/happyvertical/smrt/issues/1245) for the planned follow-up.\n\n## BomService — planning helpers\n\n```typescript\nimport { BomService } from '@happyvertical/smrt-manufacturing';\n\nconst bom = await BomService.create({\n db,\n // Optional. Resolve unit cost for a component SKU.\n // Without this, every line rolls up to $0 and `costUnavailable` is set.\n costResolver: async (componentSkuId) => fetchLatestCost(componentSkuId),\n});\n\nconst rollup = await bom.computeMaterialCost(bomId);\n// { totalCost, currency, lineBreakdown, hasMissingCosts }\n\nconst requirements = await bom.explodeRequirements(bomId, 100);\n// [{ componentSkuId, totalQty, uom }, ...]\n\nconst check = await bom.canProduce(bomId, 100);\n// { ok: true } | { ok: false, shortages: [...] }\n```\n\n| Method | Behavior |\n|---|---|\n| `computeMaterialCost(bomId)` | Walks every BomLine, applies waste (`qtyPerUnit * (1 + wastePercent / 100)`), resolves unit costs via the optional `costResolver`, returns per-line breakdown plus rolled-up total. Lines with no cost set `costUnavailable: true` and contribute `0`. |\n| `explodeRequirements(bomId, qty)` | Returns a \"shopping list\" of materials needed for `qty` units. Duplicates across lines are summed. Does NOT mutate stock. |\n| `canProduce(bomId, qty)` | Calls `explodeRequirements`, then sums `available` stock across every location per component, returns `{ ok: true }` if everything's covered, else `{ ok: false, shortages: [...] }`. |\n\n## ProductionService — consume / produce\n\n```typescript\nimport { ProductionService } from '@happyvertical/smrt-manufacturing';\n\nconst production = await ProductionService.create({ db });\n\n// Drain materials at the factory.\nconst consumed = await production.consumeMaterials(\n { id: order.id, productId: order.productId, bomId: order.bomId },\n { locationId: factory.id, qty: runQty },\n);\n\n// Receive finished goods.\nconst produced = await production.produceFinishedGoods(\n { id: order.id, productId: order.productId },\n { locationId: factory.id, qty: runQty, finishedSkuId: variant.id },\n);\n\n// Or run both in one transaction — see \"Joint atomicity\" below.\nconst { consumed, produced } = await production.runProduction(\n { id: order.id, productId: order.productId, bomId: order.bomId },\n {\n consume: { locationId: factory.id, qty: runQty },\n produce: { locationId: factory.id, qty: runQty, finishedSkuId: variant.id },\n },\n);\n```\n\nAll three methods write through `StockService` and stamp every emitted `StockMovement` with `sourceType: 'ProductionOrder'` + the production order id so audit queries can roll them up later.\n\n### Joint atomicity — `runProduction` vs the two-call form\n\n`consumeMaterials` and `produceFinishedGoods` are each individually atomic, but calling them as two separate awaits is NOT jointly atomic — each opens its own `stockService.withTransaction(...)` scope. If something goes wrong between the two calls (process crash, transient adapter failure on the produce leg), you can land in a state where materials are deducted but no finished SKU receipt balances them. The audit ledger stays consistent within each call; what's missing is the cross-call invariant.\n\nWhen you need that invariant — typically make-to-stock flows where the factory step is invisible to the ledger — use `runProduction(order, { consume, produce })`. Both legs run inside one transaction; any failure (BOM shortage, adapter error, interceptor reject) rolls back both legs together.\n\nWhen NOT to use it: workflows where consume and produce represent a real wall-clock gap that downstream observers need to see (WIP dashboards, partial-run reporting, separate \"materials posted\" and \"production completed\" events on the dispatch bus). There, the two-call form is the right shape — each call is its own ledger event.\n\n### Location convention — explicit-arg design\n\nThe location where materials are consumed and finished goods are received is passed explicitly to `consumeMaterials` / `produceFinishedGoods`, not carried on the production order itself. Rationale:\n\n- The commerce `ProductionOrder` is a `Contract` STI subtype owned by `@happyvertical/smrt-commerce`. Adding an `originLocationId` field there would either need a schema change in commerce (cross-cutting) or a meta field that only manufacturing knows about (leaky).\n- Real shops often pick a location at run time (factory A is congested, route the run through factory B), so even if the order carried a default, the explicit-arg signature is the more flexible canonical form.\n- Callers that want a default can stash a `locationId` on their own production-order helper and pass it through.\n\n### Finished-SKU convention\n\nA `ProductionOrder` references a `productId`, but a `Product` typically has multiple SKUs (one per variant). The caller of `produceFinishedGoods` picks the concrete `finishedSkuId` because the multi-SKU mapping is application-specific (size run, finish mix, kit variant).\n\n## Opt-in DispatchBus hooks\n\nOff by default. Wire them up explicitly in the application's `smrt.ts`:\n\n```typescript\nimport { installManufacturingDispatchHandlers } from '@happyvertical/smrt-manufacturing';\n\nconst handlers = await installManufacturingDispatchHandlers({\n dispatchBus: bus,\n db,\n // Default: subscribe to production_order:posted, call consumeMaterials.\n installProductionPosted: true,\n // Default: don't auto-produce. Set to true if your shop emits a\n // separate production_order:completed event.\n installProductionCompleted: false,\n // Default: don't combine consume + produce on `posted`. Set to true\n // for make-to-stock-instantly workflows where the factory step is\n // invisible. Ignored when installProductionCompleted is true.\n producedOnPosted: false,\n});\n```\n\nThis subscribes to:\n\n- `production_order:posted` → `production.consumeMaterials(...)`; when `producedOnPosted: true` the handler instead calls `production.runProduction(...)` so consume + produce share one transaction. Process crashes or adapter errors between the two legs can never leave materials deducted with no finished-goods receipt.\n- `production_order:completed` → `production.produceFinishedGoods(...)` (opt-in)\n\nThe companion handlers for `contract:created` (reserve) and `fulfillment:shipped` (fulfil) live in `@happyvertical/smrt-inventory` — wire both packages' installers from `smrt.ts` to get the full lifecycle.\n\n## Gotchas\n\n- **`computeMaterialCost` without a resolver returns `$0`.** That is deliberate — manufacturing does not assume any particular cost source. A real wiring will plug in `@happyvertical/smrt-products` `Material.costPerUnit`, or a rolling average from purchase-order history, or a vendor price book. The `costUnavailable` flag tells UIs to surface \"unknown cost\" rather than silently rolling up zeros.\n- **`explodeRequirements` does not call any stock APIs.** It is a planning helper. To check whether the materials are actually on hand, use `canProduce`. To actually deduct them, use `ProductionService.consumeMaterials`.\n- **`canProduce` sums available stock across every location.** The planning question is \"do we have it at all?\". The operational question of \"which warehouse do we pull from?\" is left to the caller of `consumeMaterials`, which targets a single `locationId` per call.\n- **`consumeMaterials` propagates `InsufficientStockError`.** If a line would drive `available` below zero, the underlying `StockService.adjust` throws. Pre-flight with `canProduce` before posting if you want to avoid partial-failure mid-run.\n- **`consumeMaterials` is atomic across BOM lines.** All per-line deductions and their audit rows run inside a single `stockService.withTransaction(...)` scope (powered by `@happyvertical/sql >= 0.74.0`'s native `db.transaction()`). An `InsufficientStockError` on line N+1 rolls back lines 1..N so production-order posting never leaves materials half-consumed. The recommended pre-flight (`BomService.canProduce(orderId, qty)`) is still useful when you'd rather know upfront than discover the shortfall mid-run, but a missed pre-flight no longer corrupts state.\n- **`consumeMaterials` + `produceFinishedGoods` are NOT jointly atomic.** Each opens its own transaction. A failure on the produce leg leaves materials deducted with no finished SKU receipt to balance it. Use `runProduction(order, { consume, produce })` when you need both legs to commit or roll back together.\n- **Cross-package references are plain strings.** `productId`, `componentSkuId`, `bomId` (within this package) — all plain string ids, never `@foreignKey()`. Keeps the dependency graph DAG-shaped and lets each upstream package evolve independently.\n- **`conflictColumns` include `tenant_id`** on both models. NULL-matching semantics are handled by `@happyvertical/sql >= 0.74.0`; two saves with the same `(product_id, version, NULL)` tuple merge in place.\n- **Lazy table creation.** Like everything else in SMRT, the `manufacturing_boms` and `manufacturing_bom_lines` tables are created on first DB op via `syncSchema`. Safe for SSR.\n- **Cross-industry constraint.** This package's vocabulary stays generic. Apparel-specific concepts (`Style`, `Makeup`, `Colorway`, `tech-pack`, fashion `Season`) and their analogues in furniture / automotive / CPG live in the relevant template package, never here. PRs that introduce industry vocabulary should be rejected.\n\n## Source attribution\n\nEvery emitted `StockMovement` carries `sourceType: 'ProductionOrder'` plus `sourceId: order.id` so downstream queries can reconstruct \"what caused this movement\". Reason codes used:\n\n| reasonCode | Emitter | Note |\n|---|---|---|\n| `production_consume` | `ProductionService.consumeMaterials` | One per BOM line per consume call |\n| `production_produce` | `ProductionService.produceFinishedGoods` | One per produce call |\n\nThese join cleanly with the standard inventory reason codes (`receipt`, `reservation`, `release`, `fulfillment`, `transfer_out`, `transfer_in`, `adjustment`) defined in `@happyvertical/smrt-inventory`.\n\n## Dependencies\n\n| Package | Purpose |\n|---|---|\n| `@happyvertical/smrt-core` | SmrtObject / SmrtCollection / DispatchBus |\n| `@happyvertical/smrt-inventory` | StockService, stock levels, movements (the `Sku` model itself lives in `@happyvertical/smrt-products`; inventory tracks stock motion against the id) |\n| `@happyvertical/smrt-tenancy` | Optional tenant scoping |\n| `@happyvertical/sql` | Database adapter |\n"
|
|
1886
|
+
"agentDoc": "# @happyvertical/smrt-manufacturing\n\nBills of materials, operations and routing, cost and labour rollup, and production-order stock movement. Strictly industry-neutral — the same primitives serve apparel, furniture, automotive, CPG, electronics, food production, custom hardware, and any vertical that builds finished goods from a recipe.\n\nSits on top of `@happyvertical/smrt-inventory` (stock) and `@happyvertical/smrt-products` (catalog: `Product`, `Material`, `Sku`), and works alongside the `ProductionOrder` Contract STI subtype already shipped in `@happyvertical/smrt-commerce`.\n\n## Models\n\n| Model | Purpose |\n|---|---|\n| `Assembly` | The product that is **made**, counterpart to `Material`. Cross-package STI subtype of `smrt-products` `Product` (`productType: 'assembly'`, `_meta_type: '@happyvertical/smrt-manufacturing:Assembly'`) in the shared `products` table. Own columns: `estimatedLabourMinutes` (integer, per unit; a save refuses anything but a whole number of minutes of zero or more), `defaultOperationId` (`@foreignKey(Operation)`, nullable, RESTRICT like `RoutingStep.operationId`: the operation work on it is booked to by default), `partReference` (the organization's drawing/part number). Name, price, tags come from `Product`; part number and stock from its `Sku` and inventory; structure from its bill; documents from `ProductAsset`. Exposure matches `Product` (REST list/get/create/update, MCP list/get), as the issue asks: unlike `Operation`, the assembly row has no service-owned invariant that generated writes could bypass. |\n| `BillOfMaterials` | Recipe for a finished product. `productId` (plain string) references the upstream `Product` or any STI subtype. Multiple revisions per product via `version` + `status` (`draft` / `active` / `superseded`). `conflictColumns: ['product_id', 'version', 'tenant_id']`. |\n| `BomLine` | One component on a BOM. `bomId` (FK), `componentSkuId` (plain string ref — the `Sku` model lives in `@happyvertical/smrt-products`; inventory tracks stock motion against the id), `qtyPerUnit`, `uom` (open-ended — `yards`, `each`, `grams`, `kg`, ...), `wastePercent`, `notes`. `conflictColumns: ['bom_id', 'component_sku_id', 'tenant_id']`. |\n| `Operation` | A kind of work (cut, weld, inspect), a managed list per tenant. `code` (unique per tenant; `conflictColumns: ['code', 'tenant_id']`, fixed once defined), `name`, `category`, `isActive` (retire/reinstate; never deleted, `delete()` throws), `requiredQualificationId` (nullable `@crossPackageRef('@happyvertical/smrt-human-resources:Qualification')`: metadata only, no dependency, unvalidated; an application reads it to gate who may start the operation). |\n| `RoutingStep` | One operation in a BOM's optional routing. `bomId` (`@foreignKey(BillOfMaterials)`, CASCADE: a routing belongs to its bill), `operationId` (`@foreignKey(Operation)`, RESTRICT: operations are retired, never deleted), `sequence` (1..n, unique per bom), `estimatedMinutes` (decimal, per produced unit), `notes`. `conflictColumns: ['bom_id', 'sequence', 'tenant_id']`. |\n\nAll models are `@TenantScoped({ mode: 'optional' })` with a nullable `tenantId` so they can be used either tenant-scoped or globally.\n\n## Operations, routing and labour estimate\n\n- `OperationService` maintains the list (`define` rejects a duplicate code, including a retired one's; `rename`, `update`, `retire`, `reinstate`). `RoutingService.replaceRouting(bomId, steps)` swaps a bill's whole routing in one transaction and numbers it 1..n; a retired operation may stay on a routing that has it but cannot be newly added.\n- `BomService.computeLabourEstimate(bomId)` returns minutes and, only when the caller supplies `rateResolver` (hourly rate per `Operation`, mirroring `costResolver`), cost. No resolver means minutes only with `rateUnavailable` on each step. A bill with no routing returns an empty estimate; `computeMaterialCost` is unchanged.\n- `Operation` and `RoutingStep` expose generated list/get only; writes go through the services (generated create/update would upsert on a duplicate code or rename the code). `replaceRouting` saves the bill row inside its transaction (row lock) and retries on a revision conflict, so concurrent replacements serialize.\n- Deliberately absent: a default labour rate class (nothing here would use it; the resolver receives the whole `Operation` and can key on `code`/`category`), setup time, scheduling and work-centre capacity, and time recorded against an operation (that stays in `smrt-timesheets` or the application).\n- `./svelte` exports `OperationList` and `OperationForm` (props-driven; hosts persist through `OperationService`). Messages live in `src/svelte/i18n.ts`; component tests use the shared jsdom harness with axe assertions.\n- Tests: `operations-suite.ts` runs on SQLite (`operations.test.ts`) and PostgreSQL (`operations.optional.test.ts`, `pnpm test:postgres`; each test runs in its own tenant because PostgreSQL test data persists).\n\n## Assemblies — nesting lives in the bill\n\nA sub-assembly is a `BomLine` whose component SKU belongs to an `Assembly`; there is no children list on the model. `AssemblyService` is the one link from a line to what it names:\n\n| Method | Behavior |\n|---|---|\n| `resolveComponent(skuId, { tenantId? })` | `{ kind, sku, product, assembly, activeBom, buildable }`. `kind` is `assembly`, `material` (`Material`), `bought` (any other `Product`), or `missing` (unknown SKU, SKU with no product, or a non-UUID id; never throws). `activeBom` is the assembly's highest active bill, `null` when it has none; `buildable` is `assembly && activeBom`. Multi-level explosion (#3444) recurses on `activeBom` and stops at every other kind. |\n| `isAssembly(skuId)` | `resolveComponent(skuId).kind === 'assembly'`. |\n| `findActiveBom(productId, { tenantId? })` | Highest active bill. With `tenantId` (including `null`), only that tenant's bills count, and `resolveComponent` reports another tenant's SKU, product or bill line as `missing` (global rows stay visible), whatever the tenant context; the cycle walk and `getBillStructure` pass the bill's own tenant, so a shared assembly resolves to the right tenant's bill on writes made without `withTenant()`. |\n| `getBillStructure(bomId)` | One level: the bill plus each line with its resolved component. Throws `BomNotFoundError`. |\n| `findCycle(productId, componentSkuIds)` | The path by which those components would make `productId` contain itself, following sub-assemblies' **active** bills only; `null` when none. |\n| `assertLineAcyclic(line)` / `assertBillAcyclic(bom)` | Throw `BomCycleError` (a `ValidationError`, code `MANUFACTURING_BOM_CYCLE`, `path` from the product back to itself). |\n\n**Cycle refusal runs in the models.** `BomLine.validateBeforeSave` checks every line save (draft bills too, so a loop is refused when written); `BillOfMaterials.validateBeforeSave` checks every save of an `active` bill (activation), including the lines of a stored bill with the same `(productId, version, tenantId)` that the save would upsert onto. The generated REST routes go through `save()`, so they refuse cycles as well. Not covered: re-pointing a `Sku.productId` (owned by `smrt-products`) and two concurrent saves that each close half of a loop.\n\n## Svelte components (`./svelte`)\n\nProps-driven; the host loads and persists. `AssemblyList` (field policy drops hidden columns via `policyToVisibleColumnIds`), `AssemblyForm` (smrt-fields `ObjectForm` for `@happyvertical/smrt-manufacturing:Assembly`, so price and every other field follow the consumer's field policy), `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). Adapters: `toAssemblyView`, `toBomEditorLines`. Strings are under `manufacturing.` in `src/svelte/i18n.ts`; the package is strict for raw primitives, hardcoded strings and JSDoc.\n\n\n## BomService — planning helpers\n\n```typescript\nimport { BomService } from '@happyvertical/smrt-manufacturing';\n\nconst bom = await BomService.create({\n db,\n // Optional. Resolve unit cost for a component SKU.\n // Without this, every line rolls up to $0 and `costUnavailable` is set.\n costResolver: async (componentSkuId) => fetchLatestCost(componentSkuId),\n});\n\nconst rollup = await bom.computeMaterialCost(bomId);\n// { totalCost, currency, lineBreakdown, hasMissingCosts }\n\nconst requirements = await bom.explodeRequirements(bomId, 100);\n// [{ componentSkuId, totalQty, uom }, ...]\n\nconst check = await bom.canProduce(bomId, 100);\n// { ok: true } | { ok: false, shortages: [...] }\n```\n\n| Method | Behavior |\n|---|---|\n| `computeMaterialCost(bomId)` | Walks every BomLine, applies waste (`qtyPerUnit * (1 + wastePercent / 100)`), resolves unit costs via the optional `costResolver`, returns per-line breakdown plus rolled-up total. Lines with no cost set `costUnavailable: true` and contribute `0`. |\n| `explodeRequirements(bomId, qty)` | Returns a \"shopping list\" of materials needed for `qty` units. Duplicates across lines are summed. Does NOT mutate stock. |\n| `canProduce(bomId, qty)` | Calls `explodeRequirements`, then sums `available` stock across every location per component, returns `{ ok: true }` if everything's covered, else `{ ok: false, shortages: [...] }`. |\n\n## ProductionService — consume / produce\n\n```typescript\nimport { ProductionService } from '@happyvertical/smrt-manufacturing';\n\nconst production = await ProductionService.create({ db });\n\n// Drain materials at the factory.\nconst consumed = await production.consumeMaterials(\n { id: order.id, productId: order.productId, bomId: order.bomId },\n { locationId: factory.id, qty: runQty },\n);\n\n// Receive finished goods.\nconst produced = await production.produceFinishedGoods(\n { id: order.id, productId: order.productId },\n { locationId: factory.id, qty: runQty, finishedSkuId: variant.id },\n);\n\n// Or run both in one transaction — see \"Joint atomicity\" below.\nconst { consumed, produced } = await production.runProduction(\n { id: order.id, productId: order.productId, bomId: order.bomId },\n {\n consume: { locationId: factory.id, qty: runQty },\n produce: { locationId: factory.id, qty: runQty, finishedSkuId: variant.id },\n },\n);\n```\n\nAll three methods write through `StockService` and stamp every emitted `StockMovement` with `sourceType: 'ProductionOrder'` + the production order id so audit queries can roll them up later.\n\n### Joint atomicity — `runProduction` vs the two-call form\n\n`consumeMaterials` and `produceFinishedGoods` are each individually atomic, but calling them as two separate awaits is NOT jointly atomic — each opens its own `stockService.withTransaction(...)` scope. If something goes wrong between the two calls (process crash, transient adapter failure on the produce leg), you can land in a state where materials are deducted but no finished SKU receipt balances them. The audit ledger stays consistent within each call; what's missing is the cross-call invariant.\n\nWhen you need that invariant — typically make-to-stock flows where the factory step is invisible to the ledger — use `runProduction(order, { consume, produce })`. Both legs run inside one transaction; any failure (BOM shortage, adapter error, interceptor reject) rolls back both legs together.\n\nWhen NOT to use it: workflows where consume and produce represent a real wall-clock gap that downstream observers need to see (WIP dashboards, partial-run reporting, separate \"materials posted\" and \"production completed\" events on the dispatch bus). There, the two-call form is the right shape — each call is its own ledger event.\n\n### Location convention — explicit-arg design\n\nThe location where materials are consumed and finished goods are received is passed explicitly to `consumeMaterials` / `produceFinishedGoods`, not carried on the production order itself. Rationale:\n\n- The commerce `ProductionOrder` is a `Contract` STI subtype owned by `@happyvertical/smrt-commerce`. Adding an `originLocationId` field there would either need a schema change in commerce (cross-cutting) or a meta field that only manufacturing knows about (leaky).\n- Real shops often pick a location at run time (factory A is congested, route the run through factory B), so even if the order carried a default, the explicit-arg signature is the more flexible canonical form.\n- Callers that want a default can stash a `locationId` on their own production-order helper and pass it through.\n\n### Finished-SKU convention\n\nA `ProductionOrder` references a `productId`, but a `Product` typically has multiple SKUs (one per variant). The caller of `produceFinishedGoods` picks the concrete `finishedSkuId` because the multi-SKU mapping is application-specific (size run, finish mix, kit variant).\n\n## Opt-in DispatchBus hooks\n\nOff by default. Wire them up explicitly in the application's `smrt.ts`:\n\n```typescript\nimport { installManufacturingDispatchHandlers } from '@happyvertical/smrt-manufacturing';\n\nconst handlers = await installManufacturingDispatchHandlers({\n dispatchBus: bus,\n db,\n // Default: subscribe to production_order:posted, call consumeMaterials.\n installProductionPosted: true,\n // Default: don't auto-produce. Set to true if your shop emits a\n // separate production_order:completed event.\n installProductionCompleted: false,\n // Default: don't combine consume + produce on `posted`. Set to true\n // for make-to-stock-instantly workflows where the factory step is\n // invisible. Ignored when installProductionCompleted is true.\n producedOnPosted: false,\n});\n```\n\nThis subscribes to:\n\n- `production_order:posted` → `production.consumeMaterials(...)`; when `producedOnPosted: true` the handler instead calls `production.runProduction(...)` so consume + produce share one transaction. Process crashes or adapter errors between the two legs can never leave materials deducted with no finished-goods receipt.\n- `production_order:completed` → `production.produceFinishedGoods(...)` (opt-in)\n\nThe companion handlers for `contract:created` (reserve) and `fulfillment:shipped` (fulfil) live in `@happyvertical/smrt-inventory` — wire both packages' installers from `smrt.ts` to get the full lifecycle.\n\n## Tests\n\n`src/__tests__/assembly-suite.ts` runs on SQLite (`assembly.test.ts`) and on PostgreSQL (`assembly.optional.test.ts`, skipped without `DATABASE_URL`; `pnpm test:postgres` and the PostgreSQL CI lane run it on a transaction-scoped handle). Component tests under `src/svelte/__tests__` use jsdom and assert axe.\n\n## Gotchas\n\n- **`computeMaterialCost` without a resolver returns `$0`.** That is deliberate — manufacturing does not assume any particular cost source. A real wiring will plug in `@happyvertical/smrt-products` `Material.costPerUnit`, or a rolling average from purchase-order history, or a vendor price book. The `costUnavailable` flag tells UIs to surface \"unknown cost\" rather than silently rolling up zeros.\n- **`explodeRequirements` does not call any stock APIs.** It is a planning helper. To check whether the materials are actually on hand, use `canProduce`. To actually deduct them, use `ProductionService.consumeMaterials`.\n- **`canProduce` sums available stock across every location.** The planning question is \"do we have it at all?\". The operational question of \"which warehouse do we pull from?\" is left to the caller of `consumeMaterials`, which targets a single `locationId` per call.\n- **`consumeMaterials` propagates `InsufficientStockError`.** If a line would drive `available` below zero, the underlying `StockService.adjust` throws. Pre-flight with `canProduce` before posting if you want to avoid partial-failure mid-run.\n- **`consumeMaterials` is atomic across BOM lines.** All per-line deductions and their audit rows run inside a single `stockService.withTransaction(...)` scope (powered by `@happyvertical/sql >= 0.74.0`'s native `db.transaction()`). An `InsufficientStockError` on line N+1 rolls back lines 1..N so production-order posting never leaves materials half-consumed. The recommended pre-flight (`BomService.canProduce(orderId, qty)`) is still useful when you'd rather know upfront than discover the shortfall mid-run, but a missed pre-flight no longer corrupts state.\n- **`consumeMaterials` + `produceFinishedGoods` are NOT jointly atomic.** Each opens its own transaction. A failure on the produce leg leaves materials deducted with no finished SKU receipt to balance it. Use `runProduction(order, { consume, produce })` when you need both legs to commit or roll back together.\n- **Cross-package references are plain strings.** `productId`, `componentSkuId`, `bomId` (within this package) — all plain string ids, never `@foreignKey()`. The package does depend on `smrt-products` (for `Assembly` and the resolve helper), but the bill schema does not couple to the catalog's table layout.\n- **`Assembly` fields are columns, not `Meta<T>`.** Unlike `Material`, its own fields are ordinary columns this package adds to `products` (filterable over REST). The PostgreSQL suite asserts they land there.\n- **`AssemblyCollection` lists exact `Assembly` rows.** An application subtype (e.g. one adding a customer) has its own `_meta_type`; read it through its own collection or `ProductCollection` (`resolveComponent` uses `instanceof Assembly`, so subtypes resolve as assemblies).\n- **`conflictColumns` include `tenant_id`** on both models. NULL-matching semantics are handled by `@happyvertical/sql >= 0.74.0`; two saves with the same `(product_id, version, NULL)` tuple merge in place.\n- **Lazy table creation.** Like everything else in SMRT, the `manufacturing_boms` and `manufacturing_bom_lines` tables are created on first DB op via `syncSchema`. Safe for SSR. A `BomLine` save now reads `product_skus` and `products` for the cycle check.\n- **Cross-industry constraint.** This package's vocabulary stays generic. Apparel-specific concepts (`Style`, `Makeup`, `Colorway`, `tech-pack`, fashion `Season`) and their analogues in furniture / automotive / CPG live in the relevant template package, never here. PRs that introduce industry vocabulary should be rejected.\n\n## Source attribution\n\nEvery emitted `StockMovement` carries `sourceType: 'ProductionOrder'` plus `sourceId: order.id` so downstream queries can reconstruct \"what caused this movement\". Reason codes used:\n\n| reasonCode | Emitter | Note |\n|---|---|---|\n| `production_consume` | `ProductionService.consumeMaterials` | One per BOM line per consume call |\n| `production_produce` | `ProductionService.produceFinishedGoods` | One per produce call |\n\nThese join cleanly with the standard inventory reason codes (`receipt`, `reservation`, `release`, `fulfillment`, `transfer_out`, `transfer_in`, `adjustment`) defined in `@happyvertical/smrt-inventory`.\n\n## Dependencies\n\n| Package | Purpose |\n|---|---|\n| `@happyvertical/smrt-core` | SmrtObject / SmrtCollection / DispatchBus |\n| `@happyvertical/smrt-inventory` | StockService, stock levels, movements (the `Sku` model itself lives in `@happyvertical/smrt-products`; inventory tracks stock motion against the id) |\n| `@happyvertical/smrt-products` | `Product` (the `Assembly` STI base), `Material`, `Sku` for the resolve helper and cycle check |\n| `@happyvertical/smrt-fields` | `ObjectForm` and field-policy column visibility for the Svelte components |\n| `@happyvertical/smrt-ui` / `smrt-types` | Svelte controls, i18n, module UI slots |\n| `@happyvertical/smrt-tenancy` | Optional tenant scoping |\n| `@happyvertical/sql` | Database adapter |\n"
|
|
830
1887
|
}
|