@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Dynamic.puml

title Inventory to Production Workflow - Dynamic Diagram

Person(staff, "Operations Staff")
Person(owner, "Business Owner")

System(system, "Kell Creations Platform", "Unified business applications and shared services")

Container(inventory, "Inventory Application", "Business Application", "Tracks material and finished goods availability")
Container(mrp, "Craft Manufacturing / MRP", "Business Application", "Creates work orders and manages production planning")
Container(datarepo, "Shared Data Repository", "Shared Service", "Stores shared product, BOM, and inventory reference data")
Container(api, "API Orchestrator", "Integration Service", "Coordinates workflow and application events")
Container(notify, "Notification Service", "Messaging Service", "Sends shortage, readiness, and exception notifications")
Container(audit, "Audit & Logging Service", "Observability Service", "Captures inventory, production, and workflow events")

Rel(staff, inventory, "Reviews stock and material availability in")
Rel(staff, mrp, "Creates and manages production demand in")
Rel(owner, mrp, "Reviews readiness and production priorities in")

Rel(mrp, datarepo, "Reads BOM and production reference data from")
Rel(mrp, inventory, "Requests material allocation and availability check from")
Rel(inventory, mrp, "Returns stock and shortage status to")
Rel(mrp, api, "Publishes work-order and production demand event through")
Rel(mrp, inventory, "Consumes allocated materials and updates finished goods status in")
Rel(api, notify, "Triggers shortage, exception, or readiness notifications through")
Rel(api, audit, "Logs workflow events to")
Rel(inventory, audit, "Logs stock movement and material consumption events to")
Rel(mrp, audit, "Logs work-order and production events to")

@enduml