fix(portal): show Weight/DoB + Size Category in pet read view (GRO-2207) #54
Reference in New Issue
Block a user
Delete Branch "fix/gro-2207-portal-pet-readview-fields"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GRO-2207 — Portal Basic Info: Weight/DoB 'Unknown' + missing Size Category
Web-side, portal-scoped field-name mismatch. No API change —
GET/PATCH /api/portal/petsis correct; it serializesweightKg→weight,dateOfBirth→birthDate, and already returnspetSizeCategory. The portal read view read the staff-shaped keys, so populated pets showed "Unknown"; Size Category was never rendered.Changes (portal only — 4 files + 1 new test)
packages/types/src/index.ts— addweight?: string|number|nullandbirthDate?: string|nullalongside the existingweightKg/dateOfBirth(no rename — staffClients.tsx/ClientDetailPage.tsxstill use the raw DB shape and are untouched).src/portal/sections/PetProfiles.tsx— header + Basic Info InfoRows read the portal keys (weight ?? weightKg,birthDate ?? dateOfBirthfallback); add a Size Category InfoRow via aformatSizeCategoryhelper (extra_large → "Extra Large","Unknown"when null).BasicInfoTab/formatSizeCategoryexported for testing.src/portal/sections/PetForm.tsx— pre-fill weight frompet?.weight ?? pet?.weightKg. Submit unchanged (PATCH zod accepts bothweightandweightKg).src/__tests__/PetProfiles.test.tsx(read view renders Weight"12.50 kg", DoBMarch 10, 2022, SizeExtra Large; staff-key fallback; Unknown states; formatter unit) + PetForm pre-fill case.Acceptance
petSizeCategoryset.lint(0 errors),typecheck,test(163 passed).Severity low/cosmetic; data integrity was always fine.
🤖 Generated with Claude Code