@tailor-platform/erp-kit 0.5.0 → 0.6.0
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/CHANGELOG.md +24 -0
- package/dist/cli.mjs +139 -35
- package/package.json +1 -1
- package/skills/erp-kit-app-5-impl-backend/SKILL.md +10 -5
- package/skills/erp-kit-app-7-impl-review/SKILL.md +1 -1
- package/skills/erp-kit-module-6-impl-review/SKILL.md +39 -17
- package/src/commands/generate-doc.ts +1 -1
- package/src/commands/init-module.test.ts +17 -3
- package/src/commands/init-module.ts +0 -12
- package/src/commands/lib/discovery.test.ts +13 -3
- package/src/commands/lib/discovery.ts +10 -2
- package/src/commands/lib/paths.ts +4 -2
- package/src/commands/lib/sync-check-tests.test.ts +84 -6
- package/src/commands/lib/sync-check-tests.ts +63 -3
- package/src/commands/sync-check.ts +7 -3
- package/src/generator/generate-app-code.ts +51 -16
- package/src/generator/generate-code-boilerplate.test.ts +9 -1
- package/src/generator/generate-stubs.ts +4 -0
- package/src/generator/scaffold.ts +6 -2
- package/src/generator/stub-templates.test.ts +11 -0
- package/src/generator/stub-templates.ts +22 -1
- package/src/mdschema.ts +39 -3
- package/src/modules/inventory/docs/features/inventory-adjustment.md +2 -1
- package/src/modules/inventory/docs/features/scrap-management.md +39 -1
- package/src/modules/manufacturing/README.md +63 -0
- package/src/modules/manufacturing/command/activateBillOfMaterial.generated.ts +6 -0
- package/src/modules/manufacturing/command/activateBillOfMaterial.test.ts +166 -0
- package/src/modules/manufacturing/command/activateBillOfMaterial.ts +173 -0
- package/src/modules/manufacturing/command/activateRouting.generated.ts +6 -0
- package/src/modules/manufacturing/command/activateRouting.test.ts +152 -0
- package/src/modules/manufacturing/command/activateRouting.ts +92 -0
- package/src/modules/manufacturing/command/activateWorkCenter.generated.ts +6 -0
- package/src/modules/manufacturing/command/activateWorkCenter.test.ts +135 -0
- package/src/modules/manufacturing/command/activateWorkCenter.ts +91 -0
- package/src/modules/manufacturing/command/cancelProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/cancelProductionOrder.test.ts +151 -0
- package/src/modules/manufacturing/command/cancelProductionOrder.ts +114 -0
- package/src/modules/manufacturing/command/closeProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/closeProductionOrder.test.ts +126 -0
- package/src/modules/manufacturing/command/closeProductionOrder.ts +87 -0
- package/src/modules/manufacturing/command/completeProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/completeProductionOrder.test.ts +132 -0
- package/src/modules/manufacturing/command/completeProductionOrder.ts +97 -0
- package/src/modules/manufacturing/command/completeWorkOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/completeWorkOrder.test.ts +369 -0
- package/src/modules/manufacturing/command/completeWorkOrder.ts +212 -0
- package/src/modules/manufacturing/command/createBillOfMaterial.generated.ts +6 -0
- package/src/modules/manufacturing/command/createBillOfMaterial.test.ts +210 -0
- package/src/modules/manufacturing/command/createBillOfMaterial.ts +176 -0
- package/src/modules/manufacturing/command/createProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/createProductionOrder.test.ts +160 -0
- package/src/modules/manufacturing/command/createProductionOrder.ts +129 -0
- package/src/modules/manufacturing/command/createRouting.generated.ts +6 -0
- package/src/modules/manufacturing/command/createRouting.test.ts +168 -0
- package/src/modules/manufacturing/command/createRouting.ts +128 -0
- package/src/modules/manufacturing/command/createWorkCenter.generated.ts +6 -0
- package/src/modules/manufacturing/command/createWorkCenter.test.ts +148 -0
- package/src/modules/manufacturing/command/createWorkCenter.ts +131 -0
- package/src/modules/manufacturing/command/deactivateBillOfMaterial.generated.ts +6 -0
- package/src/modules/manufacturing/command/deactivateBillOfMaterial.test.ts +103 -0
- package/src/modules/manufacturing/command/deactivateBillOfMaterial.ts +78 -0
- package/src/modules/manufacturing/command/deactivateRouting.generated.ts +6 -0
- package/src/modules/manufacturing/command/deactivateRouting.test.ts +112 -0
- package/src/modules/manufacturing/command/deactivateRouting.ts +76 -0
- package/src/modules/manufacturing/command/deactivateWorkCenter.generated.ts +6 -0
- package/src/modules/manufacturing/command/deactivateWorkCenter.test.ts +113 -0
- package/src/modules/manufacturing/command/deactivateWorkCenter.ts +85 -0
- package/src/modules/manufacturing/command/pauseWorkOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/pauseWorkOrder.test.ts +118 -0
- package/src/modules/manufacturing/command/pauseWorkOrder.ts +82 -0
- package/src/modules/manufacturing/command/recordInventoryIssueOutcome.generated.ts +6 -0
- package/src/modules/manufacturing/command/recordInventoryIssueOutcome.test.ts +183 -0
- package/src/modules/manufacturing/command/recordInventoryIssueOutcome.ts +139 -0
- package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.generated.ts +6 -0
- package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.test.ts +120 -0
- package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.ts +110 -0
- package/src/modules/manufacturing/command/releaseProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/releaseProductionOrder.test.ts +220 -0
- package/src/modules/manufacturing/command/releaseProductionOrder.ts +450 -0
- package/src/modules/manufacturing/command/reopenProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/reopenProductionOrder.test.ts +196 -0
- package/src/modules/manufacturing/command/reopenProductionOrder.ts +98 -0
- package/src/modules/manufacturing/command/reportWorkOrderProgress.generated.ts +6 -0
- package/src/modules/manufacturing/command/reportWorkOrderProgress.test.ts +204 -0
- package/src/modules/manufacturing/command/reportWorkOrderProgress.ts +129 -0
- package/src/modules/manufacturing/command/rescheduleProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/rescheduleProductionOrder.test.ts +185 -0
- package/src/modules/manufacturing/command/rescheduleProductionOrder.ts +95 -0
- package/src/modules/manufacturing/command/resumeWorkOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/resumeWorkOrder.test.ts +122 -0
- package/src/modules/manufacturing/command/resumeWorkOrder.ts +94 -0
- package/src/modules/manufacturing/command/reviewManufacturingCostSummary.generated.ts +6 -0
- package/src/modules/manufacturing/command/reviewManufacturingCostSummary.test.ts +231 -0
- package/src/modules/manufacturing/command/reviewManufacturingCostSummary.ts +137 -0
- package/src/modules/manufacturing/command/startWorkOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/startWorkOrder.test.ts +118 -0
- package/src/modules/manufacturing/command/startWorkOrder.ts +126 -0
- package/src/modules/manufacturing/command/technicallyCompleteProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/technicallyCompleteProductionOrder.test.ts +153 -0
- package/src/modules/manufacturing/command/technicallyCompleteProductionOrder.ts +106 -0
- package/src/modules/manufacturing/command/unreleaseProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/unreleaseProductionOrder.test.ts +140 -0
- package/src/modules/manufacturing/command/unreleaseProductionOrder.ts +131 -0
- package/src/modules/manufacturing/command/updateBillOfMaterial.generated.ts +6 -0
- package/src/modules/manufacturing/command/updateBillOfMaterial.test.ts +149 -0
- package/src/modules/manufacturing/command/updateBillOfMaterial.ts +174 -0
- package/src/modules/manufacturing/command/updateProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/updateProductionOrder.test.ts +112 -0
- package/src/modules/manufacturing/command/updateProductionOrder.ts +145 -0
- package/src/modules/manufacturing/command/updateRouting.generated.ts +6 -0
- package/src/modules/manufacturing/command/updateRouting.test.ts +211 -0
- package/src/modules/manufacturing/command/updateRouting.ts +124 -0
- package/src/modules/manufacturing/command/updateWorkCenter.generated.ts +6 -0
- package/src/modules/manufacturing/command/updateWorkCenter.test.ts +152 -0
- package/src/modules/manufacturing/command/updateWorkCenter.ts +137 -0
- package/src/modules/manufacturing/db/.gitkeep +0 -0
- package/src/modules/manufacturing/db/billOfMaterial.ts +70 -0
- package/src/modules/manufacturing/db/billOfMaterialLine.ts +49 -0
- package/src/modules/manufacturing/db/costVarianceLine.ts +53 -0
- package/src/modules/manufacturing/db/manufacturingCostLine.ts +35 -0
- package/src/modules/manufacturing/db/manufacturingCostSettlementRecord.ts +39 -0
- package/src/modules/manufacturing/db/manufacturingCostSummary.ts +59 -0
- package/src/modules/manufacturing/db/productionOrder.ts +83 -0
- package/src/modules/manufacturing/db/productionOrderBomSnapshot.ts +44 -0
- package/src/modules/manufacturing/db/productionOrderCostBaseline.ts +44 -0
- package/src/modules/manufacturing/db/productionOrderMaterialRequirement.ts +57 -0
- package/src/modules/manufacturing/db/productionOrderRoutingSnapshot.ts +43 -0
- package/src/modules/manufacturing/db/routing.ts +63 -0
- package/src/modules/manufacturing/db/routingOperation.ts +57 -0
- package/src/modules/manufacturing/db/workCenter.ts +87 -0
- package/src/modules/manufacturing/db/workOrder.ts +65 -0
- package/src/modules/manufacturing/db/workOrderExecutionEvent.ts +54 -0
- package/src/modules/manufacturing/docs/commands/ActivateBillOfMaterial.md +50 -0
- package/src/modules/manufacturing/docs/commands/ActivateRouting.md +48 -0
- package/src/modules/manufacturing/docs/commands/ActivateWorkCenter.md +49 -0
- package/src/modules/manufacturing/docs/commands/CancelProductionOrder.md +48 -0
- package/src/modules/manufacturing/docs/commands/CloseProductionOrder.md +46 -0
- package/src/modules/manufacturing/docs/commands/CompleteProductionOrder.md +48 -0
- package/src/modules/manufacturing/docs/commands/CompleteWorkOrder.md +66 -0
- package/src/modules/manufacturing/docs/commands/CreateBillOfMaterial.md +54 -0
- package/src/modules/manufacturing/docs/commands/CreateProductionOrder.md +49 -0
- package/src/modules/manufacturing/docs/commands/CreateRouting.md +50 -0
- package/src/modules/manufacturing/docs/commands/CreateWorkCenter.md +51 -0
- package/src/modules/manufacturing/docs/commands/DeactivateBillOfMaterial.md +45 -0
- package/src/modules/manufacturing/docs/commands/DeactivateRouting.md +45 -0
- package/src/modules/manufacturing/docs/commands/DeactivateWorkCenter.md +45 -0
- package/src/modules/manufacturing/docs/commands/PauseWorkOrder.md +44 -0
- package/src/modules/manufacturing/docs/commands/RecordInventoryIssueOutcome.md +59 -0
- package/src/modules/manufacturing/docs/commands/RecordManufacturingCostSettlementAcknowledgment.md +49 -0
- package/src/modules/manufacturing/docs/commands/ReleaseProductionOrder.md +57 -0
- package/src/modules/manufacturing/docs/commands/ReopenProductionOrder.md +54 -0
- package/src/modules/manufacturing/docs/commands/ReportWorkOrderProgress.md +53 -0
- package/src/modules/manufacturing/docs/commands/RescheduleProductionOrder.md +45 -0
- package/src/modules/manufacturing/docs/commands/ResumeWorkOrder.md +44 -0
- package/src/modules/manufacturing/docs/commands/ReviewManufacturingCostSummary.md +52 -0
- package/src/modules/manufacturing/docs/commands/StartWorkOrder.md +46 -0
- package/src/modules/manufacturing/docs/commands/TechnicallyCompleteProductionOrder.md +51 -0
- package/src/modules/manufacturing/docs/commands/UnreleaseProductionOrder.md +46 -0
- package/src/modules/manufacturing/docs/commands/UpdateBillOfMaterial.md +48 -0
- package/src/modules/manufacturing/docs/commands/UpdateProductionOrder.md +48 -0
- package/src/modules/manufacturing/docs/commands/UpdateRouting.md +52 -0
- package/src/modules/manufacturing/docs/commands/UpdateWorkCenter.md +48 -0
- package/src/modules/manufacturing/docs/features/bill-of-material-management.md +83 -0
- package/src/modules/manufacturing/docs/features/manufacturing-cost-and-variance.md +191 -0
- package/src/modules/manufacturing/docs/features/production-order-lifecycle.md +103 -0
- package/src/modules/manufacturing/docs/features/routing-and-work-center-definition.md +63 -0
- package/src/modules/manufacturing/docs/features/work-order-execution.md +115 -0
- package/src/modules/manufacturing/docs/models/BillOfMaterial.md +60 -0
- package/src/modules/manufacturing/docs/models/ManufacturingCostSummary.md +66 -0
- package/src/modules/manufacturing/docs/models/ProductionOrder.md +76 -0
- package/src/modules/manufacturing/docs/models/Routing.md +58 -0
- package/src/modules/manufacturing/docs/models/WorkCenter.md +56 -0
- package/src/modules/manufacturing/docs/models/WorkOrder.md +63 -0
- package/src/modules/manufacturing/docs/queries/DetectBillOfMaterialCircularReference.md +39 -0
- package/src/modules/manufacturing/docs/queries/ExplodeBillOfMaterial.md +56 -0
- package/src/modules/manufacturing/docs/queries/GetBillOfMaterial.md +37 -0
- package/src/modules/manufacturing/docs/queries/GetManufacturingCostSummary.md +39 -0
- package/src/modules/manufacturing/docs/queries/GetProductionOrder.md +37 -0
- package/src/modules/manufacturing/docs/queries/GetRouting.md +39 -0
- package/src/modules/manufacturing/docs/queries/GetWorkCenter.md +35 -0
- package/src/modules/manufacturing/docs/queries/GetWorkOrder.md +38 -0
- package/src/modules/manufacturing/docs/queries/ListBillOfMaterialsByItem.md +42 -0
- package/src/modules/manufacturing/docs/queries/ListManufacturingCostSummariesByStatus.md +41 -0
- package/src/modules/manufacturing/docs/queries/ListProductionOrdersByStatus.md +41 -0
- package/src/modules/manufacturing/docs/queries/ListRoutingsByItem.md +42 -0
- package/src/modules/manufacturing/docs/queries/ListWorkCentersBySite.md +38 -0
- package/src/modules/manufacturing/docs/queries/ListWorkOrdersByProductionOrder.md +39 -0
- package/src/modules/manufacturing/docs/queries/ListWorkOrdersByWorkCenter.md +43 -0
- package/src/modules/manufacturing/executor/.gitkeep +0 -0
- package/src/modules/manufacturing/generated/enums.ts +113 -0
- package/src/modules/manufacturing/generated/kysely-tailordb.ts +247 -0
- package/src/modules/manufacturing/index.ts +2 -0
- package/src/modules/manufacturing/lib/_db_deps.ts +22 -0
- package/src/modules/manufacturing/lib/errors.generated.ts +592 -0
- package/src/modules/manufacturing/lib/permissions.generated.ts +35 -0
- package/src/modules/manufacturing/lib/types.ts +111 -0
- package/src/modules/manufacturing/module.ts +226 -0
- package/src/modules/manufacturing/permissions.ts +3 -0
- package/src/modules/manufacturing/query/.gitkeep +0 -0
- package/src/modules/manufacturing/query/detectBillOfMaterialCircularReference.generated.ts +5 -0
- package/src/modules/manufacturing/query/detectBillOfMaterialCircularReference.test.ts +115 -0
- package/src/modules/manufacturing/query/detectBillOfMaterialCircularReference.ts +79 -0
- package/src/modules/manufacturing/query/explodeBillOfMaterial.generated.ts +5 -0
- package/src/modules/manufacturing/query/explodeBillOfMaterial.test.ts +445 -0
- package/src/modules/manufacturing/query/explodeBillOfMaterial.ts +306 -0
- package/src/modules/manufacturing/query/getBillOfMaterial.generated.ts +5 -0
- package/src/modules/manufacturing/query/getBillOfMaterial.test.ts +64 -0
- package/src/modules/manufacturing/query/getBillOfMaterial.ts +27 -0
- package/src/modules/manufacturing/query/getManufacturingCostSummary.generated.ts +5 -0
- package/src/modules/manufacturing/query/getManufacturingCostSummary.test.ts +147 -0
- package/src/modules/manufacturing/query/getManufacturingCostSummary.ts +46 -0
- package/src/modules/manufacturing/query/getProductionOrder.generated.ts +5 -0
- package/src/modules/manufacturing/query/getProductionOrder.test.ts +139 -0
- package/src/modules/manufacturing/query/getProductionOrder.ts +84 -0
- package/src/modules/manufacturing/query/getRouting.generated.ts +5 -0
- package/src/modules/manufacturing/query/getRouting.test.ts +71 -0
- package/src/modules/manufacturing/query/getRouting.ts +34 -0
- package/src/modules/manufacturing/query/getWorkCenter.generated.ts +5 -0
- package/src/modules/manufacturing/query/getWorkCenter.test.ts +37 -0
- package/src/modules/manufacturing/query/getWorkCenter.ts +21 -0
- package/src/modules/manufacturing/query/getWorkOrder.generated.ts +5 -0
- package/src/modules/manufacturing/query/getWorkOrder.test.ts +73 -0
- package/src/modules/manufacturing/query/getWorkOrder.ts +28 -0
- package/src/modules/manufacturing/query/listBillOfMaterialsByItem.generated.ts +5 -0
- package/src/modules/manufacturing/query/listBillOfMaterialsByItem.test.ts +107 -0
- package/src/modules/manufacturing/query/listBillOfMaterialsByItem.ts +58 -0
- package/src/modules/manufacturing/query/listManufacturingCostSummariesByStatus.generated.ts +5 -0
- package/src/modules/manufacturing/query/listManufacturingCostSummariesByStatus.test.ts +96 -0
- package/src/modules/manufacturing/query/listManufacturingCostSummariesByStatus.ts +77 -0
- package/src/modules/manufacturing/query/listProductionOrdersByStatus.generated.ts +5 -0
- package/src/modules/manufacturing/query/listProductionOrdersByStatus.test.ts +121 -0
- package/src/modules/manufacturing/query/listProductionOrdersByStatus.ts +83 -0
- package/src/modules/manufacturing/query/listRoutingsByItem.generated.ts +5 -0
- package/src/modules/manufacturing/query/listRoutingsByItem.test.ts +110 -0
- package/src/modules/manufacturing/query/listRoutingsByItem.ts +54 -0
- package/src/modules/manufacturing/query/listWorkCentersBySite.generated.ts +5 -0
- package/src/modules/manufacturing/query/listWorkCentersBySite.test.ts +81 -0
- package/src/modules/manufacturing/query/listWorkCentersBySite.ts +70 -0
- package/src/modules/manufacturing/query/listWorkOrdersByProductionOrder.generated.ts +5 -0
- package/src/modules/manufacturing/query/listWorkOrdersByProductionOrder.test.ts +102 -0
- package/src/modules/manufacturing/query/listWorkOrdersByProductionOrder.ts +53 -0
- package/src/modules/manufacturing/query/listWorkOrdersByWorkCenter.generated.ts +5 -0
- package/src/modules/manufacturing/query/listWorkOrdersByWorkCenter.test.ts +143 -0
- package/src/modules/manufacturing/query/listWorkOrdersByWorkCenter.ts +56 -0
- package/src/modules/manufacturing/seed/index.ts +19 -0
- package/src/modules/manufacturing/tailor.config.ts +13 -0
- package/src/modules/manufacturing/tailor.d.ts +13 -0
- package/src/modules/manufacturing/testing/commandTestUtils.ts +29 -0
- package/src/modules/manufacturing/testing/fixtures.ts +402 -0
- package/templates/scaffold/app/backend/package.json +9 -2
- package/templates/scaffold/app/backend/src/tests/utils/graphql-client.ts +66 -0
- package/templates/scaffold/app/backend/src/tests/utils/setup.ts +21 -0
- package/templates/scaffold/app/backend/tsconfig.json +9 -2
- package/templates/scaffold/app/backend/vitest.config.ts +35 -0
- package/templates/scaffold/app/frontend/package.json +2 -2
- package/templates/scaffold/module/__dot__gitignore +3 -0
- package/templates/scaffold/module/eslint.config.js +31 -0
- package/templates/scaffold/module/generated/kysely-tailordb.ts +3 -0
- package/templates/scaffold/module/lib/types.ts +1 -6
- package/templates/scaffold/module/package.json +26 -0
- package/templates/scaffold/module/tsconfig.json +16 -0
- /package/{templates/scaffold/module/generated → src/modules/manufacturing/command}/.gitkeep +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Bill of Material Management
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Bill of Material Management defines the production recipe for a finished good or subassembly. A `BillOfMaterial` specifies which component items are required, in what quantities and units, under which version or effectivity window, with which expected scrap assumptions, and with which `bomType` explosion behavior. The feature supports multi-level manufacturing by allowing a component line to reference another manufactured item that has its own BOM.
|
|
6
|
+
|
|
7
|
+
The BOM is manufacturing-owned master data, distinct from product templates and item identity. Product-management may describe the commercial definition of a product, and item-management owns the SKU that transactions reference, but manufacturing owns the recipe used to turn component stock into finished output. Production orders resolve and snapshot a BOM version at release time so future engineering changes do not silently alter in-flight work.
|
|
8
|
+
|
|
9
|
+
Each `BillOfMaterial` must declare `bomType` as one of `MANUFACTURE`, `PHANTOM`, or `KIT`:
|
|
10
|
+
|
|
11
|
+
- `MANUFACTURE`: The parent item is produced through the normal manufacturing path. BOM explosion preserves the parent as a make item, and released production orders may create lower-level production demand for manufactured child components according to planning policy.
|
|
12
|
+
- `PHANTOM`: The parent item is a logical subassembly used for engineering structure, but manufacturing does not create a separate production order, WIP bucket, or finished-stock receipt for the phantom itself. BOM explosion flattens the phantom's child lines directly into the nearest released parent production order.
|
|
13
|
+
- `KIT`: The parent item is an issue or packaging structure, not a shop-floor build recipe. BOM explosion produces component demand and picking or issue requirements only; it does not create routing-based work orders or a standalone manufacturing execution path for the kit parent.
|
|
14
|
+
|
|
15
|
+
## Business Purpose
|
|
16
|
+
|
|
17
|
+
- Provide a single manufacturing-owned source of truth for how a finished good or subassembly is built
|
|
18
|
+
- Support multi-level production by reusing subassembly BOMs inside higher-level BOMs
|
|
19
|
+
- Classify BOMs by explosion behavior so the same structural master data can support make, phantom, and kit scenarios without redesign
|
|
20
|
+
- Preserve engineering change control through versions and effectivity windows rather than destructive edits
|
|
21
|
+
- Enable material requirement explosion for production-order planning and inventory handoff
|
|
22
|
+
- Capture expected scrap or yield assumptions used for planning and variance comparison
|
|
23
|
+
- Prevent inactive, circular, or invalid component structures from entering production execution
|
|
24
|
+
|
|
25
|
+
## Process Flow
|
|
26
|
+
|
|
27
|
+
```mermaid
|
|
28
|
+
flowchart TD
|
|
29
|
+
A[Create BillOfMaterial] --> B[Select finished item and company or site scope]
|
|
30
|
+
B --> C[Set bomType: MANUFACTURE, PHANTOM, or KIT]
|
|
31
|
+
C --> D[Add component lines with quantity, UoM, and scrap factor]
|
|
32
|
+
D --> E{Subassembly component?}
|
|
33
|
+
E -->|Yes| F[Reference manufactured child item BOM]
|
|
34
|
+
E -->|No| G[Use purchased or stocked component]
|
|
35
|
+
F --> H[Validate structure, effectivity, and circular references]
|
|
36
|
+
G --> H
|
|
37
|
+
H --> I{Valid?}
|
|
38
|
+
I -->|No| J[Correct line or version data]
|
|
39
|
+
J --> D
|
|
40
|
+
I -->|Yes| K[Activate BOM version]
|
|
41
|
+
K --> L[Production order or issue flow selects BOM]
|
|
42
|
+
L --> M{bomType?}
|
|
43
|
+
M -->|MANUFACTURE| N[Keep parent make item and snapshot recipe]
|
|
44
|
+
M -->|PHANTOM| O[Flatten child components into nearest parent order]
|
|
45
|
+
M -->|KIT| P[Explode to component issue list without work orders]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Scenario Patterns
|
|
49
|
+
|
|
50
|
+
- **Standard assembly recipe**: A planner defines the component list and quantities for a finished good that is assembled repeatedly using the same standard recipe
|
|
51
|
+
- **Multi-level subassembly reuse**: A manufactured subassembly is defined once and referenced by several parent BOMs so planning can explode common lower-level demand consistently
|
|
52
|
+
- **Phantom subassembly flattening**: A logical intermediate assembly is maintained for engineering readability, but its children are exploded directly into the parent production order without generating a separate shop-floor order
|
|
53
|
+
- **Kit structure definition**: A bundled item keeps a BOM-owned component list for issue or packaging purposes while explicitly bypassing routing-based manufacturing execution
|
|
54
|
+
- **Engineering revision cutover**: A new BOM version becomes effective on a future date while the previous version remains valid for already released production orders
|
|
55
|
+
- **Site-specific recipe difference**: The same finished item has different default component mix or yield assumptions at two sites due to local equipment or supplier differences
|
|
56
|
+
- **Scrap-aware planning**: A BOM line includes expected process loss so planned component requirements better match real production behavior
|
|
57
|
+
- **Change freeze at release**: A production order snapshots the active BOM at release time so later BOM edits do not mutate in-flight manufacturing instructions
|
|
58
|
+
|
|
59
|
+
The `bomType` classification is part of the released BOM snapshot. A released order must preserve not only the selected component structure, but also the explosion semantics that were in force when the order was released. Later edits to convert a BOM from `PHANTOM` to `MANUFACTURE`, or from `KIT` to `MANUFACTURE`, must not retroactively rewire previously released orders.
|
|
60
|
+
|
|
61
|
+
## Test Cases
|
|
62
|
+
|
|
63
|
+
- Creating a BOM for an ACTIVE finished item with at least one ACTIVE component line should succeed
|
|
64
|
+
- A BOM must require `bomType` to be one of `MANUFACTURE`, `PHANTOM`, or `KIT`
|
|
65
|
+
- A BOM line must require a positive component quantity and a unit of measure compatible with the component item definition
|
|
66
|
+
- A BOM must reject direct or indirect circular references between parent and child manufactured items
|
|
67
|
+
- Overlapping active BOM effectivity windows for the same finished item and scope should be rejected unless one version is explicitly non-default
|
|
68
|
+
- Inactive items must not be added as new BOM components
|
|
69
|
+
- A BOM can reference both stocked raw materials and manufactured subassemblies
|
|
70
|
+
- Releasing a `MANUFACTURE` BOM should preserve the parent item as a producible order output rather than flattening it away
|
|
71
|
+
- Releasing a `PHANTOM` BOM should flatten its child requirements into the nearest non-phantom parent order and must not create a separate production-order requirement for the phantom parent
|
|
72
|
+
- Selecting a `KIT` BOM should explode component demand without generating routing-based work orders for the kit parent
|
|
73
|
+
- Editing a BOM that is already snapshotted by a released production order must not change the snapshotted order recipe
|
|
74
|
+
- Editing `bomType` on an active BOM after release must not mutate the type semantics already snapshotted onto open production orders
|
|
75
|
+
- Deactivating a BOM version used by open production orders may prevent new selection but must not invalidate existing snapshots
|
|
76
|
+
- BOM explosion for a multi-level structure should produce the correct lower-level component requirements
|
|
77
|
+
- Only authorized manufacturing users should be able to create, revise, activate, or deactivate BOM versions
|
|
78
|
+
|
|
79
|
+
## Reference Links
|
|
80
|
+
|
|
81
|
+
- [Odoo Manufacturing BOM configuration](https://www.odoo.com/documentation/19.0/applications/inventory_and_mrp/manufacturing/basic_setup/bill_configuration.html)
|
|
82
|
+
- [Oracle Manufacturing work definitions overview](https://docs.oracle.com/en/cloud/saas/supply-chain-and-manufacturing/25c/faumf/how-you-create-work-definitions.html)
|
|
83
|
+
- [Rootstock manufacturing ERP overview](https://www.rootstock.com/manufacturing-erp-software/)
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Manufacturing Cost and Variance
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Manufacturing Cost and Variance captures the planned and actual cost footprint of a production order without taking ownership of accounting postings. At release time, the module snapshots expected component, labor, machine, and overhead assumptions based on the selected BOM, routing, work-center rates, and inventory-owned planned material cost resolution. During execution, it accumulates actual material consumption values sourced from the named `InventoryIssueOutcomeEvent` contract plus actual time and quantity data from work orders.
|
|
6
|
+
|
|
7
|
+
The feature compares actual results against the plan and classifies manufacturing variance so downstream accounting can decide how to post it. Manufacturing owns cost visibility at the order and operation level, including WIP-oriented progress context, but it does not create journal entries, settle balances, or close accounting periods. Those responsibilities remain outside the module. Manufacturing does, however, own the operational review lifecycle that blocks order close until variance review is complete and downstream accounting has acknowledged the settlement handoff.
|
|
8
|
+
|
|
9
|
+
Planned overhead is not entered ad hoc per production order. It is derived from the overhead absorption policy configured on each referenced `WorkCenter`, then snapshotted onto the production order at release alongside labor and machine assumptions. This keeps overhead calculation deterministic and aligned to the capacity resource that drives the cost.
|
|
10
|
+
|
|
11
|
+
Planned material cost is also not maintained as an editable manufacturing-owned field on BOM component lines in the initial scope. Manufacturing resolves the planned unit cost for each component from inventory-owned valuation data at release time, snapshots the resolved amount onto the production order cost baseline, and preserves that baseline even if valuation settings later change.
|
|
12
|
+
|
|
13
|
+
## Business Purpose
|
|
14
|
+
|
|
15
|
+
- Give planners and supervisors visibility into whether production is running to expected cost
|
|
16
|
+
- Preserve the standard or planned cost assumptions that were in force when work was released
|
|
17
|
+
- Distinguish price, usage, rate, efficiency, scrap, and yield-related variances at a level that downstream accounting can map to separate review or posting treatment
|
|
18
|
+
- Support WIP-style progress visibility without forcing manufacturing to own general-ledger behavior
|
|
19
|
+
- Provide a downstream accounting handoff contract backed by operational evidence rather than manual spreadsheet reconciliation
|
|
20
|
+
- Make post-order review and continuous improvement possible through cost and variance history
|
|
21
|
+
- Use an explicit overhead absorption rule so planned and actual overhead can be reproduced consistently during review
|
|
22
|
+
|
|
23
|
+
## Process Flow
|
|
24
|
+
|
|
25
|
+
```mermaid
|
|
26
|
+
flowchart TD
|
|
27
|
+
A[Release Production Order] --> B[Snapshot planned material, labor, machine, and overhead cost]
|
|
28
|
+
B --> C[Execute material issues through inventory]
|
|
29
|
+
C --> D[Inventory emits InventoryIssueOutcomeEvent when issue valuation is final]
|
|
30
|
+
D --> E[Collect actual time and quantity from work orders]
|
|
31
|
+
E --> F[Accumulate actual cost by production order]
|
|
32
|
+
F --> G{Order completed?}
|
|
33
|
+
G -->|No| H[Show in-progress WIP-style cost view]
|
|
34
|
+
G -->|Yes| I[Order becomes TECHNICALLY_COMPLETE]
|
|
35
|
+
I --> J[PENDING_VARIANCE_REVIEW]
|
|
36
|
+
J --> K[Compare planned vs actual]
|
|
37
|
+
K --> L[Classify price, usage, rate, efficiency, scrap, and yield variance]
|
|
38
|
+
L --> M[VARIANCE_REVIEWED]
|
|
39
|
+
M --> N[Publish reviewed manufacturing cost summary for downstream accounting]
|
|
40
|
+
N --> O[SETTLED after downstream settlement acknowledgment]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Each production order owns one manufacturing cost summary that moves through a named lifecycle after execution is frozen. The initial scope uses these states:
|
|
44
|
+
|
|
45
|
+
- `COLLECTING`: Planned baseline is snapshotted and actual material, labor, machine, and overhead evidence is still accumulating while the order is `RELEASED`, `IN_PROGRESS`, or `COMPLETED`
|
|
46
|
+
- `PENDING_VARIANCE_REVIEW`: The production order has reached `TECHNICALLY_COMPLETE`, final variance can be calculated, and review is required before administrative close
|
|
47
|
+
- `VARIANCE_REVIEWED`: An authorized reviewer has approved the final planned-versus-actual comparison, variance classification, and downstream handoff payload
|
|
48
|
+
- `SETTLED`: Downstream accounting or financial close processing has acknowledged the reviewed handoff and the order is now eligible for final administrative close
|
|
49
|
+
|
|
50
|
+
The allowed transitions are:
|
|
51
|
+
|
|
52
|
+
- `COLLECTING -> PENDING_VARIANCE_REVIEW`
|
|
53
|
+
- `PENDING_VARIANCE_REVIEW -> VARIANCE_REVIEWED`
|
|
54
|
+
- `VARIANCE_REVIEWED -> SETTLED`
|
|
55
|
+
|
|
56
|
+
The following enforcement rules apply:
|
|
57
|
+
|
|
58
|
+
- A production order entering `TECHNICALLY_COMPLETE` must move its linked cost summary to `PENDING_VARIANCE_REVIEW`
|
|
59
|
+
- `VARIANCE_REVIEWED` requires final variance recalculation against the frozen order baseline and an explicit reviewer action by a manufacturing or finance-review role
|
|
60
|
+
- `SETTLED` requires a named downstream acknowledgment that the reviewed variance or WIP handoff was consumed by the accounting-owned settlement process; manufacturing records the acknowledgment but does not post the settlement itself
|
|
61
|
+
- A production order must not transition from `TECHNICALLY_COMPLETE` to `CLOSED` until the linked cost summary is `SETTLED`
|
|
62
|
+
- If execution must resume after review begins, the production order must be reopened and the cost summary must return to `COLLECTING` or a superseded draft state through a controlled workflow
|
|
63
|
+
|
|
64
|
+
## Scenario Patterns
|
|
65
|
+
|
|
66
|
+
- **Standard-cost comparison**: A production order is released using standard component and work-center assumptions, then reviewed against actual execution cost after completion
|
|
67
|
+
- **Labor rate change**: Actual labor is booked at a different rate than the snapped standard, and the delta is isolated from pure time-overrun effects
|
|
68
|
+
- **Labor or machine overrun**: An operation takes materially longer than its standard time, and the excess resource consumption is exposed as an efficiency variance instead of being mixed into a rate variance
|
|
69
|
+
- **Material price change**: Inventory issues the same planned quantity at a different actual unit valuation than the snapped standard, and the delta is tracked separately from quantity over-consumption
|
|
70
|
+
- **Material loss variance**: Actual issued component quantity exceeds the BOM expectation because of setup loss, damage, or poor yield, and the excess is tracked as usage rather than price variance
|
|
71
|
+
- **Scrap-heavy production run**: Scrap reported during execution inflates actual cost per good unit and is classified separately from normal usage
|
|
72
|
+
- **In-progress cost visibility**: Supervisors review cost accumulation on an order that has started but not yet completed to see whether it is trending off plan
|
|
73
|
+
- **Accounting handoff after review**: Manufacturing finishes variance review, publishes summarized planned-versus-actual results for downstream accounting, and waits for settlement acknowledgment before the order can close
|
|
74
|
+
- **Work-center overhead absorption**: Each work center may define one active overhead absorption rule, and released orders snapshot that rule so planned and actual overhead remain reproducible even if work-center master data changes later
|
|
75
|
+
|
|
76
|
+
Manufacturing resolves each component's planned material cost through inventory-owned valuation contracts at release time. The required source rules are:
|
|
77
|
+
|
|
78
|
+
- Manufacturing must query inventory for the component item's active valuation context at the production order's site or company scope
|
|
79
|
+
- If the item's `ValuationPolicy.costingMethod` is `STANDARD_COST`, the planned unit cost must come from inventory's `ValuationPolicy.standardCostRate`
|
|
80
|
+
- If the item's costing method is `AVCO` or `FIFO`, the planned unit cost baseline must come from inventory's current `GetItemValuation.costPerUnit` at release time
|
|
81
|
+
- Manufacturing must snapshot the returned unit cost, currency, valuation method, and source valuation reference onto the released production order and must not recompute the baseline from later inventory changes
|
|
82
|
+
- If inventory cannot resolve planned material cost for a required component, production-order release must be rejected rather than allowing manufacturing to invent a fallback cost
|
|
83
|
+
|
|
84
|
+
This makes inventory the source of truth for planned material valuation while allowing manufacturing to own the frozen release-time baseline used for later variance comparison.
|
|
85
|
+
|
|
86
|
+
Manufacturing consumes actual material cost only through the named `InventoryIssueOutcomeEvent` contract emitted by inventory after a goods issue or backflush movement reaches its inventory-owned final valuation state. The minimum payload is:
|
|
87
|
+
|
|
88
|
+
- `productionOrderReference`
|
|
89
|
+
- `workOrderReference`: optional for issue transactions recorded at order level rather than operation level
|
|
90
|
+
- `inventoryIssueReference`
|
|
91
|
+
- `itemReference`
|
|
92
|
+
- `issuedQuantity`
|
|
93
|
+
- `unitOfMeasure`
|
|
94
|
+
- `actualUnitCost`
|
|
95
|
+
- `actualExtendedCost`
|
|
96
|
+
- `currency`
|
|
97
|
+
- `valuationMethod`
|
|
98
|
+
- `postingDate`
|
|
99
|
+
- `siteReference`
|
|
100
|
+
|
|
101
|
+
Optional and conditional fields:
|
|
102
|
+
|
|
103
|
+
- `inventoryLotReference`: optional unless the issued quantity is lot-specific and manufacturing needs lot-cost traceability
|
|
104
|
+
- `costLayerReferences`: optional list of cost-layer identifiers when valuation methods such as FIFO require traceability to multiple inventory layers
|
|
105
|
+
- `issueMode`: optional classification such as `MANUAL_ISSUE` or `BACKFLUSH` for cost analysis without changing the financial result
|
|
106
|
+
|
|
107
|
+
Inventory emits `InventoryIssueOutcomeEvent` only after the issue transaction is accepted, executed, and valued by inventory-owned logic. Manufacturing must not infer actual material cost from the issue request itself, from open stock movements, or from duplicated valuation formulas. If inventory rejects or has not yet valued the issue, manufacturing keeps the material cost pending rather than manufacturing its own fallback amount.
|
|
108
|
+
|
|
109
|
+
When a cost summary reaches `VARIANCE_REVIEWED`, manufacturing publishes the reviewed settlement handoff to downstream accounting and waits for the named `ManufacturingCostSettlementAcknowledgment` contract before allowing the summary to move to `SETTLED`. The acknowledgment contract is owned and emitted by the downstream accounting or financial-close module or service, not by manufacturing. Manufacturing may persist the received acknowledgment for auditability, but it must not fabricate, edit, or mark the acknowledgment as received through a manufacturing-only toggle.
|
|
110
|
+
|
|
111
|
+
The minimum `ManufacturingCostSettlementAcknowledgment` payload is:
|
|
112
|
+
|
|
113
|
+
- `productionOrderReference`
|
|
114
|
+
- `costSummaryReference`
|
|
115
|
+
- `settledByReference`
|
|
116
|
+
- `settlementDate`
|
|
117
|
+
- `currency`
|
|
118
|
+
|
|
119
|
+
Optional and conditional fields:
|
|
120
|
+
|
|
121
|
+
- `settlementReference`: optional downstream settlement batch, journal, or close-run identifier used to trace the accounting-side action
|
|
122
|
+
- `settledAmount`: optional when accounting settles an explicit amount and required if downstream policy allows partial or currency-translated settlement evidence
|
|
123
|
+
- `companyReference`: optional when company scope is derivable from the production order and required otherwise
|
|
124
|
+
- `siteReference`: optional when the settlement applies at company scope rather than site scope
|
|
125
|
+
- `variancePostingReference`: optional identifier for the downstream posting or variance document created from the reviewed handoff
|
|
126
|
+
|
|
127
|
+
The following contract rules apply:
|
|
128
|
+
|
|
129
|
+
- `ManufacturingCostSettlementAcknowledgment` must reference a cost summary already in `VARIANCE_REVIEWED`; an acknowledgment for any earlier lifecycle state is invalid
|
|
130
|
+
- The payload must match the reviewed handoff's `productionOrderReference`, `costSummaryReference`, and settlement currency before manufacturing can transition the cost summary to `SETTLED`
|
|
131
|
+
- If downstream accounting rejects, reverses, or supersedes the reviewed handoff, the cost summary must remain `VARIANCE_REVIEWED` until a valid replacement acknowledgment is received
|
|
132
|
+
- `TECHNICALLY_COMPLETE -> CLOSED` remains blocked until manufacturing records a valid `ManufacturingCostSettlementAcknowledgment` for the linked cost summary
|
|
133
|
+
|
|
134
|
+
The `CostVariance` taxonomy must be granular enough to avoid mixing price deltas with usage or efficiency deltas. The initial scope replaces the coarse `material` and `labor_machine` buckets with the following categories:
|
|
135
|
+
|
|
136
|
+
- `MATERIAL_PRICE`: Actual material unit valuation differs from the snapped planned unit cost for the consumed quantity
|
|
137
|
+
- `MATERIAL_USAGE`: Actual material quantity consumed differs from the BOM-based planned quantity after normalizing to the snapped planned unit cost
|
|
138
|
+
- `LABOR_RATE`: Actual labor cost-per-hour differs from the snapped labor rate for the reported hours
|
|
139
|
+
- `LABOR_EFFICIENCY`: Actual labor hours differ from the snapped standard hours after normalizing to the snapped labor rate
|
|
140
|
+
- `MACHINE_RATE`: Actual machine rate differs from the snapped machine cost rate for the reported machine hours
|
|
141
|
+
- `MACHINE_EFFICIENCY`: Actual machine hours differ from the snapped standard machine hours after normalizing to the snapped machine rate
|
|
142
|
+
- `SCRAP`: Cost attributable to reported scrap transactions that should remain visible separately from normal material usage
|
|
143
|
+
- `YIELD`: Cost impact caused by producing fewer good units than planned after material and resource consumption are applied
|
|
144
|
+
|
|
145
|
+
Each variance category must support a distinct downstream variance-account reference from `coa-management`. Manufacturing owns the classification and reference data needed for handoff, while downstream accounting decides whether to post, aggregate, or settle those balances.
|
|
146
|
+
|
|
147
|
+
Manufacturing supports a single active overhead absorption rule per `WorkCenter`. The policy is owned by manufacturing as part of `WorkCenter` master data because the rate follows the resource or line used to perform work, not the warehouse or accounting module. A work center may define:
|
|
148
|
+
|
|
149
|
+
- `overheadAbsorptionMethod`: one of `PERCENT_OF_LABOR_COST`, `PERCENT_OF_MACHINE_COST`, or `FIXED_AMOUNT_PER_GOOD_UNIT`
|
|
150
|
+
- `overheadAbsorptionRate`: the numeric rate or amount interpreted by the selected method
|
|
151
|
+
- `overheadAbsorptionCurrency`: required when the method is `FIXED_AMOUNT_PER_GOOD_UNIT`
|
|
152
|
+
|
|
153
|
+
The initial scope uses these rules:
|
|
154
|
+
|
|
155
|
+
- `PERCENT_OF_LABOR_COST`: planned or actual overhead equals labor cost multiplied by the configured percentage
|
|
156
|
+
- `PERCENT_OF_MACHINE_COST`: planned or actual overhead equals machine cost multiplied by the configured percentage
|
|
157
|
+
- `FIXED_AMOUNT_PER_GOOD_UNIT`: planned or actual overhead equals good quantity reported multiplied by the configured amount per unit
|
|
158
|
+
|
|
159
|
+
When a production order is released, manufacturing snapshots the resolved work-center overhead method, rate, and currency onto the order or operation cost baseline. Later edits to the work center must not mutate released orders. During execution, actual overhead uses the same snapped method with actual reported labor cost, machine cost, or completed good quantity as the driver. Work centers without an overhead absorption rule contribute zero planned and zero actual overhead.
|
|
160
|
+
|
|
161
|
+
## Test Cases
|
|
162
|
+
|
|
163
|
+
- Releasing a production order must snapshot the planned material and routing-based cost assumptions used for later variance comparison
|
|
164
|
+
- Releasing a production order must resolve each component's planned unit cost from inventory-owned valuation data rather than from a manufacturing-edited BOM cost field
|
|
165
|
+
- A STANDARD_COST component must snapshot inventory `ValuationPolicy.standardCostRate` as its planned unit cost at release
|
|
166
|
+
- An AVCO or FIFO component must snapshot the release-time `GetItemValuation.costPerUnit` returned by inventory as its planned unit cost baseline
|
|
167
|
+
- Production-order release must be rejected when inventory cannot resolve planned material cost for a required component
|
|
168
|
+
- Actual material cost used by manufacturing must come from `InventoryIssueOutcomeEvent` rather than duplicated manufacturing-owned valuation logic
|
|
169
|
+
- `InventoryIssueOutcomeEvent` must not be accepted as actual material cost input until the referenced inventory issue has completed inventory-owned valuation
|
|
170
|
+
- Actual labor or machine cost should derive from reported time and the applicable work-center rates in force for the order snapshot
|
|
171
|
+
- Moving a cost summary to `PENDING_VARIANCE_REVIEW` should require that the parent production order is `TECHNICALLY_COMPLETE`
|
|
172
|
+
- Moving a cost summary to `VARIANCE_REVIEWED` should require an explicit reviewer approval and freeze the reviewed variance breakdown unless the order is reopened
|
|
173
|
+
- Moving a cost summary to `SETTLED` should require a valid `ManufacturingCostSettlementAcknowledgment` rather than a manufacturing-only toggle
|
|
174
|
+
- Planned overhead must derive from the released work center's snapped `overheadAbsorptionMethod` and `overheadAbsorptionRate`
|
|
175
|
+
- Editing a work center's overhead absorption rule after release must not change the planned overhead baseline of an already released production order
|
|
176
|
+
- Actual overhead must use the same snapped absorption method as the plan, substituting actual labor cost, machine cost, or completed good quantity as the driver
|
|
177
|
+
- Planned and actual cost must be tracked independently per production order and company
|
|
178
|
+
- Completing additional work after an order is marked closed should be rejected or require a controlled reopening workflow
|
|
179
|
+
- Variance calculation should separate at minimum `MATERIAL_PRICE`, `MATERIAL_USAGE`, `LABOR_RATE`, `LABOR_EFFICIENCY`, and distinct scrap or yield-related causes rather than combining them into a single material or labor bucket
|
|
180
|
+
- Variance handoff data must retain the variance category and its mapped variance-account reference for every published variance line
|
|
181
|
+
- An in-progress production order should expose accumulated actual cost even before full completion
|
|
182
|
+
- Manufacturing must not create journal entries or mutate GL balances directly as part of variance calculation
|
|
183
|
+
- Downstream accounting handoff data should retain references to the production order, site, finished item, completed quantity, and variance breakdown
|
|
184
|
+
- Manufacturing must not transition a reviewed cost summary to `SETTLED` until `ManufacturingCostSettlementAcknowledgment` is received from the accounting-owned settlement process with matching order and cost-summary references
|
|
185
|
+
- Only authorized manufacturing or finance-review users should be able to finalize cost review, mark the summary `VARIANCE_REVIEWED`, and advance the order toward administrative close
|
|
186
|
+
|
|
187
|
+
## Reference Links
|
|
188
|
+
|
|
189
|
+
- [Oracle work orders overview](https://docs.oracle.com/en/cloud/saas/supply-chain-and-manufacturing/25d/faumf/overview-of-work-orders.html)
|
|
190
|
+
- [MRPeasy manufacturing scheduling and costing overview](https://www.mrpeasy.com/manufacturing-scheduling-software/)
|
|
191
|
+
- [Rootstock manufacturing ERP overview](https://www.rootstock.com/manufacturing-erp-software/)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Production Order Lifecycle
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Production Order Lifecycle governs how a manufacturing request is created, planned, released, executed, and closed. A `ProductionOrder` records what item should be produced, at what quantity, for which company and site, against which BOM and routing definition, and on which planned dates. It is the manufacturing control document that turns a planning decision into executable shop-floor work.
|
|
6
|
+
|
|
7
|
+
The production order tracks both control state and execution progress. Release freezes the selected BOM and routing into an order snapshot, generates operation-level work orders, and prepares material requirements for inventory coordination. Subsequent work-order reporting, material issue, scrap, and completion update production progress until the order is physically completed, marked `TECHNICALLY_COMPLETE` for cost and administrative review, and then formally closed.
|
|
8
|
+
|
|
9
|
+
## Business Purpose
|
|
10
|
+
|
|
11
|
+
- Turn manual planner intent or upstream demand signals into a controlled manufacturing commitment
|
|
12
|
+
- Freeze recipe and process assumptions at release time so execution stays auditable
|
|
13
|
+
- Provide a single source of truth for planned quantity, completed quantity, scrap quantity, and remaining open work
|
|
14
|
+
- Coordinate material readiness, work-order generation, and production scheduling around one document
|
|
15
|
+
- Support make-to-stock and make-to-order scenarios without moving sales or purchasing ownership into manufacturing
|
|
16
|
+
- Prevent incomplete, invalid, or unauthorized production requests from reaching execution
|
|
17
|
+
|
|
18
|
+
## Process Flow
|
|
19
|
+
|
|
20
|
+
```mermaid
|
|
21
|
+
flowchart TD
|
|
22
|
+
A[Create Production Order] --> B[DRAFT]
|
|
23
|
+
B --> C[Select item, quantity, site, BOM, routing, and dates]
|
|
24
|
+
C --> D{Ready to release?}
|
|
25
|
+
D -->|No| C
|
|
26
|
+
D -->|Yes| E[RELEASED]
|
|
27
|
+
E --> F[Snapshot BOM and routing]
|
|
28
|
+
F --> G[Generate work orders and material requirements]
|
|
29
|
+
G --> H{Execution started?}
|
|
30
|
+
H -->|No| I[Remain RELEASED or reschedule]
|
|
31
|
+
H -->|Yes| J[IN_PROGRESS]
|
|
32
|
+
J --> K{Completed quantity and final receipt posted?}
|
|
33
|
+
K -->|No| J
|
|
34
|
+
K -->|Yes| L[COMPLETED]
|
|
35
|
+
L --> M[Freeze execution and mark TECHNICALLY_COMPLETE]
|
|
36
|
+
M --> N[Review variances and administrative exceptions]
|
|
37
|
+
N --> O{Cost review settled?}
|
|
38
|
+
O -->|No| N
|
|
39
|
+
O -->|Yes| P[CLOSED]
|
|
40
|
+
B --> Q[CANCELLED]
|
|
41
|
+
E --> Q
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The `ProductionOrder.status` lifecycle in the initial scope is:
|
|
45
|
+
|
|
46
|
+
- `DRAFT`: Planner can create, edit, or delete the order before any execution commitment exists
|
|
47
|
+
- `RELEASED`: BOM and routing are snapshotted, work orders are generated, and the order is ready for shop-floor execution
|
|
48
|
+
- `IN_PROGRESS`: At least one work order has started or execution evidence exists against the order
|
|
49
|
+
- `COMPLETED`: Physical production is complete because required work orders, final output reporting, and finished-goods receipt handoff have been submitted
|
|
50
|
+
- `TECHNICALLY_COMPLETE`: The order is execution-frozen and no additional production activity is expected, but cost review, variance approval, and downstream accounting handoff are still pending
|
|
51
|
+
- `CLOSED`: Administrative close is finished after the linked manufacturing cost summary reaches its required settled state
|
|
52
|
+
- `CANCELLED`: The order is abandoned before meaningful execution and cannot accept further execution updates
|
|
53
|
+
|
|
54
|
+
The allowed transitions are:
|
|
55
|
+
|
|
56
|
+
- `DRAFT -> RELEASED`
|
|
57
|
+
- `DRAFT -> CANCELLED`
|
|
58
|
+
- `RELEASED -> IN_PROGRESS`
|
|
59
|
+
- `RELEASED -> CANCELLED`
|
|
60
|
+
- `RELEASED -> DRAFT` only through an explicit controlled unrelease or replan workflow if no execution evidence exists
|
|
61
|
+
- `IN_PROGRESS -> COMPLETED`
|
|
62
|
+
- `COMPLETED -> TECHNICALLY_COMPLETE`
|
|
63
|
+
- `TECHNICALLY_COMPLETE -> CLOSED`
|
|
64
|
+
|
|
65
|
+
The following gating rules apply:
|
|
66
|
+
|
|
67
|
+
- `COMPLETED` requires all mandatory work orders complete plus the final output reporting and receipt handoff required by policy
|
|
68
|
+
- `TECHNICALLY_COMPLETE` requires that no additional execution, rescheduling, or material issue is still expected on the order
|
|
69
|
+
- `CLOSED` requires the linked manufacturing cost summary to finish variance review and reach its settled lifecycle state through a recorded `ManufacturingCostSettlementAcknowledgment`
|
|
70
|
+
- Any attempt to resume execution after `TECHNICALLY_COMPLETE` must use a controlled reopen workflow rather than direct shop-floor updates
|
|
71
|
+
|
|
72
|
+
## Scenario Patterns
|
|
73
|
+
|
|
74
|
+
- **Make-to-stock replenishment**: A planner creates a production order to rebuild finished-goods inventory to target levels without linking ownership to a specific sales order
|
|
75
|
+
- **Demand-driven production**: A production order is created in response to prioritized downstream demand while remaining a manufacturing-owned document
|
|
76
|
+
- **Release after shortage review**: A planner keeps the order in draft until material availability and work-center timing are acceptable, then releases it for execution
|
|
77
|
+
- **Reschedule before execution**: A released order is moved to a later date because a bottleneck work center or inbound material is not ready yet
|
|
78
|
+
- **Partial completion**: A production order reports some finished quantity and scrap before the remaining balance is completed later
|
|
79
|
+
- **Cancellation before execution**: A production order is cancelled because demand disappears and no meaningful execution or inventory posting has occurred yet
|
|
80
|
+
- **Technical completion before close**: The order finishes physical production, then enters `TECHNICALLY_COMPLETE` so cost review and downstream settlement can occur without reopening shop-floor execution
|
|
81
|
+
- **Close after review**: The order is closed only after variance review, `ManufacturingCostSettlementAcknowledgment`, and administrative checks are finished
|
|
82
|
+
|
|
83
|
+
## Test Cases
|
|
84
|
+
|
|
85
|
+
- Creating a production order for an ACTIVE manufactured item with positive quantity and valid company or site scope should succeed
|
|
86
|
+
- A production order must not be released without an ACTIVE BOM and ACTIVE routing selection or resolvable default
|
|
87
|
+
- Releasing a production order must snapshot the chosen BOM and routing definitions onto the order
|
|
88
|
+
- Releasing a production order must create the expected work-order structure based on the snapshotted routing operations
|
|
89
|
+
- A cancelled production order must not accept new execution updates
|
|
90
|
+
- Rescheduling a production order should be allowed before execution starts and must remain auditable after release
|
|
91
|
+
- Execution progress on work orders must roll up to production-order started, partial, or completed state correctly
|
|
92
|
+
- Completing a production order should require final output reporting and the finished-goods receipt handoff required by policy
|
|
93
|
+
- Marking a production order `TECHNICALLY_COMPLETE` should require that all planned execution is done and should block further shop-floor reporting unless the order is formally reopened
|
|
94
|
+
- Closing a production order should be blocked while open work orders or unresolved execution exceptions remain
|
|
95
|
+
- Closing a production order should be blocked until the linked manufacturing cost summary reaches `SETTLED` through a valid `ManufacturingCostSettlementAcknowledgment`
|
|
96
|
+
- Production-order data must be isolated by company and must not reference BOMs, routings, or work centers from another company
|
|
97
|
+
- Only authorized manufacturing users should be able to release, cancel, complete, technically complete, or close production orders
|
|
98
|
+
|
|
99
|
+
## Reference Links
|
|
100
|
+
|
|
101
|
+
- [Oracle work orders overview](https://docs.oracle.com/en/cloud/saas/supply-chain-and-manufacturing/25d/faumf/overview-of-work-orders.html)
|
|
102
|
+
- [Odoo manufacturing features](https://www.odoo.com/app/manufacturing-features)
|
|
103
|
+
- [SAP S/4HANA Cloud manufacturing overview](https://help.sap.com/docs/SAP_S4HANA_CLOUD/2bba750d1e124e1ea2a039bb1cd9b6c5/03659e8e0c9d4f37afb3c5f3b37cabc3.html)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Routing and Work Center Definition
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Routing and Work Center Definition captures how manufacturing work is performed and where capacity exists to perform it. A `Routing` defines the ordered set of operations required to produce an item, including sequence, standard setup or run times, instructions, and the work center expected to execute each step. A `WorkCenter` represents the machine, line, cell, or labor pool where operations are scheduled and reported.
|
|
6
|
+
|
|
7
|
+
This feature establishes the execution structure used by production orders and work orders. Routing and work-center data drive planned lead time, operation sequencing, standard labor or machine cost, optional overhead absorption policy, and the work-order breakdown created when a production order is released. The initial scope supports deterministic step sequencing and capacity context, while deferring advanced optimization, parallel routing logic, and outsourced operations.
|
|
8
|
+
|
|
9
|
+
## Business Purpose
|
|
10
|
+
|
|
11
|
+
- Define a repeatable manufacturing process for each produced item or family of items
|
|
12
|
+
- Associate each operation with the capacity and cost context required for planning and execution
|
|
13
|
+
- Support realistic planned duration and standard-cost estimation before work begins
|
|
14
|
+
- Provide operators and supervisors with step-level instructions and expected execution order
|
|
15
|
+
- Create the basis for work-order generation and progress tracking at operation level
|
|
16
|
+
- Prevent production from being released against incomplete or inactive process definitions
|
|
17
|
+
|
|
18
|
+
## Process Flow
|
|
19
|
+
|
|
20
|
+
```mermaid
|
|
21
|
+
flowchart TD
|
|
22
|
+
A[Create WorkCenter] --> B[Set company or site scope, calendar, capacity, and rates]
|
|
23
|
+
B --> C[Activate WorkCenter]
|
|
24
|
+
C --> D[Create Routing]
|
|
25
|
+
D --> E[Add ordered operations with standard times and instructions]
|
|
26
|
+
E --> F[Assign each operation to a WorkCenter]
|
|
27
|
+
F --> G{Valid sequence and active centers?}
|
|
28
|
+
G -->|No| H[Correct routing or work-center data]
|
|
29
|
+
H --> E
|
|
30
|
+
G -->|Yes| I[Activate Routing]
|
|
31
|
+
I --> J[Production order selects routing]
|
|
32
|
+
J --> K[Release creates work orders by operation]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Scenario Patterns
|
|
36
|
+
|
|
37
|
+
- **Single-line assembly flow**: A finished item uses a simple routing with cut, assemble, inspect, and pack operations assigned to distinct work centers
|
|
38
|
+
- **Shared bottleneck center**: Several routings reference the same constrained work center, allowing planners to see where capacity pressure will accumulate
|
|
39
|
+
- **Site-specific process**: The same manufactured item uses different routings at different sites because local equipment or labor specialization differs
|
|
40
|
+
- **Instruction-driven operation**: An operation stores setup notes, drawings, or SOP-style instructions so execution users know the expected method
|
|
41
|
+
- **Standard-time planning**: Standard setup and run time on routing operations provide the planned duration used for release and variance comparison
|
|
42
|
+
- **Resource-based overhead policy**: A work center defines the overhead absorption method and rate used by manufacturing cost snapshots for orders executed on that resource
|
|
43
|
+
- **Controlled process revision**: A routing is revised for future orders while open production orders continue using the snapshotted process they were released with
|
|
44
|
+
|
|
45
|
+
## Test Cases
|
|
46
|
+
|
|
47
|
+
- Creating a work center with a unique code within its company or site scope should succeed
|
|
48
|
+
- A work center must require positive capacity assumptions and must not be activated while missing required calendar or status data
|
|
49
|
+
- Creating a routing with at least one operation assigned to an ACTIVE work center should succeed
|
|
50
|
+
- Routing operation sequence numbers must be unique within the routing
|
|
51
|
+
- An ACTIVE routing must reject references to inactive or cross-company work centers
|
|
52
|
+
- Standard setup and run times on an operation must be zero or greater
|
|
53
|
+
- A work center may define one overhead absorption method and rate, which released production orders snapshot for later cost comparison
|
|
54
|
+
- Releasing a production order should snapshot the selected routing and operation definitions onto generated work orders
|
|
55
|
+
- Editing a routing after a production order is released must not mutate the released order's operation plan
|
|
56
|
+
- Deactivating a work center that is referenced by future routings or open released work should be blocked or require controlled replacement
|
|
57
|
+
- Only authorized manufacturing users should be able to activate, revise, or deactivate work centers and routings
|
|
58
|
+
|
|
59
|
+
## Reference Links
|
|
60
|
+
|
|
61
|
+
- [Odoo work centers and operations](https://www.odoo.com/documentation/19.0/applications/inventory_and_mrp/manufacturing/advanced_configuration/using_work_centers.html)
|
|
62
|
+
- [Oracle Manufacturing work definitions](https://docs.oracle.com/en/cloud/saas/supply-chain-and-manufacturing/25c/faumf/how-you-create-work-definitions.html)
|
|
63
|
+
- [SAP Digital Manufacturing routing documentation](https://help.sap.com/docs/sap-digital-manufacturing/execution/routing)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Work Order Execution
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Work Order Execution tracks the operation-level progress of manufacturing work after a production order is released. A `WorkOrder` represents one executable routing step with assigned work-center context, planned quantity, status, actual start or finish data, and the execution evidence needed to move the parent production order forward. Work orders provide the operational unit for supervisors and operators to start, pause, report, and complete shop-floor activity.
|
|
6
|
+
|
|
7
|
+
This feature also defines how manufacturing coordinates with inventory during execution. Material issue may occur explicitly before work starts or implicitly through backflush on completion, while final or intermediate output completion triggers receipt handoff to inventory. Scrap reported during execution can also trigger an inventory scrap handoff. Manufacturing owns the operational intent and recorded progress; inventory owns stock movement persistence, lot or serial state, and valuation consequences.
|
|
8
|
+
|
|
9
|
+
## Business Purpose
|
|
10
|
+
|
|
11
|
+
- Break a released production order into operation-level executable steps with clear status and ownership
|
|
12
|
+
- Provide auditable tracking of actual start, stop, completion, quantity, time, and scrap at each operation
|
|
13
|
+
- Support both manual material issue and backflush-style material consumption
|
|
14
|
+
- Coordinate finished-goods or intermediate receipt with inventory without embedding warehouse ownership in manufacturing
|
|
15
|
+
- Expose operation-level exceptions that explain why production is late, paused, or under-yielding
|
|
16
|
+
- Roll execution progress into parent production-order status and cost collection
|
|
17
|
+
|
|
18
|
+
## Process Flow
|
|
19
|
+
|
|
20
|
+
```mermaid
|
|
21
|
+
flowchart TD
|
|
22
|
+
A[Production Order Released] --> B[Open Work Orders by Operation]
|
|
23
|
+
B --> C[Start Work Order]
|
|
24
|
+
C --> D{Manual issue required?}
|
|
25
|
+
D -->|Yes| E[Send material issue request to inventory]
|
|
26
|
+
D -->|No| F[Continue execution]
|
|
27
|
+
E --> F
|
|
28
|
+
F --> G[Report time, completed qty, and scrap]
|
|
29
|
+
G --> H{Backflush at completion?}
|
|
30
|
+
H -->|Yes| I[Send backflush issue request to inventory]
|
|
31
|
+
H -->|No| J[Keep manual issue basis]
|
|
32
|
+
I --> J
|
|
33
|
+
J --> K{Final or intermediate output complete?}
|
|
34
|
+
K -->|Yes| L[Send production receipt handoff to inventory]
|
|
35
|
+
K -->|No| M[Move to next operation]
|
|
36
|
+
L --> M
|
|
37
|
+
M --> N{All required operations complete?}
|
|
38
|
+
N -->|No| C
|
|
39
|
+
N -->|Yes| O[Parent Production Order progresses toward completion]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Scenario Patterns
|
|
43
|
+
|
|
44
|
+
- **Pre-issued materials**: Components are issued to the line before the first operation starts, and the work order records execution without backflushing those same quantities again
|
|
45
|
+
- **Backflush assembly**: Standard components are consumed automatically when an operation or order reports completion, reducing operator transaction burden
|
|
46
|
+
- **Partial operation reporting**: An operator reports some completed quantity and some scrap, leaving the work order open for the remaining balance
|
|
47
|
+
- **Paused bottleneck operation**: A work order is started, paused due to machine or staffing constraints, and later resumed with the pause history preserved
|
|
48
|
+
- **Intermediate output step**: A routing produces an intermediate quantity at one operation that must be receipted before the next step continues
|
|
49
|
+
- **Final receipt handoff**: The final operation completes and sends finished-goods receipt intent to inventory while keeping manufacturing as the owner of execution evidence
|
|
50
|
+
- **Manufacturing scrap handoff**: A work order reports nonrecoverable scrap and sends a named scrap contract to inventory so stock and valuation can be reduced through the inventory-owned adjustment flow
|
|
51
|
+
- **Exception note capture**: A supervisor records an exception reason on a delayed or abnormal work order to explain variance and schedule slippage
|
|
52
|
+
|
|
53
|
+
Manufacturing uses two named handoff contracts during execution. `ManufacturingReceiptHandoff` is sent when a work order reports intermediate or finished output that must be receipted into inventory. The minimum payload is:
|
|
54
|
+
|
|
55
|
+
- `productionOrderReference`
|
|
56
|
+
- `workOrderReference`
|
|
57
|
+
- `itemReference`
|
|
58
|
+
- `quantity`
|
|
59
|
+
- `unitOfMeasure`
|
|
60
|
+
- `siteReference`
|
|
61
|
+
- `postingDate`
|
|
62
|
+
|
|
63
|
+
Optional and conditional fields:
|
|
64
|
+
|
|
65
|
+
- `finishedGoodLotReference`: optional for non-lot-tracked items and required when the receipted item is lot-tracked
|
|
66
|
+
- `storageLocationReference`: optional when inventory can derive the receiving location from site or production policy; otherwise required
|
|
67
|
+
- `serialReferences`: required when the receipted item is serial-tracked and serial numbers are assigned before inventory confirmation
|
|
68
|
+
|
|
69
|
+
Inventory owns final lot, serial, and storage persistence. Manufacturing owns only the execution evidence and the handoff intent. The same receipt handoff contract is used for both intermediate and final receipts.
|
|
70
|
+
|
|
71
|
+
`ManufacturingScrapHandoff` is sent when a work order reports scrap that must reduce usable stock in inventory. The minimum payload is:
|
|
72
|
+
|
|
73
|
+
- `productionOrderReference`
|
|
74
|
+
- `workOrderReference`
|
|
75
|
+
- `itemReference`
|
|
76
|
+
- `scrapQuantity`
|
|
77
|
+
- `unitOfMeasure`
|
|
78
|
+
- `scrapReasonCode`
|
|
79
|
+
- `siteReference`
|
|
80
|
+
- `postingDate`
|
|
81
|
+
|
|
82
|
+
Optional and conditional fields:
|
|
83
|
+
|
|
84
|
+
- `sourceStorageLocationReference`: optional when inventory can derive the source location from prior issue or backflush context, or from a site-level manufacturing scrap policy; otherwise required
|
|
85
|
+
- `inventoryLotReference`: required when the scrapped item is lot-tracked
|
|
86
|
+
- `serialReferences`: required when the scrapped item is serial-tracked
|
|
87
|
+
- `scrapDispositionCode`: optional classification used by downstream inventory or accounting policies
|
|
88
|
+
|
|
89
|
+
Manufacturing creates the handoff once per submitted scrap transaction. Inventory is responsible for translating the handoff into an inventory-owned `InventoryAdjustment` approval flow and for rejecting the handoff if location, lot, or serial resolution is incomplete.
|
|
90
|
+
|
|
91
|
+
For any stock-loss event that originates from manufacturing execution and can be traced to a `productionOrderReference` or `workOrderReference`, `ManufacturingScrapHandoff` is the only valid inventory path in the initial scope. A direct inventory `InventoryAdjustment` with reason code `Production Variance` is reserved for fallback situations where the manufacturing module is not deployed or the discrepancy is discovered after the fact with no resolvable manufacturing source document. This rule prevents the same physical production loss from being posted through two asymmetric flows and preserves work-order traceability.
|
|
92
|
+
|
|
93
|
+
## Test Cases
|
|
94
|
+
|
|
95
|
+
- Starting a work order should succeed only when its parent production order is in a releasable execution state
|
|
96
|
+
- A work order must not be completed before it is started unless an explicit bypass policy exists
|
|
97
|
+
- Reported completed quantity and scrap quantity must be zero or greater, and at least one must be positive for a completion transaction
|
|
98
|
+
- Completing a work order must update parent production-order progress correctly
|
|
99
|
+
- Material issue requested manually from manufacturing must call the downstream inventory contract exactly once per submitted issue transaction
|
|
100
|
+
- Backflush consumption must not duplicate quantities already issued manually
|
|
101
|
+
- Final or intermediate receipt handoff payloads must include production-order reference, work-order reference, item reference, quantity, unit of measure, site, and posting date at minimum
|
|
102
|
+
- Receipt handoff must include `finishedGoodLotReference` whenever the receipted item is lot-tracked
|
|
103
|
+
- Reporting positive scrap quantity must emit `ManufacturingScrapHandoff` exactly once per submitted scrap transaction
|
|
104
|
+
- Scrap handoff payloads must include production-order reference, work-order reference, item reference, scrap quantity, unit of measure, scrap reason code, site, and posting date at minimum
|
|
105
|
+
- Manufacturing-originated stock loss with a resolvable production-order or work-order reference must not bypass `ManufacturingScrapHandoff` through a direct inventory adjustment
|
|
106
|
+
- A paused work order must be resumable without losing prior execution history
|
|
107
|
+
- Completing a later sequential operation before a required earlier operation should be rejected unless the routing policy explicitly allows it
|
|
108
|
+
- Work-order execution must remain isolated by company and site context
|
|
109
|
+
- Only authorized manufacturing users should be able to start, pause, resume, report, or complete work orders
|
|
110
|
+
|
|
111
|
+
## Reference Links
|
|
112
|
+
|
|
113
|
+
- [Oracle work orders overview](https://docs.oracle.com/en/cloud/saas/supply-chain-and-manufacturing/25d/faumf/overview-of-work-orders.html)
|
|
114
|
+
- [Odoo work centers and manufacturing execution concepts](https://www.odoo.com/documentation/19.0/applications/inventory_and_mrp/manufacturing/advanced_configuration/using_work_centers.html)
|
|
115
|
+
- [SAP Digital Manufacturing execution routing](https://help.sap.com/docs/sap-digital-manufacturing/execution/routing)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# BillOfMaterial
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
BillOfMaterial stores the manufacturing-owned recipe used to build one finished item or subassembly at company or site scope. It owns version identity, effectivity, `bomType`, default-selection behavior, and the component-line structure that production orders later snapshot at release time.
|
|
6
|
+
|
|
7
|
+
## Domain Model Definitions
|
|
8
|
+
|
|
9
|
+
### Model type
|
|
10
|
+
|
|
11
|
+
Stateful
|
|
12
|
+
|
|
13
|
+
#### State Transitions
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
stateDiagram-v2
|
|
17
|
+
[*] --> Draft: createBillOfMaterial
|
|
18
|
+
Draft --> Draft: updateBillOfMaterial
|
|
19
|
+
Draft --> Active: activateBillOfMaterial
|
|
20
|
+
Active --> Inactive: deactivateBillOfMaterial
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Command Definitions
|
|
24
|
+
|
|
25
|
+
- [createBillOfMaterial](../commands/CreateBillOfMaterial.md) - Create a draft BOM version for one manufactured parent item.
|
|
26
|
+
- [updateBillOfMaterial](../commands/UpdateBillOfMaterial.md) - Revise mutable draft metadata, effectivity, and component lines.
|
|
27
|
+
- [activateBillOfMaterial](../commands/ActivateBillOfMaterial.md) - Validate the draft structure and make the version selectable for release.
|
|
28
|
+
- [deactivateBillOfMaterial](../commands/DeactivateBillOfMaterial.md) - Prevent future selection while preserving existing production-order snapshots.
|
|
29
|
+
|
|
30
|
+
### Query Definitions
|
|
31
|
+
|
|
32
|
+
- [getBillOfMaterial](../queries/GetBillOfMaterial.md) - Retrieve one BOM version with component lines and effectivity details.
|
|
33
|
+
- [explodeBillOfMaterial](../queries/ExplodeBillOfMaterial.md) - Expand one BOM version into multi-level component requirements on a specific effectivity date.
|
|
34
|
+
- [listBillOfMaterialsByItem](../queries/ListBillOfMaterialsByItem.md) - List BOM versions for one parent item and scope.
|
|
35
|
+
- [detectBillOfMaterialCircularReference](../queries/DetectBillOfMaterialCircularReference.md) - Detect direct or indirect loops across manufactured child items.
|
|
36
|
+
|
|
37
|
+
### Models
|
|
38
|
+
|
|
39
|
+
- BillOfMaterial
|
|
40
|
+
- BillOfMaterialLine
|
|
41
|
+
|
|
42
|
+
### Invariants
|
|
43
|
+
|
|
44
|
+
- Every BOM version belongs to exactly one manufactured parent item and one company, with optional site-specific scope.
|
|
45
|
+
- The parent item must be ACTIVE and manufacturable when the BOM is created or activated.
|
|
46
|
+
- `bomType` must always be one of `MANUFACTURE`, `PHANTOM`, or `KIT`.
|
|
47
|
+
- A draft or active BOM contains at least one component line with positive required quantity.
|
|
48
|
+
- Component lines may reference stocked items or manufactured subassemblies, but inactive items cannot appear as newly added components.
|
|
49
|
+
- Active BOM versions may only reference ACTIVE component items.
|
|
50
|
+
- An active BOM must not introduce a direct or indirect circular manufactured-item reference.
|
|
51
|
+
- Overlapping active effectivity windows for the same parent item and scope are allowed only when default-selection rules keep the active version unambiguous.
|
|
52
|
+
- Production-order release snapshots the selected BOM version, lines, and `bomType` semantics so later BOM edits never mutate released work.
|
|
53
|
+
|
|
54
|
+
### Relationships
|
|
55
|
+
|
|
56
|
+
- **References Item (cross-module)**: `parentItemId` and component `itemId` point to [Item](../../../item-management/docs/models/Item.md).
|
|
57
|
+
- **Belongs To Company and optional Site**: scope is constrained by [Company](../../../organization/docs/models/Company.md) and optionally [Site](../../../organization/docs/models/Site.md).
|
|
58
|
+
- **Has Many BillOfMaterialLines**: component structure, scrap assumptions, and subassembly references live under the parent BOM version.
|
|
59
|
+
- **Referenced By ProductionOrder**: [ProductionOrder](./ProductionOrder.md) resolves and snapshots one active BOM version at release.
|
|
60
|
+
- **Depends On primitives**: component and parent quantities use primitives-owned unit-of-measure compatibility.
|