feat(seed): seed upcoming appointments across statuses for UAT portal customer (GRO-2311) #201

Merged
Flea Flicker merged 1 commits from flea/gro-2311-seed-portal-statusbadge-appts into dev 2026-06-09 09:53:05 +00:00
Member

feat(seed): upcoming appointments across statuses for UAT portal customer

Implements Option A (CTO-approved) on GRO-2313 (parent GRO-2311; surfaced in GRO-1811 StatusBadge UAT).

Adds seedUatCustomerPortalAppointments to packages/db/src/seed.ts (the root seed used by the reset-demo-data reset/seed image) so the portal customer uat-customer@groombook.dev gets a deterministic spread of appointments and the customer-portal StatusBadge palette can be live-observed, not just code-verified against the bundle.

What it seeds (reachable appointment_status states only)

Appointment Status When Portal surface
a0000001-…-0002 confirmed +3d Upcoming card → Confirmed badge
a0000001-…-0003 scheduled +5d Upcoming card → Scheduled badge
a0000001-…-0004 cancelled −3d Past tab → Cancelled badge
a0000001-…-0005 no_show −10d Past tab → raw no_show label*

* The styled no_showno-show badge-key fix is the clean-bug half of GRO-2319 (web). The existing GRO-2100 completed appointment is left untouched (AC #4), so Completed is also covered.

Why not pending / waitlisted

appointment_status is {scheduled, confirmed, in_progress, completed, cancelled, no_show} and the portal <StatusBadge> renders appointment.status verbatim — pending/waitlisted are not valid statuses and cannot be seeded. That render-semantics change is the product-gated half of GRO-2319 (needs CMPO sign-off). AC tightened accordingly.

Idempotency

Fixed UUIDs + onConflictDoNothing(target: id) → the hourly reset CronJob (TRUNCATE + re-seed) and non-truncating dev re-seeds never dup-key (the services_pkey class, GRO-2033). Uses the already-linked Pup Alpha, so GRO-1987 TC-UAT-3 (403 on the unlinked Pup Beta) is unaffected.

Verification

  • pnpm --filter @groombook/db typecheck
  • eslint packages/db/src/seed.ts — no new errors (one pre-existing prefer-const at the GRO-2225 cohort, untouched).

cc @cpfarhood

## feat(seed): upcoming appointments across statuses for UAT portal customer Implements **Option A** (CTO-approved) on [GRO-2313](/GRO/issues/GRO-2313) (parent [GRO-2311](/GRO/issues/GRO-2311); surfaced in [GRO-1811](/GRO/issues/GRO-1811) StatusBadge UAT). Adds `seedUatCustomerPortalAppointments` to `packages/db/src/seed.ts` (the root seed used by the `reset-demo-data` reset/seed image) so the portal customer `uat-customer@groombook.dev` gets a deterministic spread of appointments and the customer-portal `StatusBadge` palette can be **live-observed**, not just code-verified against the bundle. ### What it seeds (reachable `appointment_status` states only) | Appointment | Status | When | Portal surface | |---|---|---|---| | `a0000001-…-0002` | `confirmed` | +3d | Upcoming card → **Confirmed** badge | | `a0000001-…-0003` | `scheduled` | +5d | Upcoming card → **Scheduled** badge | | `a0000001-…-0004` | `cancelled` | −3d | Past tab → **Cancelled** badge | | `a0000001-…-0005` | `no_show` | −10d | Past tab → raw `no_show` label* | \* The styled `no_show`→`no-show` badge-key fix is the clean-bug half of [GRO-2319](/GRO/issues/GRO-2319) (web). The existing GRO-2100 `completed` appointment is left untouched (AC #4), so **Completed** is also covered. ### Why not `pending` / `waitlisted` `appointment_status` is `{scheduled, confirmed, in_progress, completed, cancelled, no_show}` and the portal `<StatusBadge>` renders `appointment.status` verbatim — `pending`/`waitlisted` are not valid statuses and cannot be seeded. That render-semantics change is the product-gated half of [GRO-2319](/GRO/issues/GRO-2319) (needs CMPO sign-off). AC tightened accordingly. ### Idempotency Fixed UUIDs + `onConflictDoNothing(target: id)` → the hourly reset CronJob (TRUNCATE + re-seed) and non-truncating dev re-seeds never dup-key (the `services_pkey` class, [GRO-2033](/GRO/issues/GRO-2033)). Uses the already-linked Pup Alpha, so [GRO-1987](/GRO/issues/GRO-1987) TC-UAT-3 (403 on the unlinked Pup Beta) is unaffected. ### Verification - `pnpm --filter @groombook/db typecheck` ✅ - `eslint packages/db/src/seed.ts` — no new errors (one pre-existing `prefer-const` at the GRO-2225 cohort, untouched). cc @cpfarhood
Flea Flicker added 1 commit 2026-06-09 09:50:40 +00:00
feat(seed): seed upcoming appointments across statuses for UAT portal customer (GRO-2311)
CI / Lint & Typecheck (pull_request) Successful in 29s
CI / Test (pull_request) Successful in 27s
CI / Build & Push Docker Images (pull_request) Successful in 1m30s
de06cae6b1
Add seedUatCustomerPortalAppointments: deterministic, idempotent appointments
for uat-customer@groombook.dev covering the reachable StatusBadge palette so the
portal can live-render badges (not just code-verify the bundle):

- upcoming confirmed (Confirmed badge, Upcoming card)
- upcoming scheduled (Scheduled badge, Upcoming card)
- past cancelled   (Cancelled badge, Past tab)
- past no_show     (raw no_show label until GRO-2319 badge-key fix)

Existing GRO-2100 completed appointment is untouched (AC #4). Stable UUIDs +
onConflictDoNothing keep the hourly reset/seed re-runnable (GRO-2033 dup-key
class). pending/waitlisted are not valid appointment_status values and are not
seedable; web-side work tracked in GRO-2319. CTO-approved Option A on GRO-2313.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Flea Flicker merged commit d61607f4c5 into dev 2026-06-09 09:53:05 +00:00
Sign in to join this conversation.