feat: add timezone settings data export and account deletion

This commit is contained in:
syntaxbullet
2026-09-04 18:23:12 +02:00
parent e88ffceb22
commit d624ee6c3c
7 changed files with 151 additions and 3 deletions

View File

@@ -217,8 +217,9 @@ production habit data separate from development data.
server-side; Discord access/refresh tokens are never persisted or sent to React.
- React detects the browser timezone during initial registration. The server
validates it using `Intl.DateTimeFormat`, falling back to UTC. Later sign-ins
update the Discord profile without changing the saved timezone. A timezone
settings UI is deferred; `PATCH /api/me` updates the timezone. Habit timestamps
update the Discord profile without changing the saved timezone. **Settings** lets users change their timezone, download a complete JSON export,
and permanently delete their account with typed confirmation. `PATCH /api/me`
updates the timezone. Habit timestamps
remain UTC and daily boundaries follow the saved timezone with preserved historical
deadlines. See the API reference for travel and DST behavior.
@@ -325,3 +326,12 @@ Habit tests cover every route, all PRD acceptance behaviors, ownership and Origi
checks, historical corrections, expiry, timezone boundaries, daily resets, optional
count carryover, Nivo data adaptation, and migration upgrades. Semantic commits
separate the database foundation, REST implementation, carryover, and verification.
### Account data
`GET /api/account/export` downloads versioned JSON containing all owned profile,
habit, revision, dated progress, task, audit, calendar, chart, and delivery records.
It excludes session tokens and credentials. `DELETE /api/account` requires matching
Origin and `{ "confirmation": "DELETE" }`; it atomically removes owned records and
revokes every session. Discord posts and retained operator backups are not erased
by this action.