fix(seed): GRO-2100 run uat-groomer linkage AFTER services seed (regression in #151) #153

Merged
Flea Flicker merged 1 commits from flea-flicker/gro-2100-seed-linkage-after-services into dev 2026-06-02 20:11:45 +00:00

1 Commits

Author SHA1 Message Date
Flea Flicker ca733251b1 fix(seed): GRO-2100 run uat-groomer linkage AFTER services seed (regression in #151)
CI / Test (pull_request) Successful in 11s
CI / Lint & Typecheck (pull_request) Successful in 15s
CI / Build & Push Docker Images (pull_request) Successful in 1m2s
PR #151 introduced seedUatGroomerLinkage() inside seedUatStaffAccounts(),
which is called BEFORE the services catalogue is seeded. On a fresh
reset, the helper bails with:

  ⚠ GRO-2100: no active services found — skipping uat-groomer linkage

so the linkage never lands. This is why TC-UAT-2/3 still return 404/403
instead of 200/403 even with PR #152 + PR #613 deployed in UAT.

Fix:
- seedUatStaffAccounts() now returns the UAT Customer clientId (or null).
- seedUatGroomerLinkage() is called by BOTH seed paths (seedKnownUsers
  and full seed()) AFTER the services insert completes.
- Helper defends against null clientId and a missing linked pet (warns
  and skips instead of crashing).

Idempotency is preserved: on a re-seed the appointment upsert key
'a0000001-0000-0000-0000-000000000001' is short-circuited.

Refs: [GRO-2100](/GRO/issues/GRO-2100), unblocks [GRO-1987](/GRO/issues/GRO-1987)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-02 20:03:58 +00:00