purchase_orders — events
Per-module slice of docs/events-catalog.md (auto-generated). Update both files when adding or removing events.
Published
All three are published inside the same transaction as the change (ADR 0019), so transactional subscribers see the uncommitted row and roll back with it.
| Event | Payload |
|---|---|
purchase_order.created | (clinic_id, order_id, supplier_id, status) |
purchase_order.status_changed | (clinic_id, order_id, supplier_id, from_status, status) |
purchase_order.received | (clinic_id, order_id, supplier_id, receipt_id, applied[{inventory_item_id, quantity}], fully_received) |
No bundled subscriber today. inventory_reorder (#227-4) does not subscribe: its suggestions are recomputed on demand from stock and open POs, so receipts self-correct the list. supplier_ratings (#227-5) is the venue for quality deductions derived from applied/quality.
Subscribed
This module does not subscribe to any events.
Adding a new event
- Add the constant to
backend/app/core/events/types.py(EventType). - Publish from a service method, inside the transaction after the change.
- Add the row to the table(s) above.
- Run
python backend/scripts/generate_catalogs.pyto refresh the global catalog.