Skip to content

gdpr — events

Per-module slice of docs/events-catalog.md (auto-generated). Update both files when adding or removing events.

Published

EventWhenPayload keys
gdpr.request.createda data-subject request is createdclinic_id, request_id, patient_id, request_type
gdpr.request.status_changeda DSR status changes (received → in_progress → completed/rejected)clinic_id, request_id, patient_id, from_status, to_status, changed_by
gdpr.consent.granteda consent is recordedclinic_id, consent_id, patient_id, purpose
gdpr.consent.withdrawna consent is withdrawn (same row, granted=false)clinic_id, consent_id, patient_id, purpose
gdpr.erasure.executeda partial erasure ranclinic_id, patient_id, request_id, erased_categories, retained_categories
gdpr.breach.reporteda data-breach report is createdclinic_id, breach_id, affected_people

All events are published by the gdpr service layer after the DB commit succeeds, so optional subscribers (patient_timeline, notifications, audit exports) react to rights lifecycle without importing gdpr models.

Subscribed

This module does not subscribe to any events.

Adding a new event

  1. Add the constant to backend/app/core/events/types.py (EventType).
  2. Publish from a service method, after the DB commit succeeds.
  3. Add the row to the table(s) above.
  4. Run python backend/scripts/generate_catalogs.py to refresh the global catalog.