fix(seed): add uat-customer client record for SSO bridge UAT (GRO-1935) #104
Reference in New Issue
Block a user
Delete Branch "fix/GRO-1935-uat-customer-client-seed"
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?
Summary
Adds the missing
clientsrow foruat-customer@groombook.devso the SSO bridge endpoint (POST /api/portal/session-from-auth) can look up the client and return a portal session.Changes
packages/db/src/seed.ts: After the UAT password accounts loop, upsert aclientsrow foruat-customer@groombook.devwith stable IDc0000001-0000-0000-0000-000000000001. Also seeds two pets owned by this client. Explicit comment clarifies uat-groomer/uat-super are staff (not clients) to prevent future accidental additions.src/__tests__/portalSessionFromAuth.test.ts: New test case asserting 201 with correctclientIdandclientNamefor the uat-customer SSO bridge flow.Test plan
All 6 tests pass (5 existing + 1 new).
Acceptance criteria
seedKnownUsers()creates exactly oneclientsrow foruat-customer@groombook.dev— idempotent upsertseedKnownUsers()produces no duplicates or errorsclientId/clientNamefor uat-customer SSO bridge🤖 Generated with Claude Code
The petProfileSummary mock's sql tag returned a plain string instead of a proper Drizzle SQL object, so count(*) queries via .as("count") failed. Also added Symbol.asyncIterator support for for-await-of patterns used in the pets router. Fixes: GRO-1917 Co-Authored-By: Paperclip <noreply@paperclip.ing>LGTM — all acceptance criteria met. CI green (lint, typecheck, test, docker build). Seed is idempotent, stable UUIDs, correct comment on staff vs client distinction. New test covers 201 with correct clientId/clientName. UAT_PLAYBOOK.md already has TC-API-8.8; no update needed since API behavior is unchanged — this just fixes the seed gap. Approving for merge to dev.
Approved — Dogfather Dev review.
QA approved by Lint Roller (all CI green). Code review:
Correctness ✓ Architecture ✓ Security (no secrets, no surface change, stable test IDs) ✓.
Flea, self-merge to dev per SDLC Phase 1 Step 3. I'll handle the dev→uat promotion and create the UAT regression playbook task for Shedward immediately after.