Document GDPR compliance evidence and consent audit trail
epic-geographic-peer-mentor-map-consent-privacy-task-011 — Produce developer documentation covering: the consent data model and its mapping to GDPR Articles 6 and 9, the audit log schema and retention policy, the revocation and deletion procedure including confirmation that no location data persists post-revocation, the consent version lifecycle, and the privacy policy link configuration per organisation. Documentation must be sufficient to support a GDPR audit by any of the three partner organisations.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 7 - 84 tasks
Can start after Tier 6 completes
Implementation Notes
Structure the document as a Markdown file at docs/gdpr/consent-compliance.md with clear sections: (1) Legal Basis Mapping, (2) Data Model Reference, (3) Audit Log Schema & Retention, (4) Revocation & Deletion Procedure, (5) Consent Version Lifecycle, (6) Per-Organisation Privacy Policy Configuration, (7) Data Minimisation Guarantee, (8) Test Evidence Index. For the legal basis mapping, consult the Norwegian Data Protection Authority (Datatilsynet) guidance on special category health data — the three partner organisations (NHF, Blindeforbundet, HLF) all handle disability-related data which qualifies as Article 9. The re-consent trigger (e.g. privacy policy version bump) must be described precisely because it directly affects the UI flow.
Reference the exact Supabase table and column names as implemented, not abstract names, so the document stays accurate as the schema evolves.
Testing Requirements
No automated tests for the documentation itself. However, the document must be reviewed by one developer who was not the author (peer review) and signed off by the project lead before being accepted.
Optionally, create a lightweight compliance_checklist_test.dart that queries the live (staging) database to assert: consent_audit_log has a retention trigger defined, mentor_locations has zero rows for a known revoked mentor ID (using a seeded test mentor). This acts as executable compliance evidence.
If the privacy policy text or consent terms change after mentors have already opted in, existing consent records may become legally insufficient, requiring re-consent from all opted-in mentors which could temporarily reduce map coverage.
Mitigation & Contingency
Mitigation: Store a consent_version field on every consent record. Implement a consent version check in location-consent-service that compares the stored version against the current policy version from location-privacy-config and flags stale consents for re-consent prompting.
Contingency: If a policy update invalidates existing consents, suppress affected mentors from the map, queue them for re-consent notification via the existing in-app notification system, and restore map visibility only after new consent is recorded.
A poorly designed consent dialog may lead to low opt-in rates, reducing map utility for coordinators to the point where the feature delivers insufficient value to justify maintenance cost.
Mitigation & Contingency
Mitigation: Follow plain-language writing guidelines from the cognitive accessibility feature. User-test the dialog with 2-3 peer mentors from Blindeforbundet before implementation is finalised. Ensure the dialog explains the benefit to the mentor, not just the data collection facts.
Contingency: If opt-in rate after launch is below 40%, conduct a targeted usability study and iterate on dialog copy and layout. The coordinator can also send a bulk opt-in invitation notification (per the user story) to non-consenting mentors.