feature/soft-delete #7

Closed
simonfranken wants to merge 0 commits from feature/soft-delete into main
Owner
No description provided.
simonfranken added 3 commits 2026-02-23 14:33:12 +00:00
Replace hard deletes with deletedAt timestamp flags on all three entities.
Deleting a client or project only sets its own deletedAt; child records are
excluded implicitly by filtering on parent deletedAt in every read query.
Raw SQL statistics queries also filter out soft-deleted parents.
FK ON DELETE CASCADE removed from Project→Client and TimeEntry→Project.
findAll and findById filter on client.deletedAt = null so targets
belonging to a soft-deleted client are invisible. The create guard
also rejects soft-deleted clients. The raw SQL balance query now
excludes soft-deleted time entries and projects from tracked totals.
Direct database deletes should still cascade to avoid orphaned records.
The migration now only adds the three deleted_at columns without touching
the existing FK constraints.
simonfranken added 1 commit 2026-02-23 14:58:24 +00:00
Deleting a target or correction sets deletedAt instead of hard-deleting.
Creating a target for a user+client that has a soft-deleted record
reactivates it (clears deletedAt, applies new weeklyHours/startDate)
rather than failing the unique constraint. All reads filter deletedAt = null
on the target, its corrections, and the parent client.
simonfranken added 1 commit 2026-02-23 16:59:37 +00:00
simonfranken closed this pull request 2026-02-23 17:01:18 +00:00
simonfranken deleted branch feature/soft-delete 2026-02-23 17:01:18 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: simonfranken/timetracker#7