Treatment Plan — events
Scaffolded stub — replace with proper documentation when this module is next touched.
Per-module slice of docs/events-catalog.md (auto-generated). Update both files when adding or removing events.
Published
| Event | When | Payload |
|---|---|---|
treatment_plan.budget_sync_requested | When does this fire? | Payload keys. |
treatment_plan.created | When does this fire? | Payload keys. |
treatment_plan.status_changed | When does this fire? | Payload keys. |
treatment_plan.treatment_added | A PlannedTreatmentItem is added to a plan via POST /treatment-plans/{id}/items. | plan_id, item_id, treatment_id, clinic_id, patient_id, budget_id (nullable), catalog_item_id (nullable), tooth_number (nullable), surfaces (nullable), unit_price (nullable, decimal-as-string), assigned_professional_id (nullable, snapshot of the doctor responsible for this line). |
treatment_plan.treatment_completed | When does this fire? | Payload keys. |
treatment_plan.treatment_removed | When does this fire? | Payload keys. |
Subscribed
| Event | Handler | Effect |
|---|---|---|
appointment.completed | Handler module path. | What it does in response. |
budget.accepted | Handler module path. | What it does in response. |
budget.rejected | Handler module path. | What it does in response. |
budget.renegotiated | Handler module path. | What it does in response. |
odontogram.treatment.performed | Handler module path. | What it does in response. |
Adding a new event
- Add the constant to
backend/app/core/events/types.py(EventType). - Publish from a service method, after the DB commit succeeds.
- Add the row to the table(s) above.
- Run
python backend/scripts/generate_catalogs.pyto refresh the global catalog.