mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Twenty of the twenty-three soft-delete models were never purged: a deleted lab result, visit, allergy or cycle stayed in the database, in every backup and in every key rotation for as long as the instance ran. soft-delete-retention.ts holds one entry per model that has a deletedAt column, derived from the schema by a guard with a counter-check. The sync domains and the document vault keep their purges; every other model is purged by a new nightly soft-delete-purge job after the sync feed's 75-day horizon, per account under the restore lock and in bounded batches. A cycle start folded into a live cycle stays while that cycle does, and a removed coach fact stays for the coach message retention, since stored trails are withheld against it.