d06c3b8d31c6955ba6b9916986a062490a606a9c
An exact duplicate active waitlist entry (same client/pet/service/ preferred date+time) violates the partial unique index idx_waitlist_active_unique, which postgres-js surfaces as SQLSTATE 23505. The POST /portal/waitlist handler did not catch it, so the duplicate returned a generic 500. Catch 23505 specifically and return 409 with a friendly message; unrelated errors still surface as 500 and the first insert still returns 201. Adds integration coverage: 201 first insert, 409 duplicate, 500 unrelated.
GroomBook API
GroomBook API service — extracted from the groombook/app monorepo.
Overview
This repository contains the GroomBook API service, including:
- REST API endpoints
- Database schema and migrations (via Drizzle ORM)
- Authentication (via Better Auth)
- Background job handlers
Structure
src/ # API service source
packages/db/ # Database schema, migrations, and utilities
packages/types/ # Shared TypeScript types
Setup
pnpm install
cp .env.example .env # Fill in required environment variables
pnpm --filter @groombook/api dev
Docker
docker build -t ghcr.io/groombook/api:latest .
docker run -p 3000:3000 ghcr.io/groombook/api:latest
License
AGPL-3.0-only
Description
Languages
TypeScript
99.3%
JavaScript
0.4%
Dockerfile
0.2%