feat: client disable/deletion with soft-delete #69

Merged
ghost merged 2 commits from feature/client-soft-delete into main 2026-03-19 20:03:18 +00:00
ghost commented 2026-03-19 17:15:41 +00:00 (Migrated from github.com)

Summary

Implements client soft-delete as requested in #67. Key changes:

  • Schema: New client_status enum (active/disabled) and disabled_at timestamp on the clients table
  • API: GET /api/clients defaults to active-only (use ?includeDisabled=true to show all); PATCH accepts status field; DELETE requires ?confirm=true
  • Booking: Public booking flow skips disabled clients when looking up by email
  • Frontend: "Disable client" is now the primary action (replaces "Delete"); "Show disabled clients" checkbox in sidebar; disabled clients show a badge; permanent deletion requires typing the client name to confirm; re-enable button for disabled clients

Closes #67

Test plan

  • Verify migration runs cleanly on a fresh DB
  • Confirm GET /api/clients returns only active clients by default
  • Confirm GET /api/clients?includeDisabled=true returns all clients
  • Disable a client via PATCH and verify they disappear from the default list
  • Re-enable a disabled client and verify they reappear
  • Attempt DELETE without ?confirm=true and verify 400 response
  • Confirm disabled clients cannot book via the public booking flow
  • E2E tests pass with updated mock data
  • Verify disabled clients still appear in reports

🤖 Generated with Claude Code

## Summary Implements client soft-delete as requested in #67. Key changes: - **Schema**: New `client_status` enum (`active`/`disabled`) and `disabled_at` timestamp on the `clients` table - **API**: `GET /api/clients` defaults to active-only (use `?includeDisabled=true` to show all); `PATCH` accepts `status` field; `DELETE` requires `?confirm=true` - **Booking**: Public booking flow skips disabled clients when looking up by email - **Frontend**: "Disable client" is now the primary action (replaces "Delete"); "Show disabled clients" checkbox in sidebar; disabled clients show a badge; permanent deletion requires typing the client name to confirm; re-enable button for disabled clients Closes #67 ## Test plan - [ ] Verify migration runs cleanly on a fresh DB - [ ] Confirm `GET /api/clients` returns only active clients by default - [ ] Confirm `GET /api/clients?includeDisabled=true` returns all clients - [ ] Disable a client via PATCH and verify they disappear from the default list - [ ] Re-enable a disabled client and verify they reappear - [ ] Attempt DELETE without `?confirm=true` and verify 400 response - [ ] Confirm disabled clients cannot book via the public booking flow - [ ] E2E tests pass with updated mock data - [ ] Verify disabled clients still appear in reports 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This repo is archived. You cannot comment on pull requests.