From faf7def77d7545bac61bf0c00e2cc344bf656377 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Wed, 20 May 2026 04:40:42 +0000 Subject: [PATCH] feat(GRO-1174): persist petSizeCategory and petCoatType from booking - Add petSizeCategory and petCoatType to bookingSchema zod validator (optional) - Save coatType to pets row on booking creation - Add coatType and petSizeCategory columns to pets DB schema - Add coatType and petSizeCategory to Pet interface in @groombook/types Co-Authored-By: Claude Opus 4.7 --- packages/db/src/schema.ts | 2 ++ packages/types/src/index.ts | 2 ++ src/routes/book.ts | 3 +++ 3 files changed, 7 insertions(+) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index f1d74b3..7d93afc 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -142,6 +142,8 @@ export const pets = pgTable( cutStyle: text("cut_style"), shampooPreference: text("shampoo_preference"), specialCareNotes: text("special_care_notes"), + coatType: text("coat_type"), + petSizeCategory: text("pet_size_category"), customFields: jsonb("custom_fields").$type>().notNull().default({}), photoKey: text("photo_key"), photoUploadedAt: timestamp("photo_uploaded_at"), diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 90ef116..ced5f59 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -39,6 +39,8 @@ export interface Pet { cutStyle: string | null; shampooPreference: string | null; specialCareNotes: string | null; + coatType: string | null; + petSizeCategory: string | null; customFields: Record; photoKey?: string; photoUploadedAt?: string; diff --git a/src/routes/book.ts b/src/routes/book.ts index 69f61e5..01b542c 100644 --- a/src/routes/book.ts +++ b/src/routes/book.ts @@ -112,6 +112,8 @@ const bookingSchema = z.object({ petName: z.string().min(1).max(200), petSpecies: z.string().min(1).max(100), petBreed: z.string().max(100).optional(), + petSizeCategory: z.string().max(50).optional(), + petCoatType: z.string().max(50).optional(), notes: z.string().max(2000).optional(), }); @@ -191,6 +193,7 @@ bookRouter.post( name: body.petName, species: body.petSpecies, breed: body.petBreed ?? null, + coatType: body.petCoatType ?? null, }) .returning(); const pet = petInserted[0];