fix(portal): show Weight/DoB + Size Category in pet read view (GRO-2207)
CI / Test (pull_request) Successful in 20s
CI / Lint & Typecheck (pull_request) Successful in 26s
CI / Build & Push Docker Image (pull_request) Successful in 44s

Portal GET /api/portal/pets serializes weightKg→weight and dateOfBirth→
birthDate. The portal read view read the staff-shaped keys, so populated
pets rendered 'Unknown'. Size Category (petSizeCategory) was never shown
in any read tab.

- packages/types: add portal-shaped weight?/birthDate? alongside the
  existing staff-side weightKg/dateOfBirth (no rename — staff Clients
  pages still use weightKg/dateOfBirth).
- PetProfiles: header + Basic Info InfoRows read portal keys with a
  fallback to staff keys; add a Size Category InfoRow with a
  formatSizeCategory helper (extra_large → 'Extra Large').
- PetForm: pre-fill weight from portal weight key with weightKg fallback.
- Tests: PetProfiles.test.tsx (read view + formatter) and a PetForm
  pre-fill case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Flea Flicker
2026-06-08 17:29:23 +00:00
parent c7417dc9e3
commit 0000ca8010
5 changed files with 107 additions and 6 deletions
+4
View File
@@ -34,6 +34,10 @@ export interface Pet {
breed: string | null;
weightKg: number | null;
dateOfBirth: string | null;
/** Portal-shaped serialization of weightKg (GET/PATCH /api/portal/pets). */
weight?: string | number | null;
/** Portal-shaped serialization of dateOfBirth (GET/PATCH /api/portal/pets). */
birthDate?: string | null;
healthAlerts: string | null;
groomingNotes: string | null;
cutStyle: string | null;