How joysydney/o2c-event-pipeline works
This is an event-driven Order-to-Cash integration pipeline: ERP orders enter through an idempotent API, then move through warehouse fulfillment, carrier delivery, and three-way financial reconciliation. A transactional outbox relay publishes durable events; inbox idempotency, broker dead-letter handling, and reconciliation holds protect against failures and billing discrepancies. The dashboard exposes operational KPIs, orders, and exceptions. Some subsystem details are documented in the README but not sampled; those links are omitted where source evidence does not establish a call.
Main entry points: main.py Order API · outbox_relay.py Outbox Relay · logging_config.py Structured Logging · broker.py Event Broker
Components 12
Order Ingestion
- Order API
app/main.py - Order Schemas
app/schemas.py - Outbox Relay
app/outbox_relay.py - Order Database
db/init.sql
Fulfillment Events
- Event Broker
app/broker.py - WMS Simulator
app/wms_simulator.py - Carrier Simulator
app/carrier_simulator.py
Reconciliation
- Reconciliation Worker
app/reconciliation_worker.py
Operations
- Executive Dashboard
app/dashboard.py - Dead-Letter Manager
app/dlq_manager.py - Structured Logging
app/logging_config.py
Other components
- ERP Client
Connections 23
- ERP Client → Order API: submits orders
README.md - Order API → Order Schemas: validates payload
app/main.py - Order API → Order Database: writes orders
app/main.py - Order API → Outbox Relay: records events
app/main.py - Outbox Relay → Order Database: claims events
app/outbox_relay.py - Outbox Relay → Event Broker: publishes events
app/outbox_relay.py - Event Broker → WMS Simulator: routes orders
app/broker.py - WMS Simulator → Order Database: records shipments
app/wms_simulator.py - WMS Simulator → Outbox Relay: records shipment event
app/wms_simulator.py - Event Broker → Carrier Simulator: routes shipments
app/broker.py - Carrier Simulator → Order Database: records deliveries
app/carrier_simulator.py - Carrier Simulator → Outbox Relay: records delivery event
app/carrier_simulator.py - Event Broker → Reconciliation Worker: routes delivery events
app/broker.py - Reconciliation Worker → Order Database: matches and invoices
app/reconciliation_worker.py - Executive Dashboard → Order API: fetches KPIs and orders
app/dashboard.py - Order API → Executive Dashboard: serves dashboard
app/main.py - Dead-Letter Manager → Event Broker: inspects or replays
app/dlq_manager.py - Order API → Structured Logging: configures logging
app/main.py - Outbox Relay → Structured Logging: configures logging
app/outbox_relay.py - WMS Simulator → Structured Logging: configures logging
app/wms_simulator.py - Carrier Simulator → Structured Logging: configures logging
app/carrier_simulator.py - Reconciliation Worker → Structured Logging: configures logging
app/reconciliation_worker.py - Dead-Letter Manager → Structured Logging: configures logging
app/dlq_manager.py