Product Cost Roll Governance System
Overview
This document outlines a comprehensive Product Cost Roll Governance framework to control changes to Bill of Materials (BOM) and Routing, enforce an approval workflow, and maintain a full audit trail. The goal is to prevent unauthorized or unvetted changes from impacting standard product costs during cost rolls (e.g., in ERP systems like SAP, Oracle, or custom manufacturing software).
Key Principles:
- Change Isolation: All BOM/routing changes are versioned and isolated until fully approved.
- Multi-Level Approvals: Configurable workflow based on change impact (e.g., cost variance >5%, material type).
- Auditability: Immutable logs of all actions, decisions, and outcomes.
- Automation: Integrate with cost roll processes to block unapproved changes.
Tech Stack Recommendation:
- Backend: Node.js/Python (Flask/Django) or Java Spring Boot.
- Database: PostgreSQL (for relational data + JSONB for flexible audit logs).
- Workflow Engine: Camunda, Zeebe, or Temporal for stateful workflows.
- Frontend: React/Vue.js for change submission/approval UI.
- Integration: APIs for ERP cost roll triggers (e.g., REST/SOAP).
1. Data Model
Core entities to support governance:
| Entity | Key Fields | Purpose |
|---|
| Product | id, name, current_cost_version_id | Links to active BOM/routing/cost. |
| BOM_Version | id, product_id, version (e.g., '1.2'), status (draft/approved/active), created_by, created_at, items[] (JSON: {material_id, qty, cost}) | Versioned snapshots of BOM. |
| Routing_Version | id, product_id, version, status, operations[] (JSON: {operation_id, labor_hrs, machine_hrs, overhead_rate}) | Versioned production routings. |
| Change_Request | id, product_id, type (BOM/Routing/Both), proposed_bom_version_id, proposed_routing_version_id, impact_summary (JSON: {cost_delta, affected_products}), status (draft/submitted/approved/rejected), submitted_by, submitted_at | Tracks proposed changes. |
| Approval | id, change_request_id, approver_user_id, level (1-Engineering, 2-Costing, 3-Finance), decision (approve/reject), comments, timestamp | Per-level approval records. |
| Cost_Roll | id, product_id, from_version, to_version, rolled_at, rolled_by, total_cost, variances[] | Logs executed cost rolls. |
| Audit_Log | id, entity_id (change_req/bom/etc.), action (create/update/approve/roll), actor_user_id, old_value (JSON), new_value (JSON), timestamp, ip_address | Immutable trail (append-only). |
Schema Example (PostgreSQL):
CREATE TABLE audit_log (
id SERIAL PRIMARY KEY,
entity_type VARCHAR(50),
entity_id BIGINT,
action VARCHAR(20),
actor_user_id BIGINT,
old_value JSONB,
new_value JSONB,
timestamp TIMESTAMPTZ DEFAULT NOW(),
ip_address INET
);
-- Triggers for auto-auditing
CREATE OR REPLACE FUNCTION audit_trigger()
RETURNS TRIGGER AS $$
BEGIN
INSERT INTO audit_log (entity_type, entity_id, action, actor_user_id, old_value, new_value)
VALUES (TG_TABLE_NAME, COALESCE(OLD.id, NEW.id), TG_OP, current_setting('app.current_user_id')::BIGINT,
row_to_json(OLD), row_to_json(NEW));
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
-- Apply to relevant tables
CREATE TRIGGER bom_version_audit AFTER INSERT OR UPDATE OR DELETE ON bom_version FOR EACH ROW EXECUTE FUNCTION audit_trigger();
2. Approval Workflow
Configurable, state-based workflow with escalation.
Workflow States
Draft → Submitted → [Level 1: Engineering] → [Level 2: Costing] → [Level 3: Finance (if cost_delta >5%)] → Approved → Active
↓ (Reject at any level → Rejected)
Rules for Routing/Levels
| Change Impact | Levels Required | Auto-Escalation |
|---|
| Cost delta <1% | Level 1 only | None |
| 1-5% | Levels 1-2 | Notify manager if >24h |
| >5% or Safety/Regulatory | Levels 1-3 | CC Legal/Exec |
Workflow Engine Implementation (Pseudocode with Camunda BPMN-like Logic)
// Node.js + Camunda/Zeebe example
async function submitChangeRequest(changeReq) {
const impact = calculateImpact(changeReq.proposedBOM, changeReq.proposedRouting); // Compute cost delta
const processInstance = await workflowEngine.startProcess('cost-roll-approval', {
changeReqId: changeReq.id,
levels: impact.costDelta > 0.05 ? 3 : 2
});
// Task Assignment
await assignTask(processInstance, 'level1_engineering', findApprovers('engineering'));
}
async function handleApproval(decision, comments, userId) {
const task = await workflowEngine.completeTask(currentTaskId, { decision, comments, userId });
if (decision === 'approve') {
if (allLevelsApproved(task.changeReqId)) {
activateVersions(task.changeReqId); // Promote to active
notifyCostRollTeam();
}
}
}
UI Flows:
- Submitter: Form to propose changes (upload Excel/JSON, preview impact).
- Approver: Dashboard with tasks, diff viewer (old vs. new BOM/routing), approve/reject with comments.
- Notifications: Email/Slack on submission, reminders, escalations.
3. Cost Roll Integration
Preventive Controls:
- API Gate: All BOM/routing updates route through
Change_Request.
- Version Locking: Active versions are read-only.
4. Audit Trail & Reporting
Implementation Roadmap
- Week 1: Design DB schema, implement audit triggers.
- Week 2: Build Change_Request CRUD + basic workflow.
- Week 3: Approval UI + notifications.
- Week 4: Integrate cost roll validation, testing.
- Ongoing: Config UI for workflow rules, RBAC (roles: submitter/approver/admin).
Potential Enhancements
- AI Impact Analysis: Use ML to predict cost deltas/risks.
- Bulk Changes: For mass product updates.
- Integration: SAP ME / Oracle APICS plugins.
This framework ensures robust governance, reducing cost errors by 90%+ in similar implementations. For code repo setup or customizations, provide more details on your ERP/stack!