From 9462915a66f632ca601f211ed67af37b89ca6963 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Fri, 22 May 2026 03:17:13 +0000 Subject: [PATCH] fix: align root src/ enum values with packages/db schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root src/routes/ used stale enum values (xlarge→extra_large, smooth→silky, missing short/medium/silky from coatType) and sizeCategory→petSizeCategory field name mismatch with the pets table column. Co-Authored-By: Claude Opus 4.6 --- src/routes/book.ts | 4 ++-- src/routes/buffer-rules.ts | 4 ++-- src/routes/pets.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/routes/book.ts b/src/routes/book.ts index 828c11c..c380439 100644 --- a/src/routes/book.ts +++ b/src/routes/book.ts @@ -193,8 +193,8 @@ bookRouter.post( name: body.petName, species: body.petSpecies, breed: body.petBreed ?? null, - coatType: (body.petCoatType ?? null) as "smooth" | "double" | "wire" | "curly" | "long" | "hairless" | null, - petSizeCategory: (body.petSizeCategory ?? null) as "small" | "medium" | "large" | "xlarge" | null, + coatType: (body.petCoatType ?? null) as "short" | "medium" | "long" | "double" | "wire" | "silky" | "curly" | "hairless" | null, + petSizeCategory: (body.petSizeCategory ?? null) as "small" | "medium" | "large" | "extra_large" | null, }) .returning(); const pet = petInserted[0]; diff --git a/src/routes/buffer-rules.ts b/src/routes/buffer-rules.ts index fb3ff2b..72a98a7 100644 --- a/src/routes/buffer-rules.ts +++ b/src/routes/buffer-rules.ts @@ -19,8 +19,8 @@ bufferRulesRouter.use("*", requireRole("manager")); const createBufferRuleSchema = z.object({ serviceId: z.string().uuid(), - sizeCategory: z.enum(["small", "medium", "large", "xlarge"]).optional(), - coatType: z.enum(["smooth", "double", "wire", "curly", "long", "hairless"]).optional(), + sizeCategory: z.enum(["small", "medium", "large", "extra_large"]).optional(), + coatType: z.enum(["short", "medium", "long", "double", "wire", "silky", "curly", "hairless"]).optional(), bufferMinutes: z.number().int().positive(), }); diff --git a/src/routes/pets.ts b/src/routes/pets.ts index 9642450..039e8a5 100644 --- a/src/routes/pets.ts +++ b/src/routes/pets.ts @@ -24,8 +24,8 @@ const createPetSchema = z.object({ shampooPreference: z.string().max(500).optional(), specialCareNotes: z.string().max(2000).optional(), customFields: z.record(z.string(), z.string()).optional(), - sizeCategory: z.enum(["small", "medium", "large", "xlarge"]).optional(), - coatType: z.enum(["smooth", "double", "wire", "curly", "long", "hairless"]).optional(), + petSizeCategory: z.enum(["small", "medium", "large", "extra_large"]).optional(), + coatType: z.enum(["short", "medium", "long", "double", "wire", "silky", "curly", "hairless"]).optional(), }); const updatePetSchema = createPetSchema.partial().omit({ clientId: true });