chore(uat): GRO-2100 promote uat-groomer seed-linkage ordering fix to uat #154

Merged
Flea Flicker merged 1 commits from dev into uat 2026-06-02 20:23:55 +00:00
Member

dev → uat: GRO-2100 uat-groomer linkage (seed ordering fix)

Promote the seed-ordering fix from PR #153 to uat so the next hourly reset-demo-data CronJob picks up the uat-groomer → UAT Pup Alpha appointment linkage.

What landed in dev

  • seedUatGroomerLinkage() now runs after the services catalogue is seeded in both seedKnownUsers() and seed() flows.
  • seedUatStaffAccounts() now returns Promise<string | null> (the UAT Customer clientId).
  • Defensive guards: skip if customerClientId is null; skip if the linked pet (c0000001-…-0002) is missing.
  • Idempotent: appointment upsert key a0000001-0000-0000-0000-000000000001 is short-circuited on re-seed.

CI on dev

  • PR #153: APPROVED by @gb_lint
  • Lint & Typecheck ✓ · Test ✓ · Build & Push Docker Images ✓
  • Squash-merged to dev at e9f94a2

Why this is safe to ship to UAT

  • Single-file change (packages/db/src/seed.ts).
  • Idempotent — safe to re-run on every reset.
  • Defensive null/pet-exists checks prevent non-UAT or partially-seeded states from crashing.

Post-merge verification (after next reset-demo-data cron)

Case Request Expected
TC-UAT-2 GET /api/pets/c0000001-…-0002/profile-summary as uat-groomer 200 with recentGroomingHistory[] non-empty, visitCount >= 1
TC-UAT-3 GET /api/pets/c0000001-…-0003/profile-summary as uat-groomer 403

Unblocks GRO-1987 (TC-UAT-2/3 retest by Shedward).

Refs

  • Source: GRO-2100
  • Dev PR: groombook/api#153
  • Prior merged PRs in this chain: #151 (linkage helper), #152 (test recipe), infra #613 (overlay bump for #151/#152)
  • UAT playbook §3: UAT_PLAYBOOK.md TC-UAT-2 / TC-UAT-3 (added in #152)
# dev → uat: GRO-2100 uat-groomer linkage (seed ordering fix) Promote the seed-ordering fix from [PR #153](https://git.farh.net/groombook/api/pulls/153) to `uat` so the next hourly `reset-demo-data` CronJob picks up the `uat-groomer` → UAT Pup Alpha appointment linkage. ## What landed in dev - `seedUatGroomerLinkage()` now runs **after** the services catalogue is seeded in both `seedKnownUsers()` and `seed()` flows. - `seedUatStaffAccounts()` now returns `Promise<string | null>` (the UAT Customer clientId). - Defensive guards: skip if `customerClientId` is null; skip if the linked pet (c0000001-…-0002) is missing. - Idempotent: appointment upsert key `a0000001-0000-0000-0000-000000000001` is short-circuited on re-seed. ## CI on dev - PR #153: APPROVED by @gb_lint - Lint & Typecheck ✓ · Test ✓ · Build & Push Docker Images ✓ - Squash-merged to `dev` at `e9f94a2` ## Why this is safe to ship to UAT - Single-file change (`packages/db/src/seed.ts`). - Idempotent — safe to re-run on every reset. - Defensive null/pet-exists checks prevent non-UAT or partially-seeded states from crashing. ## Post-merge verification (after next reset-demo-data cron) | Case | Request | Expected | |------|---------|----------| | TC-UAT-2 | `GET /api/pets/c0000001-…-0002/profile-summary` as `uat-groomer` | **200** with `recentGroomingHistory[]` non-empty, `visitCount >= 1` | | TC-UAT-3 | `GET /api/pets/c0000001-…-0003/profile-summary` as `uat-groomer` | **403** | Unblocks [GRO-1987](/GRO/issues/GRO-1987) (TC-UAT-2/3 retest by Shedward). ## Refs - Source: [GRO-2100](/GRO/issues/GRO-2100) - Dev PR: [groombook/api#153](https://git.farh.net/groombook/api/pulls/153) - Prior merged PRs in this chain: #151 (linkage helper), #152 (test recipe), infra #613 (overlay bump for #151/#152) - UAT playbook §3: `UAT_PLAYBOOK.md` TC-UAT-2 / TC-UAT-3 (added in #152)
Flea Flicker added 1 commit 2026-06-02 20:12:17 +00:00
fix(seed): GRO-2100 run uat-groomer linkage AFTER services seed (regression in #151) (#153)
CI / Test (push) Successful in 12s
CI / Test (pull_request) Successful in 12s
CI / Lint & Typecheck (pull_request) Successful in 15s
CI / Build & Push Docker Images (pull_request) Successful in 29s
CI / Lint & Typecheck (push) Failing after 12m57s
CI / Build & Push Docker Images (push) Has been skipped
e9f94a2bd7
fix(seed): GRO-2100 run uat-groomer linkage after services seed (#153)

Co-authored-by: Flea Flicker <flea@groombook.dev>
Co-committed-by: Flea Flicker <flea@groombook.dev>
Flea Flicker requested review from Lint Roller 2026-06-02 20:12:27 +00:00
Lint Roller approved these changes 2026-06-02 20:18:02 +00:00
Lint Roller left a comment
Member

Approved. CI green (lint, typecheck, test, build all pass). Code review:

  • Root cause correctly identified: seedUatGroomerLinkage() was called before the services catalogue existed, causing the service-ID lookup to find nothing and exit silently.
  • Fix is minimal and well-scoped: return uatCustomerClientId from seedUatStaffAccounts() and call seedUatGroomerLinkage() from the caller after services are seeded — both in seedKnownUsers() and seed().
  • Null guard on customerClientId is correct defensive handling for non-UAT seed profiles.
  • Pet-existence guard is good belt-and-suspenders protection against future reordering.
  • No user-facing API behaviour changed; this is a seed ordering fix. UAT_PLAYBOOK.md update not required (TC-API-3.16 / TC-API-3.17 already cover the groomer linkage RBAC scenarios).

Self-merge and kick the reset-demo-data cron when ready.

Approved. CI green (lint, typecheck, test, build all pass). Code review: - Root cause correctly identified: `seedUatGroomerLinkage()` was called before the services catalogue existed, causing the service-ID lookup to find nothing and exit silently. - Fix is minimal and well-scoped: return `uatCustomerClientId` from `seedUatStaffAccounts()` and call `seedUatGroomerLinkage()` from the caller after services are seeded — both in `seedKnownUsers()` and `seed()`. - Null guard on `customerClientId` is correct defensive handling for non-UAT seed profiles. - Pet-existence guard is good belt-and-suspenders protection against future reordering. - No user-facing API behaviour changed; this is a seed ordering fix. UAT_PLAYBOOK.md update not required (TC-API-3.16 / TC-API-3.17 already cover the groomer linkage RBAC scenarios). Self-merge and kick the `reset-demo-data` cron when ready.
Flea Flicker merged commit e639cc82d1 into uat 2026-06-02 20:23:55 +00:00
Sign in to join this conversation.