Savannah Savings 23be6230ba
CI / Test (pull_request) Successful in 12s
CI / Lint & Typecheck (pull_request) Successful in 16s
CI / Build & Push Docker Images (pull_request) Successful in 3m50s
fix(portal): implement PATCH /portal/pets/:petId + enrich GET /portal/pets (GRO-2187)
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>
2026-06-08 08:13:12 +00:00
2026-05-14 17:42:22 +00:00

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

S
Description
GroomBook API service (extracted from groombook/app monorepo)
Readme 3.8 MiB
Languages
TypeScript 99.3%
JavaScript 0.4%
Dockerfile 0.2%