23be6230ba88ed5987a0e750bc3e4ca59f184fee
The customer portal pet-save calls PATCH /api/portal/pets/{petId}, which the
deployed src/ tree never registered → 404, no persistence (UAT §5.23 / GRO-1480
regression). Also GET /portal/pets omitted the extended fields, so a write was
not visible on reload.
- Add portalRouter.patch("/pets/:petId", …) with ownership enforcement
(pet.clientId === portalClientId → 403, missing pet → 404), mirroring the
appointment-notes handler.
- Map the web payload to pets columns: name, breed, weightKg (accept
weightKg/weight), dateOfBirth (birthDate), groomingNotes (notes), healthAlerts,
photoKey (photoUrl), coatType, petSizeCategory (web "xlarge" → DB
"extra_large"), preferredCuts, medicalAlerts; set updatedAt.
- Reject invalid coatType/petSizeCategory with 422 (validated in-handler).
- Enrich GET /portal/pets with coatType, petSizeCategory, healthAlerts,
preferredCuts, medicalAlerts.
- Add src/__tests__/portalPets.test.ts: owner success + persistence, weight
fallback, non-owner 403, not-found 404, invalid enum 422, missing session 401.
- UAT_PLAYBOOK.md §4.8: add TC-API-8.12–8.15 for portal pet GET/PATCH.
coatType/petSizeCategory enums already present in packages/db/src/schema.ts.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
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%