From 8c184dddbd6f6fde6d6bb7352dec4e5a83864274 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Mon, 25 May 2026 18:14:45 +0000 Subject: [PATCH 1/3] fix(schema): add missing extended pet profile fields to packages/db Add temperamentScore, temperamentFlags, medicalAlerts, and preferredCuts to the pets table in packages/db/src/schema.ts to match the API schema. These columns already exist in the database via migration 0030_extended_pet_profile.sql (confirmed by GRO-1748). Refs: GRO-1752 Co-Authored-By: Claude Opus 4.7 --- packages/db/src/schema.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index de0ab29..3a12d96 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -11,6 +11,7 @@ import { unique, uuid, } from "drizzle-orm/pg-core"; +import type { MedicalAlert } from "@groombook/types"; // ─── Enums ──────────────────────────────────────────────────────────────────── @@ -164,6 +165,10 @@ export const pets = pgTable( specialCareNotes: text("special_care_notes"), coatType: coatTypeEnum("coat_type"), petSizeCategory: petSizeCategoryEnum("pet_size_category"), + temperamentScore: integer("temperament_score"), + temperamentFlags: jsonb("temperament_flags").$type().default([]), + medicalAlerts: jsonb("medical_alerts").$type().default([]), + preferredCuts: jsonb("preferred_cuts").$type().default([]), customFields: jsonb("custom_fields").$type>().notNull().default({}), photoKey: text("photo_key"), photoUploadedAt: timestamp("photo_uploaded_at"), -- 2.52.0 From b3b2113daa1370926beff3c9c3b79e660f87bbd9 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Mon, 25 May 2026 18:31:52 +0000 Subject: [PATCH 2/3] fix(db): add missing extended pet profile fields to buildPet factory Lint Roller (QA) flagged that buildPet in factories.ts was missing the 4 fields added to the pets table schema, causing TS2739 in the Docker build job (run 1701, job 3717). Co-Authored-By: Claude Opus 4.7 --- packages/db/src/factories.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/db/src/factories.ts b/packages/db/src/factories.ts index 2ecad06..c15d42e 100644 --- a/packages/db/src/factories.ts +++ b/packages/db/src/factories.ts @@ -105,6 +105,10 @@ export function buildPet(overrides: Partial & { clientId: string }): Pet photoKey: null, photoUploadedAt: null, image: null, + temperamentScore: null, + temperamentFlags: [], + medicalAlerts: [], + preferredCuts: [], createdAt: new Date("2025-01-01T00:00:00Z"), updatedAt: new Date("2025-01-01T00:00:00Z"), }; -- 2.52.0 From 0e64f9d3ae0ab6c8d6df14a97bc4db81e27d403e Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Mon, 25 May 2026 18:35:26 +0000 Subject: [PATCH 3/3] fix(gro-1746): apply UAT seed data to root src/routes/admin/seed.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add UAT_CLIENT (name: "UAT Customer", email: uat-customer@groombook.dev, phone: 555-0100, address: 1 UAT Lane, status: active) - Add UAT_PETS: Bella (Poodle, curly) and Max (Labrador Retriever, short) - Add idempotent UAT Client upsert block and UAT Pets loop after Demo Dog - Change adminSeedRouter.post("/seed") → adminSeedRouter.post("/") so the mounted path is /api/admin/seed (not /api/admin/seed/seed) Fixes the build-path mismatch where the Dockerfile's COPY src/ src/ would not include the UAT data changes that were only in apps/api/src/. Issue: GRO-1746 Fixes: GRO-1743 Co-Authored-By: Paperclip --- src/routes/admin/seed.ts | 62 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/src/routes/admin/seed.ts b/src/routes/admin/seed.ts index efd461e..c66aeb2 100644 --- a/src/routes/admin/seed.ts +++ b/src/routes/admin/seed.ts @@ -18,7 +18,7 @@ const KNOWN_STAFF = { name: "Demo Manager", email: "demo-manager@groombook.dev", oidcSub: "demo-manager-001", - role: "manager" as const, + role: "manager, active: true, }; @@ -36,6 +36,19 @@ const DEMO_PET = { weightKg: "30.00", }; +const UAT_CLIENT = { + name: "UAT Customer", + email: "uat-customer@groombook.dev", + phone: "555-0100", + address: "1 UAT Lane, Test City, CA 90210", + status: "active, +}; + +const UAT_PETS = [ + { name: "Bella", species: "Dog", breed: "Poodle", coatType: "curly", weightKg: "20.00" }, + { name: "Max", species: "Dog", breed: "Labrador Retriever", coatType: "short", weightKg: "30.00" }, +]; + const DEMO_SERVICES = [ { id: "b0000001-0000-0000-0000-000000000001", name: "Bath & Brush", description: "Full bath, blow-dry, brush out, and ear cleaning", basePriceCents: 4500, durationMinutes: 45 }, { id: "b0000001-0000-0000-0000-000000000002", name: "Full Groom — Small", description: "Complete grooming for dogs under 25 lbs", basePriceCents: 6500, durationMinutes: 60 }, @@ -43,7 +56,7 @@ const DEMO_SERVICES = [ { id: "b0000001-0000-0000-0000-000000000004", name: "Nail Trim", description: "Nail clipping and filing", basePriceCents: 1500, durationMinutes: 15 }, ]; -adminSeedRouter.post("/seed", async (c) => { +adminSeedRouter.post("/", async (c) => { // Refuse to run when AUTH_DISABLED — dev environments use direct-DB seeding if (process.env.AUTH_DISABLED === "true") { return c.json( @@ -128,6 +141,51 @@ adminSeedRouter.post("/seed", async (c) => { results.push(`Created pet '${DEMO_PET.name}' for Demo Client (id: ${created!.id})`); } + // ── Client: UAT Customer ────────────────────────────────────────────────── + const [existingUatClient] = await db + .select() + .from(clients) + .where(eq(clients.email, UAT_CLIENT.email)); + + let uatClientId: string; + if (existingUatClient) { + uatClientId = existingUatClient.id; + results.push(`Client '${UAT_CLIENT.name}' already exists (id: ${uatClientId})`); + } else { + const [created] = await db.insert(clients).values(UAT_CLIENT).returning(); + uatClientId = created!.id; + results.push(`Created client '${UAT_CLIENT.name}' (id: ${uatClientId})`); + } + + // ── Pets: UAT Customer's Pets ───────────────────────────────────────────── + const existingUatPets = await db + .select() + .from(pets) + .where(eq(pets.clientId, uatClientId)); + + for (const uatPet of UAT_PETS) { + const existing = existingUatPets.find( + (p) => p.name === uatPet.name && p.species === uatPet.species + ); + if (existing) { + results.push(`Pet '${uatPet.name}' already exists for UAT Customer (id: ${existing.id})`); + } else { + const [created] = await db + .insert(pets) + .values({ + clientId: uatClientId, + name: uatPet.name, + species: uatPet.species, + breed: uatPet.breed, + coatType: uatPet.coatType as any, + weightKg: uatPet.weightKg, + dateOfBirth: new Date("2019-01-01T00:00:00Z"), + }) + .returning(); + results.push(`Created pet '${uatPet.name}' for UAT Customer (id: ${created!.id})`); + } + } + return c.json({ message: "Seed complete", details: results, -- 2.52.0