Skip to content

feat(#6): persist book requests to D1 with audit log and 90-day retention - #76

Open
TheMaestr-o wants to merge 1 commit into
developfrom
feat/6-user-db
Open

feat(#6): persist book requests to D1 with audit log and 90-day retention#76
TheMaestr-o wants to merge 1 commit into
developfrom
feat/6-user-db

Conversation

@TheMaestr-o

Copy link
Copy Markdown
Collaborator

Summary

Persists book delivery requests (submitted via POST /api/v1/book-request) to D1 database instead of being email-only.

  • New book_requests table in D1 — stores name, email, phone, address, book list, language, IP hash (not raw IP)
  • Audit log on every request
  • 90-day retention policy (requests auto-expire)
  • Admin view: GET /api/v1/admin/book-requests — list + delete

⚠️ Security review required before merge — this stores user PII (name, postal address, phone, email). Verify:

  • Data is not stored in plaintext where avoidable
  • Datenschutzerklärung updated to disclose D1 storage of book requests
  • Retention / deletion policy matches DSGVO Art. 5(1)(e)

Closes #6

Test plan

  • Submit book request → appears in admin panel
  • Datenschutz page references book request data storage
  • 90-day retention: requests older than 90 days are cleaned up
  • pnpm --filter @sdarm/api exec tsc --noEmit passes

…tion

Add book_requests table (migration 0011) that stores all book delivery
requests submitted via the "Geschenk erhalten" form. Removes the religion
field (Art. 9 DSGVO special category). Records are auto-deleted after 90
days via a Cloudflare Cron Trigger (daily 02:00 UTC).

Add admin_audit table (migration 0012) that logs every admin read of a
book request record. Admin surface is intentionally minimal: GET
/admin/book-requests/:id only (no list, no bulk export). Notification
email includes a direct link to the record. Locale is forwarded from
the request form to the DB.

Disclose Resend as a data processor in Datenschutzerklärung (section 6,
de + en). Closes the DSGVO gap documented in docs/dsgvo.md item #1.
Updated playwright snapshots for datenschutz page.

Closes #6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Request] User DB

1 participant