reference security-revieweradministrator

Notification Retention Policy

Version: v1 Date: 2026-04-21 Scope: OpenGov Phase 2D + Phase 2E notification data. Authority: Council Critic identified this as non-negotiable pre-merge. Country-DPA overrides permitted via environment configuration.

notification_deliveries

Retained 24 months from created_at for statutory recordkeeping. After 24 months, body_html_rendered and body_text_rendered are set to NULL and subject_rendered is replaced with the constant string <redacted>. Row survives for audit metadata (status, timestamps, classified_error); PII is removed.

Per-country override: OPENGOV_NOTIFICATION_DELIVERIES_RETENTION_MONTHS. Morocco CNDP deployments set this to 12.

notification_test_log

Retained 30 days from created_at (matches Phase 2D §15.7). Hard DELETE — no redaction. These are dispatch previews, not applicant records.

eapproval_notification_threads

Lifecycle bound to eapproval_applications. When an application is deleted, the thread row is CASCADE-deleted. No independent retention.

notifications_health_snapshots

Retained 90 days from refreshed_at. Only aggregate statistics; no PII. Older rows are pruned by a daily Procrastinate job (prune_notification_health_snapshots) that runs at 03:00 deployment local time.

Right to erasure

Applicant-initiated erasure under Zitadel-sub delete endpoint (DELETE /api/eapproval/applicants/me) cascades to notification_deliveries via recipient_user_id FK (applicant-field deliveries store the applicant’s ID in eapproval_applications.applicant_id rather than notification_deliveries.recipient_user_id, so the cascade runs through the application FK chain) and to threads via application_id. Health snapshots are unaffected (aggregate only, no per-user data).

Per-country DPO-requested erasure is handled by ops via the python scripts/erase_applicant.py <user_sub> tool, which logs the erasure to platform_audit_log with reason code dpo_request.

Country-specific overrides

Every retention period above has an env-var override. Deployment operators in jurisdictions with stricter DPAs (e.g., Morocco CNDP, Tunisia INPDP, Mauritius DPC) must set the shorter value in their deployment config before enabling Phase 2E.

VariableDefault
OPENGOV_NOTIFICATION_DELIVERIES_RETENTION_MONTHS24
OPENGOV_NOTIFICATION_TEST_LOG_RETENTION_DAYS30
OPENGOV_NOTIFICATION_HEALTH_SNAPSHOT_RETENTION_DAYS90

Review cycle

This policy is reviewed annually or whenever a new country deployment onboards. Changes require the concept owner + deployment-country DPO sign-off.