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

* feat: add client disable/deletion with soft-delete (#67)

Add soft-delete support for clients: disable is the default action
(hiding from client list and booking flow), with permanent deletion
requiring explicit type-to-confirm. Disabled clients remain in
reporting and can be re-enabled by staff.

- Add client_status enum (active/disabled) and disabled_at column
- API defaults GET /api/clients to active-only, ?includeDisabled=true shows all
- PATCH /api/clients/:id accepts status field for disable/enable
- DELETE requires ?confirm=true query param
- Booking flow skips disabled clients
- Frontend: show disabled toggle, disable/enable buttons, delete confirmation modal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unused updateClientSchema (lint error)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Groom Book CTO <cto@groombook.app>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit was merged in pull request #69.
This commit is contained in:
groombook-paperclip[bot]
2026-03-19 20:03:18 +00:00
committed by GitHub
parent b6b4bc21a0
commit 19e0f5e3ca
8 changed files with 212 additions and 24 deletions
+2 -2
View File
@@ -160,11 +160,11 @@ bookRouter.post(
);
}
// Find or create client by email
// Find or create client by email (skip disabled clients)
let [client] = await db
.select()
.from(clients)
.where(eq(clients.email, body.clientEmail));
.where(and(eq(clients.email, body.clientEmail), eq(clients.status, "active")));
if (!client) {
const inserted = await db