@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.
Files changed (72) hide show
  1. package/AGENTS.md +45 -6
  2. package/README.md +161 -3
  3. package/dist/collections/AssemblyCollection.d.ts +15 -0
  4. package/dist/collections/AssemblyCollection.d.ts.map +1 -0
  5. package/dist/collections/OperationCollection.d.ts +20 -0
  6. package/dist/collections/OperationCollection.d.ts.map +1 -0
  7. package/dist/collections/RoutingStepCollection.d.ts +15 -0
  8. package/dist/collections/RoutingStepCollection.d.ts.map +1 -0
  9. package/dist/collections/index.d.ts +3 -0
  10. package/dist/collections/index.d.ts.map +1 -1
  11. package/dist/index.d.ts +13 -3
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +756 -29
  14. package/dist/index.js.map +1 -1
  15. package/dist/manifest.json +1248 -128
  16. package/dist/models/Assembly.d.ts +62 -0
  17. package/dist/models/Assembly.d.ts.map +1 -0
  18. package/dist/models/BillOfMaterials.d.ts +12 -4
  19. package/dist/models/BillOfMaterials.d.ts.map +1 -1
  20. package/dist/models/BomLine.d.ts +11 -5
  21. package/dist/models/BomLine.d.ts.map +1 -1
  22. package/dist/models/Operation.d.ts +59 -0
  23. package/dist/models/Operation.d.ts.map +1 -0
  24. package/dist/models/RoutingStep.d.ts +46 -0
  25. package/dist/models/RoutingStep.d.ts.map +1 -0
  26. package/dist/models/index.d.ts +3 -0
  27. package/dist/models/index.d.ts.map +1 -1
  28. package/dist/operation-types.d.ts +99 -0
  29. package/dist/operation-types.d.ts.map +1 -0
  30. package/dist/services/AssemblyService.d.ts +217 -0
  31. package/dist/services/AssemblyService.d.ts.map +1 -0
  32. package/dist/services/BomService.d.ts +25 -1
  33. package/dist/services/BomService.d.ts.map +1 -1
  34. package/dist/services/OperationService.d.ts +48 -0
  35. package/dist/services/OperationService.d.ts.map +1 -0
  36. package/dist/services/RoutingService.d.ts +50 -0
  37. package/dist/services/RoutingService.d.ts.map +1 -0
  38. package/dist/services/index.d.ts +3 -0
  39. package/dist/services/index.d.ts.map +1 -1
  40. package/dist/smrt-knowledge.json +1138 -81
  41. package/dist/svelte/components/AssemblyForm.svelte +69 -0
  42. package/dist/svelte/components/AssemblyForm.svelte.d.ts +38 -0
  43. package/dist/svelte/components/AssemblyForm.svelte.d.ts.map +1 -0
  44. package/dist/svelte/components/AssemblyList.svelte +229 -0
  45. package/dist/svelte/components/AssemblyList.svelte.d.ts +28 -0
  46. package/dist/svelte/components/AssemblyList.svelte.d.ts.map +1 -0
  47. package/dist/svelte/components/BomEditor.svelte +575 -0
  48. package/dist/svelte/components/BomEditor.svelte.d.ts +29 -0
  49. package/dist/svelte/components/BomEditor.svelte.d.ts.map +1 -0
  50. package/dist/svelte/components/BomStructureTree.svelte +164 -0
  51. package/dist/svelte/components/BomStructureTree.svelte.d.ts +16 -0
  52. package/dist/svelte/components/BomStructureTree.svelte.d.ts.map +1 -0
  53. package/dist/svelte/components/OperationForm.svelte +258 -0
  54. package/dist/svelte/components/OperationForm.svelte.d.ts +17 -0
  55. package/dist/svelte/components/OperationForm.svelte.d.ts.map +1 -0
  56. package/dist/svelte/components/OperationList.svelte +170 -0
  57. package/dist/svelte/components/OperationList.svelte.d.ts +17 -0
  58. package/dist/svelte/components/OperationList.svelte.d.ts.map +1 -0
  59. package/dist/svelte/i18n.d.ts +87 -0
  60. package/dist/svelte/i18n.d.ts.map +1 -0
  61. package/dist/svelte/i18n.js +87 -0
  62. package/dist/svelte/index.d.ts +28 -0
  63. package/dist/svelte/index.d.ts.map +1 -0
  64. package/dist/svelte/index.js +29 -0
  65. package/dist/svelte/types.d.ts +170 -0
  66. package/dist/svelte/types.d.ts.map +1 -0
  67. package/dist/svelte/types.js +126 -0
  68. package/dist/ui.d.ts +17 -0
  69. package/dist/ui.d.ts.map +1 -0
  70. package/dist/ui.js +72 -0
  71. package/dist/ui.js.map +1 -0
  72. package/package.json +39 -10
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-manufacturing",
5
- "packageVersion": "0.53.4",
5
+ "packageVersion": "0.53.5",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-manufacturing:BillOfMaterialsCollection": {
8
8
  "name": "billofmaterialscollection",
@@ -309,6 +309,686 @@
309
309
  },
310
310
  "importPath": "@happyvertical/smrt-manufacturing"
311
311
  },
312
+ "@happyvertical/smrt-manufacturing:OperationCollection": {
313
+ "name": "operationcollection",
314
+ "className": "OperationCollection",
315
+ "qualifiedName": "@happyvertical/smrt-manufacturing:OperationCollection",
316
+ "collection": "operations",
317
+ "filePath": "/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/OperationCollection.ts",
318
+ "packageName": "@happyvertical/smrt-manufacturing",
319
+ "fields": {},
320
+ "methods": {
321
+ "findByCode": {
322
+ "name": "findByCode",
323
+ "async": true,
324
+ "parameters": [
325
+ {
326
+ "name": "code",
327
+ "type": "string",
328
+ "optional": false
329
+ }
330
+ ],
331
+ "returnType": "Promise<Operation | null>",
332
+ "isStatic": false,
333
+ "isPublic": true
334
+ },
335
+ "listOperations": {
336
+ "name": "listOperations",
337
+ "async": true,
338
+ "parameters": [
339
+ {
340
+ "name": "options",
341
+ "type": "object",
342
+ "optional": true,
343
+ "memberTypes": [
344
+ "boolean"
345
+ ]
346
+ }
347
+ ],
348
+ "returnType": "Promise<Operation[]>",
349
+ "isStatic": false,
350
+ "isPublic": true
351
+ }
352
+ },
353
+ "decoratorConfig": {
354
+ "tableName": "manufacturing_operations"
355
+ },
356
+ "extends": "SmrtCollection",
357
+ "extendsTypeArg": "Operation",
358
+ "exportName": "OperationCollection",
359
+ "collectionExportName": "OperationCollectionCollection",
360
+ "schema": {
361
+ "tableName": "manufacturing_operations",
362
+ "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);",
363
+ "columns": {
364
+ "id": {
365
+ "type": "UUID",
366
+ "primaryKey": true,
367
+ "referenceKind": "id",
368
+ "notNull": true
369
+ },
370
+ "slug": {
371
+ "type": "TEXT",
372
+ "notNull": true
373
+ },
374
+ "context": {
375
+ "type": "TEXT",
376
+ "notNull": true,
377
+ "default": ""
378
+ },
379
+ "created_at": {
380
+ "type": "TIMESTAMP",
381
+ "notNull": true,
382
+ "default": "current_timestamp"
383
+ },
384
+ "updated_at": {
385
+ "type": "TIMESTAMP",
386
+ "notNull": true,
387
+ "default": "current_timestamp"
388
+ },
389
+ "tenant_id": {
390
+ "type": "UUID",
391
+ "referenceKind": "tenantId",
392
+ "notNull": false,
393
+ "unique": false
394
+ },
395
+ "code": {
396
+ "type": "TEXT",
397
+ "notNull": true,
398
+ "unique": false,
399
+ "default": ""
400
+ },
401
+ "name": {
402
+ "type": "TEXT",
403
+ "notNull": true,
404
+ "unique": false,
405
+ "default": ""
406
+ },
407
+ "category": {
408
+ "type": "TEXT",
409
+ "notNull": false,
410
+ "unique": false,
411
+ "default": ""
412
+ },
413
+ "is_active": {
414
+ "type": "BOOLEAN",
415
+ "notNull": false,
416
+ "unique": false,
417
+ "default": true
418
+ },
419
+ "required_qualification_id": {
420
+ "type": "UUID",
421
+ "referenceKind": "crossPackageRef",
422
+ "notNull": false,
423
+ "unique": false
424
+ }
425
+ },
426
+ "indexes": [
427
+ {
428
+ "name": "manufacturing_operations_code_tenant_id_idx",
429
+ "columns": [
430
+ "code",
431
+ "tenant_id"
432
+ ],
433
+ "unique": true,
434
+ "nullsNotDistinct": true
435
+ },
436
+ {
437
+ "name": "manufacturing_operations_slug_context_idx",
438
+ "columns": [
439
+ "slug",
440
+ "context"
441
+ ]
442
+ },
443
+ {
444
+ "name": "manufacturing_operations_tenant_id_created_at_idx",
445
+ "columns": [
446
+ "tenant_id",
447
+ "created_at"
448
+ ]
449
+ },
450
+ {
451
+ "name": "manufacturing_operations_required_qualification_id_idx",
452
+ "columns": [
453
+ "required_qualification_id"
454
+ ]
455
+ }
456
+ ],
457
+ "version": "0b3134d6"
458
+ },
459
+ "importPath": "@happyvertical/smrt-manufacturing"
460
+ },
461
+ "@happyvertical/smrt-manufacturing:RoutingStepCollection": {
462
+ "name": "routingstepcollection",
463
+ "className": "RoutingStepCollection",
464
+ "qualifiedName": "@happyvertical/smrt-manufacturing:RoutingStepCollection",
465
+ "collection": "routingsteps",
466
+ "filePath": "/home/runner/work/smrt/smrt/packages/manufacturing/src/collections/RoutingStepCollection.ts",
467
+ "packageName": "@happyvertical/smrt-manufacturing",
468
+ "fields": {},
469
+ "methods": {
470
+ "findByBom": {
471
+ "name": "findByBom",
472
+ "async": true,
473
+ "parameters": [
474
+ {
475
+ "name": "bomId",
476
+ "type": "string",
477
+ "optional": false
478
+ }
479
+ ],
480
+ "returnType": "Promise<RoutingStep[]>",
481
+ "isStatic": false,
482
+ "isPublic": true
483
+ },
484
+ "findByOperation": {
485
+ "name": "findByOperation",
486
+ "async": true,
487
+ "parameters": [
488
+ {
489
+ "name": "operationId",
490
+ "type": "string",
491
+ "optional": false
492
+ }
493
+ ],
494
+ "returnType": "Promise<RoutingStep[]>",
495
+ "isStatic": false,
496
+ "isPublic": true
497
+ }
498
+ },
499
+ "decoratorConfig": {
500
+ "tableName": "manufacturing_routing_steps"
501
+ },
502
+ "extends": "SmrtCollection",
503
+ "extendsTypeArg": "RoutingStep",
504
+ "exportName": "RoutingStepCollection",
505
+ "collectionExportName": "RoutingStepCollectionCollection",
506
+ "schema": {
507
+ "tableName": "manufacturing_routing_steps",
508
+ "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);",
509
+ "columns": {
510
+ "id": {
511
+ "type": "UUID",
512
+ "primaryKey": true,
513
+ "referenceKind": "id",
514
+ "notNull": true
515
+ },
516
+ "slug": {
517
+ "type": "TEXT",
518
+ "notNull": true
519
+ },
520
+ "context": {
521
+ "type": "TEXT",
522
+ "notNull": true,
523
+ "default": ""
524
+ },
525
+ "created_at": {
526
+ "type": "TIMESTAMP",
527
+ "notNull": true,
528
+ "default": "current_timestamp"
529
+ },
530
+ "updated_at": {
531
+ "type": "TIMESTAMP",
532
+ "notNull": true,
533
+ "default": "current_timestamp"
534
+ },
535
+ "tenant_id": {
536
+ "type": "UUID",
537
+ "referenceKind": "tenantId",
538
+ "notNull": false,
539
+ "unique": false
540
+ },
541
+ "bom_id": {
542
+ "type": "UUID",
543
+ "referenceKind": "foreignKey",
544
+ "notNull": true,
545
+ "unique": false,
546
+ "foreignKey": {
547
+ "table": "manufacturing_boms",
548
+ "column": "id",
549
+ "onDelete": "CASCADE",
550
+ "onUpdate": "CASCADE"
551
+ }
552
+ },
553
+ "operation_id": {
554
+ "type": "UUID",
555
+ "referenceKind": "foreignKey",
556
+ "notNull": true,
557
+ "unique": false,
558
+ "foreignKey": {
559
+ "table": "manufacturing_operations",
560
+ "column": "id",
561
+ "onDelete": "RESTRICT",
562
+ "onUpdate": "CASCADE"
563
+ }
564
+ },
565
+ "sequence": {
566
+ "type": "INTEGER",
567
+ "notNull": true,
568
+ "unique": false,
569
+ "default": 1
570
+ },
571
+ "estimated_minutes": {
572
+ "type": "REAL",
573
+ "notNull": false,
574
+ "unique": false
575
+ },
576
+ "notes": {
577
+ "type": "TEXT",
578
+ "notNull": false,
579
+ "unique": false,
580
+ "default": ""
581
+ }
582
+ },
583
+ "indexes": [
584
+ {
585
+ "name": "manufacturing_routing_steps_bom_id_sequence_idx",
586
+ "columns": [
587
+ "bom_id",
588
+ "sequence",
589
+ "tenant_id"
590
+ ],
591
+ "unique": true,
592
+ "nullsNotDistinct": true
593
+ },
594
+ {
595
+ "name": "manufacturing_routing_steps_slug_context_idx",
596
+ "columns": [
597
+ "slug",
598
+ "context"
599
+ ]
600
+ },
601
+ {
602
+ "name": "manufacturing_routing_steps_tenant_id_created_at_idx",
603
+ "columns": [
604
+ "tenant_id",
605
+ "created_at"
606
+ ]
607
+ },
608
+ {
609
+ "name": "manufacturing_routing_steps_operation_id_idx",
610
+ "columns": [
611
+ "operation_id"
612
+ ]
613
+ }
614
+ ],
615
+ "version": "41ac3c66"
616
+ },
617
+ "importPath": "@happyvertical/smrt-manufacturing"
618
+ },
619
+ "@happyvertical/smrt-manufacturing:Assembly": {
620
+ "name": "assembly",
621
+ "className": "Assembly",
622
+ "qualifiedName": "@happyvertical/smrt-manufacturing:Assembly",
623
+ "collection": "products",
624
+ "filePath": "/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Assembly.ts",
625
+ "packageName": "@happyvertical/smrt-manufacturing",
626
+ "fields": {
627
+ "created_at": {
628
+ "type": "datetime",
629
+ "required": false
630
+ },
631
+ "updated_at": {
632
+ "type": "datetime",
633
+ "required": false
634
+ },
635
+ "tenantId": {
636
+ "type": "text",
637
+ "required": false,
638
+ "_meta": {
639
+ "generated": true,
640
+ "source": "tenantScoped_decorator",
641
+ "sqlType": "UUID",
642
+ "__tenancy": {
643
+ "isTenantIdField": true,
644
+ "mode": "optional",
645
+ "field": "tenantId",
646
+ "autoFilter": true,
647
+ "autoPopulate": true,
648
+ "allowSuperAdminBypass": false
649
+ }
650
+ }
651
+ },
652
+ "productType": {
653
+ "type": "json",
654
+ "required": false
655
+ },
656
+ "name": {
657
+ "type": "text",
658
+ "required": false
659
+ },
660
+ "description": {
661
+ "type": "text",
662
+ "required": false
663
+ },
664
+ "category": {
665
+ "type": "text",
666
+ "required": false
667
+ },
668
+ "manufacturer": {
669
+ "type": "text",
670
+ "required": false
671
+ },
672
+ "model": {
673
+ "type": "text",
674
+ "required": false
675
+ },
676
+ "price": {
677
+ "type": "integer",
678
+ "required": true,
679
+ "default": 0
680
+ },
681
+ "inStock": {
682
+ "type": "boolean",
683
+ "required": true,
684
+ "default": true
685
+ },
686
+ "specifications": {
687
+ "type": "json",
688
+ "required": false,
689
+ "default": {}
690
+ },
691
+ "tags": {
692
+ "type": "json",
693
+ "required": false,
694
+ "default": []
695
+ },
696
+ "estimatedLabourMinutes": {
697
+ "type": "integer",
698
+ "required": false,
699
+ "default": 0
700
+ },
701
+ "defaultOperationId": {
702
+ "type": "foreignKey",
703
+ "required": false,
704
+ "related": "Operation",
705
+ "_meta": {
706
+ "nullable": true,
707
+ "onDelete": "RESTRICT"
708
+ }
709
+ },
710
+ "partReference": {
711
+ "type": "text",
712
+ "required": false,
713
+ "default": ""
714
+ }
715
+ },
716
+ "methods": {
717
+ "getSpecification": {
718
+ "name": "getSpecification",
719
+ "async": true,
720
+ "parameters": [
721
+ {
722
+ "name": "key",
723
+ "type": "string",
724
+ "optional": false
725
+ }
726
+ ],
727
+ "returnType": "Promise<unknown>",
728
+ "isStatic": false,
729
+ "isPublic": true
730
+ },
731
+ "updateSpecification": {
732
+ "name": "updateSpecification",
733
+ "async": true,
734
+ "parameters": [
735
+ {
736
+ "name": "key",
737
+ "type": "string",
738
+ "optional": false
739
+ },
740
+ {
741
+ "name": "value",
742
+ "type": "unknown",
743
+ "optional": false
744
+ }
745
+ ],
746
+ "returnType": "Promise<void>",
747
+ "isStatic": false,
748
+ "isPublic": true
749
+ },
750
+ "getAssets": {
751
+ "name": "getAssets",
752
+ "async": true,
753
+ "parameters": [
754
+ {
755
+ "name": "relationship",
756
+ "type": "string",
757
+ "optional": true
758
+ }
759
+ ],
760
+ "returnType": "Promise<Asset[]>",
761
+ "isStatic": false,
762
+ "isPublic": true
763
+ },
764
+ "addAsset": {
765
+ "name": "addAsset",
766
+ "async": true,
767
+ "parameters": [
768
+ {
769
+ "name": "asset",
770
+ "type": "Asset",
771
+ "optional": false
772
+ },
773
+ {
774
+ "name": "relationship",
775
+ "type": "any",
776
+ "optional": true,
777
+ "default": "attachment"
778
+ },
779
+ {
780
+ "name": "sortOrder",
781
+ "type": "any",
782
+ "optional": true
783
+ }
784
+ ],
785
+ "returnType": "Promise<void>",
786
+ "isStatic": false,
787
+ "isPublic": true
788
+ },
789
+ "removeAsset": {
790
+ "name": "removeAsset",
791
+ "async": true,
792
+ "parameters": [
793
+ {
794
+ "name": "assetId",
795
+ "type": "string",
796
+ "optional": false
797
+ },
798
+ {
799
+ "name": "relationship",
800
+ "type": "string",
801
+ "optional": true
802
+ }
803
+ ],
804
+ "returnType": "Promise<void>",
805
+ "isStatic": false,
806
+ "isPublic": true
807
+ }
808
+ },
809
+ "decoratorConfig": {
810
+ "api": {
811
+ "include": [
812
+ "list",
813
+ "get",
814
+ "create",
815
+ "update"
816
+ ]
817
+ },
818
+ "mcp": {
819
+ "include": [
820
+ "list",
821
+ "get"
822
+ ]
823
+ },
824
+ "cli": {
825
+ "skipApiCheck": true
826
+ },
827
+ "tenantScoped": {
828
+ "mode": "optional"
829
+ },
830
+ "tableName": "products",
831
+ "tableStrategy": "sti"
832
+ },
833
+ "extends": "Product",
834
+ "exportName": "Assembly",
835
+ "collectionExportName": "AssemblyCollection",
836
+ "validationRules": [
837
+ {
838
+ "field": "price",
839
+ "rule": "required",
840
+ "fieldType": "integer"
841
+ },
842
+ {
843
+ "field": "inStock",
844
+ "rule": "required",
845
+ "fieldType": "boolean"
846
+ }
847
+ ],
848
+ "schema": {
849
+ "tableName": "products",
850
+ "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);",
851
+ "columns": {
852
+ "id": {
853
+ "type": "UUID",
854
+ "primaryKey": true,
855
+ "referenceKind": "id",
856
+ "notNull": true
857
+ },
858
+ "slug": {
859
+ "type": "TEXT",
860
+ "notNull": true
861
+ },
862
+ "context": {
863
+ "type": "TEXT",
864
+ "notNull": true,
865
+ "default": ""
866
+ },
867
+ "_meta_type": {
868
+ "type": "TEXT",
869
+ "notNull": true
870
+ },
871
+ "_meta_data": {
872
+ "type": "JSON",
873
+ "notNull": false
874
+ },
875
+ "created_at": {
876
+ "type": "TIMESTAMP",
877
+ "notNull": true,
878
+ "default": "current_timestamp"
879
+ },
880
+ "updated_at": {
881
+ "type": "TIMESTAMP",
882
+ "notNull": true,
883
+ "default": "current_timestamp"
884
+ },
885
+ "tenant_id": {
886
+ "type": "UUID",
887
+ "referenceKind": "tenantId",
888
+ "notNull": false
889
+ },
890
+ "product_type": {
891
+ "type": "TEXT",
892
+ "notNull": false
893
+ },
894
+ "name": {
895
+ "type": "TEXT",
896
+ "notNull": false
897
+ },
898
+ "description": {
899
+ "type": "TEXT",
900
+ "notNull": false
901
+ },
902
+ "category": {
903
+ "type": "TEXT",
904
+ "notNull": false
905
+ },
906
+ "manufacturer": {
907
+ "type": "TEXT",
908
+ "notNull": false
909
+ },
910
+ "model": {
911
+ "type": "TEXT",
912
+ "notNull": false
913
+ },
914
+ "price": {
915
+ "type": "INTEGER",
916
+ "notNull": false,
917
+ "default": 0
918
+ },
919
+ "in_stock": {
920
+ "type": "BOOLEAN",
921
+ "notNull": false,
922
+ "default": true
923
+ },
924
+ "specifications": {
925
+ "type": "JSON",
926
+ "notNull": false,
927
+ "default": {}
928
+ },
929
+ "tags": {
930
+ "type": "JSON",
931
+ "notNull": false,
932
+ "default": []
933
+ },
934
+ "estimated_labour_minutes": {
935
+ "type": "INTEGER",
936
+ "notNull": false,
937
+ "default": 0
938
+ },
939
+ "default_operation_id": {
940
+ "type": "UUID",
941
+ "referenceKind": "foreignKey",
942
+ "notNull": false,
943
+ "foreignKey": {
944
+ "table": "manufacturing_operations",
945
+ "column": "id",
946
+ "onDelete": "RESTRICT",
947
+ "onUpdate": "CASCADE"
948
+ }
949
+ },
950
+ "part_reference": {
951
+ "type": "TEXT",
952
+ "notNull": false,
953
+ "default": ""
954
+ }
955
+ },
956
+ "indexes": [
957
+ {
958
+ "name": "products_slug_context_meta_type_idx",
959
+ "columns": [
960
+ "tenant_id",
961
+ "slug",
962
+ "context",
963
+ "_meta_type"
964
+ ],
965
+ "unique": true,
966
+ "nullsNotDistinct": true
967
+ },
968
+ {
969
+ "name": "products_meta_type_idx",
970
+ "columns": [
971
+ "_meta_type"
972
+ ]
973
+ },
974
+ {
975
+ "name": "products_tenant_id_created_at_idx",
976
+ "columns": [
977
+ "tenant_id",
978
+ "created_at"
979
+ ]
980
+ },
981
+ {
982
+ "name": "products_default_operation_id_idx",
983
+ "columns": [
984
+ "default_operation_id"
985
+ ]
986
+ }
987
+ ],
988
+ "version": "f2f2bf95"
989
+ },
990
+ "importPath": "@happyvertical/smrt-manufacturing"
991
+ },
312
992
  "@happyvertical/smrt-manufacturing:BillOfMaterials": {
313
993
  "name": "billofmaterials",
314
994
  "className": "BillOfMaterials",
@@ -335,7 +1015,436 @@
335
1015
  }
336
1016
  }
337
1017
  },
338
- "productId": {
1018
+ "productId": {
1019
+ "type": "text",
1020
+ "required": true,
1021
+ "default": "",
1022
+ "_meta": {
1023
+ "required": true
1024
+ }
1025
+ },
1026
+ "version": {
1027
+ "type": "integer",
1028
+ "required": true,
1029
+ "default": 1,
1030
+ "_meta": {
1031
+ "required": true
1032
+ }
1033
+ },
1034
+ "effectiveDate": {
1035
+ "type": "datetime",
1036
+ "required": false
1037
+ },
1038
+ "status": {
1039
+ "type": "text",
1040
+ "required": true,
1041
+ "default": "draft",
1042
+ "_meta": {
1043
+ "required": true
1044
+ }
1045
+ },
1046
+ "notes": {
1047
+ "type": "text",
1048
+ "required": false,
1049
+ "default": ""
1050
+ },
1051
+ "currency": {
1052
+ "type": "text",
1053
+ "required": false,
1054
+ "default": "USD"
1055
+ }
1056
+ },
1057
+ "methods": {},
1058
+ "decoratorConfig": {
1059
+ "tableName": "manufacturing_boms",
1060
+ "conflictColumns": [
1061
+ "product_id",
1062
+ "version",
1063
+ "tenant_id"
1064
+ ],
1065
+ "api": {
1066
+ "include": [
1067
+ "list",
1068
+ "get",
1069
+ "create",
1070
+ "update"
1071
+ ]
1072
+ },
1073
+ "mcp": {
1074
+ "include": [
1075
+ "list",
1076
+ "get"
1077
+ ]
1078
+ },
1079
+ "cli": true,
1080
+ "tenantScoped": {
1081
+ "mode": "optional"
1082
+ }
1083
+ },
1084
+ "extends": "SmrtObject",
1085
+ "exportName": "BillOfMaterials",
1086
+ "collectionExportName": "BillOfMaterialsCollection",
1087
+ "validationRules": [
1088
+ {
1089
+ "field": "productId",
1090
+ "rule": "required",
1091
+ "fieldType": "text"
1092
+ },
1093
+ {
1094
+ "field": "version",
1095
+ "rule": "required",
1096
+ "fieldType": "integer"
1097
+ },
1098
+ {
1099
+ "field": "status",
1100
+ "rule": "required",
1101
+ "fieldType": "text"
1102
+ }
1103
+ ],
1104
+ "schema": {
1105
+ "tableName": "manufacturing_boms",
1106
+ "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);",
1107
+ "columns": {
1108
+ "id": {
1109
+ "type": "UUID",
1110
+ "primaryKey": true,
1111
+ "referenceKind": "id",
1112
+ "notNull": true
1113
+ },
1114
+ "slug": {
1115
+ "type": "TEXT",
1116
+ "notNull": true
1117
+ },
1118
+ "context": {
1119
+ "type": "TEXT",
1120
+ "notNull": true,
1121
+ "default": ""
1122
+ },
1123
+ "created_at": {
1124
+ "type": "TIMESTAMP",
1125
+ "notNull": true,
1126
+ "default": "current_timestamp"
1127
+ },
1128
+ "updated_at": {
1129
+ "type": "TIMESTAMP",
1130
+ "notNull": true,
1131
+ "default": "current_timestamp"
1132
+ },
1133
+ "tenant_id": {
1134
+ "type": "UUID",
1135
+ "referenceKind": "tenantId",
1136
+ "notNull": false,
1137
+ "unique": false
1138
+ },
1139
+ "product_id": {
1140
+ "type": "TEXT",
1141
+ "notNull": true,
1142
+ "unique": false,
1143
+ "default": ""
1144
+ },
1145
+ "version": {
1146
+ "type": "INTEGER",
1147
+ "notNull": true,
1148
+ "unique": false,
1149
+ "default": 1
1150
+ },
1151
+ "effective_date": {
1152
+ "type": "TIMESTAMP",
1153
+ "notNull": false,
1154
+ "unique": false
1155
+ },
1156
+ "status": {
1157
+ "type": "TEXT",
1158
+ "notNull": true,
1159
+ "unique": false,
1160
+ "default": "draft"
1161
+ },
1162
+ "notes": {
1163
+ "type": "TEXT",
1164
+ "notNull": false,
1165
+ "unique": false,
1166
+ "default": ""
1167
+ },
1168
+ "currency": {
1169
+ "type": "TEXT",
1170
+ "notNull": false,
1171
+ "unique": false,
1172
+ "default": "USD"
1173
+ }
1174
+ },
1175
+ "indexes": [
1176
+ {
1177
+ "name": "manufacturing_boms_product_id_version_idx",
1178
+ "columns": [
1179
+ "product_id",
1180
+ "version",
1181
+ "tenant_id"
1182
+ ],
1183
+ "unique": true,
1184
+ "nullsNotDistinct": true
1185
+ },
1186
+ {
1187
+ "name": "manufacturing_boms_slug_context_idx",
1188
+ "columns": [
1189
+ "slug",
1190
+ "context"
1191
+ ]
1192
+ },
1193
+ {
1194
+ "name": "manufacturing_boms_tenant_id_created_at_idx",
1195
+ "columns": [
1196
+ "tenant_id",
1197
+ "created_at"
1198
+ ]
1199
+ }
1200
+ ],
1201
+ "version": "b2691adc"
1202
+ },
1203
+ "importPath": "@happyvertical/smrt-manufacturing"
1204
+ },
1205
+ "@happyvertical/smrt-manufacturing:BomLine": {
1206
+ "name": "bomline",
1207
+ "className": "BomLine",
1208
+ "qualifiedName": "@happyvertical/smrt-manufacturing:BomLine",
1209
+ "collection": "bomlines",
1210
+ "filePath": "/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BomLine.ts",
1211
+ "packageName": "@happyvertical/smrt-manufacturing",
1212
+ "fields": {
1213
+ "tenantId": {
1214
+ "type": "text",
1215
+ "required": false,
1216
+ "_meta": {
1217
+ "sqlType": "UUID",
1218
+ "nullable": true,
1219
+ "__tenancy": {
1220
+ "isTenantIdField": true,
1221
+ "autoFilter": true,
1222
+ "required": false,
1223
+ "autoPopulate": true,
1224
+ "nullable": true,
1225
+ "mode": "optional",
1226
+ "field": "tenantId",
1227
+ "allowSuperAdminBypass": false
1228
+ }
1229
+ }
1230
+ },
1231
+ "bomId": {
1232
+ "type": "text",
1233
+ "required": true,
1234
+ "default": "",
1235
+ "_meta": {
1236
+ "required": true
1237
+ }
1238
+ },
1239
+ "componentSkuId": {
1240
+ "type": "text",
1241
+ "required": true,
1242
+ "default": "",
1243
+ "_meta": {
1244
+ "required": true
1245
+ }
1246
+ },
1247
+ "qtyPerUnit": {
1248
+ "type": "decimal",
1249
+ "required": false,
1250
+ "_meta": {}
1251
+ },
1252
+ "uom": {
1253
+ "type": "text",
1254
+ "required": false,
1255
+ "default": "each"
1256
+ },
1257
+ "wastePercent": {
1258
+ "type": "decimal",
1259
+ "required": false,
1260
+ "_meta": {}
1261
+ },
1262
+ "notes": {
1263
+ "type": "text",
1264
+ "required": false,
1265
+ "default": ""
1266
+ }
1267
+ },
1268
+ "methods": {
1269
+ "effectiveQtyPerUnit": {
1270
+ "name": "effectiveQtyPerUnit",
1271
+ "async": false,
1272
+ "parameters": [],
1273
+ "returnType": "number",
1274
+ "isStatic": false,
1275
+ "isPublic": true
1276
+ }
1277
+ },
1278
+ "decoratorConfig": {
1279
+ "tableName": "manufacturing_bom_lines",
1280
+ "conflictColumns": [
1281
+ "bom_id",
1282
+ "component_sku_id",
1283
+ "tenant_id"
1284
+ ],
1285
+ "api": {
1286
+ "include": [
1287
+ "list",
1288
+ "get",
1289
+ "create",
1290
+ "update"
1291
+ ]
1292
+ },
1293
+ "mcp": {
1294
+ "include": [
1295
+ "list",
1296
+ "get"
1297
+ ]
1298
+ },
1299
+ "cli": {
1300
+ "skipApiCheck": true
1301
+ },
1302
+ "tenantScoped": {
1303
+ "mode": "optional"
1304
+ }
1305
+ },
1306
+ "extends": "SmrtObject",
1307
+ "exportName": "BomLine",
1308
+ "collectionExportName": "BomLineCollection",
1309
+ "validationRules": [
1310
+ {
1311
+ "field": "bomId",
1312
+ "rule": "required",
1313
+ "fieldType": "text"
1314
+ },
1315
+ {
1316
+ "field": "componentSkuId",
1317
+ "rule": "required",
1318
+ "fieldType": "text"
1319
+ }
1320
+ ],
1321
+ "schema": {
1322
+ "tableName": "manufacturing_bom_lines",
1323
+ "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);",
1324
+ "columns": {
1325
+ "id": {
1326
+ "type": "UUID",
1327
+ "primaryKey": true,
1328
+ "referenceKind": "id",
1329
+ "notNull": true
1330
+ },
1331
+ "slug": {
1332
+ "type": "TEXT",
1333
+ "notNull": true
1334
+ },
1335
+ "context": {
1336
+ "type": "TEXT",
1337
+ "notNull": true,
1338
+ "default": ""
1339
+ },
1340
+ "created_at": {
1341
+ "type": "TIMESTAMP",
1342
+ "notNull": true,
1343
+ "default": "current_timestamp"
1344
+ },
1345
+ "updated_at": {
1346
+ "type": "TIMESTAMP",
1347
+ "notNull": true,
1348
+ "default": "current_timestamp"
1349
+ },
1350
+ "tenant_id": {
1351
+ "type": "UUID",
1352
+ "referenceKind": "tenantId",
1353
+ "notNull": false,
1354
+ "unique": false
1355
+ },
1356
+ "bom_id": {
1357
+ "type": "TEXT",
1358
+ "notNull": true,
1359
+ "unique": false,
1360
+ "default": ""
1361
+ },
1362
+ "component_sku_id": {
1363
+ "type": "TEXT",
1364
+ "notNull": true,
1365
+ "unique": false,
1366
+ "default": ""
1367
+ },
1368
+ "qty_per_unit": {
1369
+ "type": "REAL",
1370
+ "notNull": false,
1371
+ "unique": false
1372
+ },
1373
+ "uom": {
1374
+ "type": "TEXT",
1375
+ "notNull": false,
1376
+ "unique": false,
1377
+ "default": "each"
1378
+ },
1379
+ "waste_percent": {
1380
+ "type": "REAL",
1381
+ "notNull": false,
1382
+ "unique": false
1383
+ },
1384
+ "notes": {
1385
+ "type": "TEXT",
1386
+ "notNull": false,
1387
+ "unique": false,
1388
+ "default": ""
1389
+ }
1390
+ },
1391
+ "indexes": [
1392
+ {
1393
+ "name": "manufacturing_bom_lines_bom_id_component_sku_id_idx",
1394
+ "columns": [
1395
+ "bom_id",
1396
+ "component_sku_id",
1397
+ "tenant_id"
1398
+ ],
1399
+ "unique": true,
1400
+ "nullsNotDistinct": true
1401
+ },
1402
+ {
1403
+ "name": "manufacturing_bom_lines_slug_context_idx",
1404
+ "columns": [
1405
+ "slug",
1406
+ "context"
1407
+ ]
1408
+ },
1409
+ {
1410
+ "name": "manufacturing_bom_lines_tenant_id_created_at_idx",
1411
+ "columns": [
1412
+ "tenant_id",
1413
+ "created_at"
1414
+ ]
1415
+ }
1416
+ ],
1417
+ "version": "cfbae7e8"
1418
+ },
1419
+ "importPath": "@happyvertical/smrt-manufacturing"
1420
+ },
1421
+ "@happyvertical/smrt-manufacturing:Operation": {
1422
+ "name": "operation",
1423
+ "className": "Operation",
1424
+ "qualifiedName": "@happyvertical/smrt-manufacturing:Operation",
1425
+ "collection": "operations",
1426
+ "filePath": "/home/runner/work/smrt/smrt/packages/manufacturing/src/models/Operation.ts",
1427
+ "packageName": "@happyvertical/smrt-manufacturing",
1428
+ "fields": {
1429
+ "tenantId": {
1430
+ "type": "text",
1431
+ "required": false,
1432
+ "_meta": {
1433
+ "sqlType": "UUID",
1434
+ "nullable": true,
1435
+ "__tenancy": {
1436
+ "isTenantIdField": true,
1437
+ "autoFilter": true,
1438
+ "required": false,
1439
+ "autoPopulate": true,
1440
+ "nullable": true,
1441
+ "mode": "optional",
1442
+ "field": "tenantId",
1443
+ "allowSuperAdminBypass": false
1444
+ }
1445
+ }
1446
+ },
1447
+ "code": {
339
1448
  "type": "text",
340
1449
  "required": true,
341
1450
  "default": "",
@@ -343,51 +1452,53 @@
343
1452
  "required": true
344
1453
  }
345
1454
  },
346
- "version": {
347
- "type": "integer",
348
- "required": true,
349
- "default": 1,
350
- "_meta": {
351
- "required": true
352
- }
353
- },
354
- "effectiveDate": {
355
- "type": "datetime",
356
- "required": false
357
- },
358
- "status": {
1455
+ "name": {
359
1456
  "type": "text",
360
1457
  "required": true,
361
- "default": "draft",
1458
+ "default": "",
362
1459
  "_meta": {
363
1460
  "required": true
364
1461
  }
365
1462
  },
366
- "notes": {
1463
+ "category": {
367
1464
  "type": "text",
368
1465
  "required": false,
369
1466
  "default": ""
370
1467
  },
371
- "currency": {
372
- "type": "text",
1468
+ "isActive": {
1469
+ "type": "boolean",
373
1470
  "required": false,
374
- "default": "USD"
1471
+ "default": true
1472
+ },
1473
+ "requiredQualificationId": {
1474
+ "type": "crossPackageRef",
1475
+ "required": false,
1476
+ "related": "@happyvertical/smrt-human-resources:Qualification",
1477
+ "_meta": {
1478
+ "nullable": true
1479
+ }
1480
+ }
1481
+ },
1482
+ "methods": {
1483
+ "delete": {
1484
+ "name": "delete",
1485
+ "async": true,
1486
+ "parameters": [],
1487
+ "returnType": "Promise<void>",
1488
+ "isStatic": false,
1489
+ "isPublic": true
375
1490
  }
376
1491
  },
377
- "methods": {},
378
1492
  "decoratorConfig": {
379
- "tableName": "manufacturing_boms",
1493
+ "tableName": "manufacturing_operations",
380
1494
  "conflictColumns": [
381
- "product_id",
382
- "version",
1495
+ "code",
383
1496
  "tenant_id"
384
1497
  ],
385
1498
  "api": {
386
1499
  "include": [
387
1500
  "list",
388
- "get",
389
- "create",
390
- "update"
1501
+ "get"
391
1502
  ]
392
1503
  },
393
1504
  "mcp": {
@@ -396,34 +1507,34 @@
396
1507
  "get"
397
1508
  ]
398
1509
  },
399
- "cli": true,
1510
+ "cli": {
1511
+ "include": [
1512
+ "list",
1513
+ "get"
1514
+ ]
1515
+ },
400
1516
  "tenantScoped": {
401
1517
  "mode": "optional"
402
1518
  }
403
1519
  },
404
1520
  "extends": "SmrtObject",
405
- "exportName": "BillOfMaterials",
406
- "collectionExportName": "BillOfMaterialsCollection",
1521
+ "exportName": "Operation",
1522
+ "collectionExportName": "OperationCollection",
407
1523
  "validationRules": [
408
1524
  {
409
- "field": "productId",
1525
+ "field": "code",
410
1526
  "rule": "required",
411
1527
  "fieldType": "text"
412
1528
  },
413
1529
  {
414
- "field": "version",
415
- "rule": "required",
416
- "fieldType": "integer"
417
- },
418
- {
419
- "field": "status",
1530
+ "field": "name",
420
1531
  "rule": "required",
421
1532
  "fieldType": "text"
422
1533
  }
423
1534
  ],
424
1535
  "schema": {
425
- "tableName": "manufacturing_boms",
426
- "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);",
1536
+ "tableName": "manufacturing_operations",
1537
+ "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);",
427
1538
  "columns": {
428
1539
  "id": {
429
1540
  "type": "UUID",
@@ -456,78 +1567,78 @@
456
1567
  "notNull": false,
457
1568
  "unique": false
458
1569
  },
459
- "product_id": {
1570
+ "code": {
460
1571
  "type": "TEXT",
461
1572
  "notNull": true,
462
1573
  "unique": false,
463
1574
  "default": ""
464
1575
  },
465
- "version": {
466
- "type": "INTEGER",
467
- "notNull": true,
468
- "unique": false,
469
- "default": 1
470
- },
471
- "effective_date": {
472
- "type": "TIMESTAMP",
473
- "notNull": false,
474
- "unique": false
475
- },
476
- "status": {
1576
+ "name": {
477
1577
  "type": "TEXT",
478
1578
  "notNull": true,
479
1579
  "unique": false,
480
- "default": "draft"
1580
+ "default": ""
481
1581
  },
482
- "notes": {
1582
+ "category": {
483
1583
  "type": "TEXT",
484
1584
  "notNull": false,
485
1585
  "unique": false,
486
1586
  "default": ""
487
1587
  },
488
- "currency": {
489
- "type": "TEXT",
1588
+ "is_active": {
1589
+ "type": "BOOLEAN",
490
1590
  "notNull": false,
491
1591
  "unique": false,
492
- "default": "USD"
1592
+ "default": true
1593
+ },
1594
+ "required_qualification_id": {
1595
+ "type": "UUID",
1596
+ "referenceKind": "crossPackageRef",
1597
+ "notNull": false,
1598
+ "unique": false
493
1599
  }
494
1600
  },
495
1601
  "indexes": [
496
1602
  {
497
- "name": "manufacturing_boms_product_id_version_idx",
1603
+ "name": "manufacturing_operations_code_tenant_id_idx",
498
1604
  "columns": [
499
- "product_id",
500
- "version",
1605
+ "code",
501
1606
  "tenant_id"
502
1607
  ],
503
1608
  "unique": true,
504
1609
  "nullsNotDistinct": true
505
1610
  },
506
1611
  {
507
- "name": "manufacturing_boms_slug_context_idx",
1612
+ "name": "manufacturing_operations_slug_context_idx",
508
1613
  "columns": [
509
1614
  "slug",
510
1615
  "context"
511
1616
  ]
512
1617
  },
513
1618
  {
514
- "name": "manufacturing_boms_tenant_id_created_at_idx",
1619
+ "name": "manufacturing_operations_tenant_id_created_at_idx",
515
1620
  "columns": [
516
1621
  "tenant_id",
517
1622
  "created_at"
518
1623
  ]
1624
+ },
1625
+ {
1626
+ "name": "manufacturing_operations_required_qualification_id_idx",
1627
+ "columns": [
1628
+ "required_qualification_id"
1629
+ ]
519
1630
  }
520
1631
  ],
521
- "version": "b2691adc"
1632
+ "version": "0b3134d6"
522
1633
  },
523
1634
  "importPath": "@happyvertical/smrt-manufacturing"
524
1635
  },
525
- "@happyvertical/smrt-manufacturing:BomLine": {
526
- "name": "bomline",
527
- "className": "BomLine",
528
- "qualifiedName": "@happyvertical/smrt-manufacturing:BomLine",
529
- "collection": "bomlines",
530
- "filePath": "/home/runner/work/smrt/smrt/packages/manufacturing/src/models/BomLine.ts",
1636
+ "@happyvertical/smrt-manufacturing:RoutingStep": {
1637
+ "name": "routingstep",
1638
+ "className": "RoutingStep",
1639
+ "qualifiedName": "@happyvertical/smrt-manufacturing:RoutingStep",
1640
+ "collection": "routingsteps",
1641
+ "filePath": "/home/runner/work/smrt/smrt/packages/manufacturing/src/models/RoutingStep.ts",
531
1642
  "packageName": "@happyvertical/smrt-manufacturing",
532
1643
  "fields": {
533
1644
  "tenantId": {
@@ -549,32 +1660,32 @@
549
1660
  }
550
1661
  },
551
1662
  "bomId": {
552
- "type": "text",
1663
+ "type": "foreignKey",
553
1664
  "required": true,
554
- "default": "",
1665
+ "related": "BillOfMaterials",
555
1666
  "_meta": {
556
- "required": true
1667
+ "required": true,
1668
+ "onDelete": "CASCADE"
557
1669
  }
558
1670
  },
559
- "componentSkuId": {
560
- "type": "text",
1671
+ "operationId": {
1672
+ "type": "foreignKey",
561
1673
  "required": true,
562
- "default": "",
1674
+ "related": "Operation",
563
1675
  "_meta": {
564
- "required": true
1676
+ "required": true,
1677
+ "onDelete": "RESTRICT"
565
1678
  }
566
1679
  },
567
- "qtyPerUnit": {
568
- "type": "decimal",
569
- "required": false,
570
- "_meta": {}
571
- },
572
- "uom": {
573
- "type": "text",
574
- "required": false,
575
- "default": "each"
1680
+ "sequence": {
1681
+ "type": "integer",
1682
+ "required": true,
1683
+ "default": 1,
1684
+ "_meta": {
1685
+ "required": true
1686
+ }
576
1687
  },
577
- "wastePercent": {
1688
+ "estimatedMinutes": {
578
1689
  "type": "decimal",
579
1690
  "required": false,
580
1691
  "_meta": {}
@@ -585,29 +1696,18 @@
585
1696
  "default": ""
586
1697
  }
587
1698
  },
588
- "methods": {
589
- "effectiveQtyPerUnit": {
590
- "name": "effectiveQtyPerUnit",
591
- "async": false,
592
- "parameters": [],
593
- "returnType": "number",
594
- "isStatic": false,
595
- "isPublic": true
596
- }
597
- },
1699
+ "methods": {},
598
1700
  "decoratorConfig": {
599
- "tableName": "manufacturing_bom_lines",
1701
+ "tableName": "manufacturing_routing_steps",
600
1702
  "conflictColumns": [
601
1703
  "bom_id",
602
- "component_sku_id",
1704
+ "sequence",
603
1705
  "tenant_id"
604
1706
  ],
605
1707
  "api": {
606
1708
  "include": [
607
1709
  "list",
608
- "get",
609
- "create",
610
- "update"
1710
+ "get"
611
1711
  ]
612
1712
  },
613
1713
  "mcp": {
@@ -624,23 +1724,28 @@
624
1724
  }
625
1725
  },
626
1726
  "extends": "SmrtObject",
627
- "exportName": "BomLine",
628
- "collectionExportName": "BomLineCollection",
1727
+ "exportName": "RoutingStep",
1728
+ "collectionExportName": "RoutingStepCollection",
629
1729
  "validationRules": [
630
1730
  {
631
1731
  "field": "bomId",
632
1732
  "rule": "required",
633
- "fieldType": "text"
1733
+ "fieldType": "foreignKey"
634
1734
  },
635
1735
  {
636
- "field": "componentSkuId",
1736
+ "field": "operationId",
637
1737
  "rule": "required",
638
- "fieldType": "text"
1738
+ "fieldType": "foreignKey"
1739
+ },
1740
+ {
1741
+ "field": "sequence",
1742
+ "rule": "required",
1743
+ "fieldType": "integer"
639
1744
  }
640
1745
  ],
641
1746
  "schema": {
642
- "tableName": "manufacturing_bom_lines",
643
- "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);",
1747
+ "tableName": "manufacturing_routing_steps",
1748
+ "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);",
644
1749
  "columns": {
645
1750
  "id": {
646
1751
  "type": "UUID",
@@ -674,29 +1779,36 @@
674
1779
  "unique": false
675
1780
  },
676
1781
  "bom_id": {
677
- "type": "TEXT",
1782
+ "type": "UUID",
1783
+ "referenceKind": "foreignKey",
678
1784
  "notNull": true,
679
1785
  "unique": false,
680
- "default": ""
1786
+ "foreignKey": {
1787
+ "table": "manufacturing_boms",
1788
+ "column": "id",
1789
+ "onDelete": "CASCADE",
1790
+ "onUpdate": "CASCADE"
1791
+ }
681
1792
  },
682
- "component_sku_id": {
683
- "type": "TEXT",
1793
+ "operation_id": {
1794
+ "type": "UUID",
1795
+ "referenceKind": "foreignKey",
684
1796
  "notNull": true,
685
1797
  "unique": false,
686
- "default": ""
687
- },
688
- "qty_per_unit": {
689
- "type": "REAL",
690
- "notNull": false,
691
- "unique": false
1798
+ "foreignKey": {
1799
+ "table": "manufacturing_operations",
1800
+ "column": "id",
1801
+ "onDelete": "RESTRICT",
1802
+ "onUpdate": "CASCADE"
1803
+ }
692
1804
  },
693
- "uom": {
694
- "type": "TEXT",
695
- "notNull": false,
1805
+ "sequence": {
1806
+ "type": "INTEGER",
1807
+ "notNull": true,
696
1808
  "unique": false,
697
- "default": "each"
1809
+ "default": 1
698
1810
  },
699
- "waste_percent": {
1811
+ "estimated_minutes": {
700
1812
  "type": "REAL",
701
1813
  "notNull": false,
702
1814
  "unique": false
@@ -710,31 +1822,37 @@
710
1822
  },
711
1823
  "indexes": [
712
1824
  {
713
- "name": "manufacturing_bom_lines_bom_id_component_sku_id_idx",
1825
+ "name": "manufacturing_routing_steps_bom_id_sequence_idx",
714
1826
  "columns": [
715
1827
  "bom_id",
716
- "component_sku_id",
1828
+ "sequence",
717
1829
  "tenant_id"
718
1830
  ],
719
1831
  "unique": true,
720
1832
  "nullsNotDistinct": true
721
1833
  },
722
1834
  {
723
- "name": "manufacturing_bom_lines_slug_context_idx",
1835
+ "name": "manufacturing_routing_steps_slug_context_idx",
724
1836
  "columns": [
725
1837
  "slug",
726
1838
  "context"
727
1839
  ]
728
1840
  },
729
1841
  {
730
- "name": "manufacturing_bom_lines_tenant_id_created_at_idx",
1842
+ "name": "manufacturing_routing_steps_tenant_id_created_at_idx",
731
1843
  "columns": [
732
1844
  "tenant_id",
733
1845
  "created_at"
734
1846
  ]
1847
+ },
1848
+ {
1849
+ "name": "manufacturing_routing_steps_operation_id_idx",
1850
+ "columns": [
1851
+ "operation_id"
1852
+ ]
735
1853
  }
736
1854
  ],
737
- "version": "cfbae7e8"
1855
+ "version": "41ac3c66"
738
1856
  },
739
1857
  "importPath": "@happyvertical/smrt-manufacturing"
740
1858
  }
@@ -742,7 +1860,9 @@
742
1860
  "moduleType": "smrt",
743
1861
  "smrtDependencies": [
744
1862
  "@happyvertical/smrt-core",
1863
+ "@happyvertical/smrt-fields",
745
1864
  "@happyvertical/smrt-inventory",
1865
+ "@happyvertical/smrt-products",
746
1866
  "@happyvertical/smrt-tenancy"
747
1867
  ]
748
1868
  }