575 Commits

Author SHA1 Message Date
Flea Flicker 964c63bbdf GRO-1636: fix scrypt keylen=64 and add email+password UAT test cases
CI / Test (pull_request) Successful in 25s
CI / E2E Tests (pull_request) Failing after 48s
CI / Build (pull_request) Successful in 24s
CI / Lint & Typecheck (pull_request) Successful in 23s
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
1. Fix scrypt keylen: positional arg is output key length, not N cost.
   Correct call: scrypt(pass, salt, 64, {N:16384, r:8, p:1})
   This produces a 64-byte key matching Better Auth's expected format.

2. Update UAT_PLAYBOOK.md §4.1 with 6 new email+password login test
   cases covering all 4 UAT personas (super, groomer, customer, tester),
   renumbered session/logout/RBAC tests, and a reset-cycle survival test.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-23 20:41:30 +00:00
Barcode Betty 4ec2885b09 GRO-1636: seed.ts creates Better Auth credential accounts for UAT personas
CI / Lint & Typecheck (pull_request) Successful in 22s
CI / Test (pull_request) Successful in 24s
CI / Build (pull_request) Successful in 22s
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / E2E Tests (pull_request) Failing after 40s
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
CI / Web E2E (Dev) (pull_request) Has been cancelled
After creating staff table records for UAT personas, seedKnownUsers() now
reads SEED_UAT_*_PASSWORD env vars and creates Better Auth user + account
rows so personas can email+password login. Uses the same scrypt hash format
(N=16384, r=8, p=1, dkLen=64) as better-auth.

For uat-super and uat-groomer, the staff record is linked to the Better Auth
user via userId field.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-23 20:23:35 +00:00
Flea Flicker 82f1e3856f fix(e2e): respect PLAYWRIGHT_BASE_URL env var and add host.docker.internal resolution
CI / Test (pull_request) Successful in 28s
CI / Lint & Typecheck (pull_request) Successful in 31s
CI / E2E Tests (pull_request) Successful in 1m32s
CI / Build (pull_request) Successful in 2m32s
CI / Build & Push Docker Images (pull_request) Successful in 35s
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
The Playwright config hardcoded localhost:8080 as baseURL, ignoring
the PLAYWRIGHT_BASE_URL env var set in CI. Docker Compose was also
missing extra_hosts to resolve host.docker.internal on Gitea Actions
runners (which use DIND).

Fixes GRO-1496.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 20:53:30 +00:00
Flea Flicker 526251b63a fix: resolve lint errors and xlarge mismatch for dev→uat promotion
CI / Test (push) Successful in 26s
CI / Lint & Typecheck (push) Successful in 27s
CI / E2E Tests (push) Failing after 3m27s
CI / Update Infra Image Tags (push) Has been skipped
CI / Build (push) Successful in 24s
CI / Build & Push Docker Images (push) Has been skipped
CI / Web E2E (Dev) (push) Has been cancelled
CI / Deploy PR to groombook-dev (push) Has been cancelled
- Remove unused gte/lt/ne imports from cascade.ts
- Prefix unused params originalEndTime, originalStartTime, newStartTime
  with underscore in cascade.ts and appointments.ts callers
- Remove unused petCoatType query param from book.ts availability route
- Align xlarge value: Book.tsx now uses "xlarge" (no hyphen) everywhere
  to match the Zod booking schema

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 20:28:43 +00:00
The Dogfather 3aa7631519 Merge pull request 'fix(GRO-1369): add missing sizeCategory/coatType/bufferMinutes to @groombook/types' (#427) from fix/gro-1369-types-sync into dev
CI / Test (pull_request) Successful in 25s
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Test (push) Successful in 25s
CI / Lint & Typecheck (pull_request) Failing after 23s
CI / E2E Tests (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Lint & Typecheck (push) Failing after 22s
CI / E2E Tests (push) Has been skipped
CI / Build (push) Has been skipped
CI / Build & Push Docker Images (push) Has been skipped
CI / Update Infra Image Tags (push) Has been skipped
CI / Web E2E (Dev) (push) Has been cancelled
CI / Deploy PR to groombook-dev (push) Has been cancelled
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
Merge PR #427: fix(GRO-1369): add missing sizeCategory/coatType/bufferMinutes to @groombook/types

Approved by CTO (review #3463) and QA (review #3469).
Resolves GRO-1369.
2026-05-21 20:00:40 +00:00
The Dogfather 511bdf0d7d Merge pull request 'fix(GRO-1368): remove unused getDb import from consent.ts' (#426) from fix/gro-1368-consent-ts into dev
CI / Lint & Typecheck (push) Failing after 22s
CI / E2E Tests (push) Has been skipped
CI / Build (push) Has been skipped
CI / Build & Push Docker Images (push) Has been skipped
CI / Test (push) Successful in 23s
CI / Update Infra Image Tags (push) Has been skipped
CI / Web E2E (Dev) (push) Has been cancelled
CI / Deploy PR to groombook-dev (push) Has been cancelled
feat(GRO-106): STOP/HELP compliance + consent log (#426)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 19:51:09 +00:00
Flea Flicker de3877b28d docs(app): add UAT_PLAYBOOK.md section 4.20 for STOP/HELP consent handler
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Lint & Typecheck (pull_request) Failing after 24s
CI / Test (pull_request) Successful in 25s
CI / E2E Tests (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
CI / Web E2E (Dev) (pull_request) Has been cancelled
Adds 12 test cases covering:
- STOP/START/HELP flows and their auto-reply verification
- Alias keywords (STOPALL, UNSUBSCRIBE, CANCEL, END, QUIT / UNSTOP, YES, SUBSCRIBE, INFO)
- Idempotency for double STOP and double START
- Case-insensitivity and whitespace trimming
- Non-keyword message rejection
- Consent event audit log verification

Refs: GRO-1205, GRO-1469, PR #426

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 19:50:37 +00:00
Chris Farhood 7d3adeae98 fix(GRO-1368): remove unused getDb import from consent.ts
getDb was imported but never used — db is passed as a parameter to
handleConsentKeyword. This was the primary TypeScript/lint error
flagged by QA.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 19:49:33 +00:00
Chris Farhood 1fbe670751 feat(GRO-106): STOP/HELP compliance + consent log
- Add detectKeyword() and handleConsentKeyword() in consent.ts
- Wire keyword detection into handleMessageReceived() in inbound.ts
- Add 24-unit test suite for consent.ts covering all keywords,
  case insensitivity, whitespace tolerance, idempotency, and
  help keyword state preservation

Fixes from QA review:
- Use getDb() instead of non-existent db export; import Db type
- Destructure clientId from findOrCreateConversation result
- Rename staffId → sentByStaffId in sendMessage call
- Remove messagingHelpReply query (column not yet in schema)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 19:49:33 +00:00
Flea Flicker f265d61475 fix(GRO-1388): correct petSizeCategory enum from "x-large" to "xlarge"
CI / Build (push) Has been skipped
CI / Lint & Typecheck (push) Failing after 21s
CI / Test (push) Successful in 24s
CI / E2E Tests (push) Has been skipped
CI / Build & Push Docker Images (push) Has been skipped
CI / Update Infra Image Tags (push) Has been skipped
CI / Web E2E (Dev) (push) Has been cancelled
CI / Deploy PR to groombook-dev (push) Has been cancelled
The DB schema enum only accepts "xlarge", but the Zod schema and runtime
checks used "x-large". Changed all occurrences to match the schema.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 00:54:12 +00:00
The Dogfather 7d8d7535a5 Merge pull request 'fix(ci): Docker push auth + E2E DinD networking for Gitea' (#423) from fix/ci-e2e-dind-networking-registry-auth into dev
CI / Lint & Typecheck (push) Failing after 18s
CI / Test (push) Successful in 23s
CI / E2E Tests (push) Has been skipped
CI / Build (push) Has been skipped
CI / Build & Push Docker Images (push) Has been skipped
CI / Update Infra Image Tags (push) Has been skipped
CI / Web E2E (Dev) (push) Has been cancelled
CI / Deploy PR to groombook-dev (push) Has been cancelled
test merge
2026-05-21 00:43:08 +00:00
Chris Farhood da14866abe fix(ci): remove GitHub-specific permissions block (Gitea doesn't use them)
CI / Lint & Typecheck (pull_request) Failing after 20s
CI / Test (pull_request) Successful in 23s
CI / E2E Tests (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 00:36:34 +00:00
groombook-engineer[bot] cc45692564 fix(ci): add PLAYWRIGHT_BASE_URL for DinD networking in E2E tests
CI / Lint & Typecheck (pull_request) Failing after 20s
CI / Test (pull_request) Successful in 25s
CI / Build (pull_request) Has been skipped
CI / E2E Tests (pull_request) Has been skipped
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 00:33:04 +00:00
Chris Farhood cc0259975b fix(GRO-1369): add missing sizeCategory/coatType/bufferMinutes to @groombook/types
CI / Lint & Typecheck (pull_request) Successful in 22s
CI / Test (pull_request) Successful in 23s
CI / Build (pull_request) Successful in 23s
CI / E2E Tests (pull_request) Failing after 3m25s
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
Pet interface: added sizeCategory and coatType (nullable strings).
Service interface: added defaultBufferMinutes.
Appointment interface: added bufferMinutes.

These fields are referenced by Book.tsx, cascade.ts, buffer.ts, appointment
routes, and other type-annotated consuming code. Without them, any file that
imports these interfaces and accesses the fields causes a TypeScript error.

cc @cpfarhood

Co-Authored-By: Flea Flicker <noreply@paperclip.ing>
2026-05-20 15:44:08 +00:00
Chris Farhood 8e7a0b22e0 fix(GRO-1367): remove GitHub-specific upload-artifact and workflow_dispatch inputs
CI / Lint & Typecheck (pull_request) Failing after 19s
CI / Test (pull_request) Successful in 23s
CI / E2E Tests (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
- Remove workflow_dispatch.inputs block (GitHub-specific manual trigger args)
- Remove actions/upload-artifact@v4 from e2e job (not available in Gitea Actions)
- Remove actions/upload-artifact@v4 from web-e2e job (not available in Gitea Actions)

tibdex/github-app-token was already removed in prior commits.
2026-05-20 14:46:20 +00:00
Chris Farhood c4268a923e fix(GRO-1367): replace github.com noreply email with Gitea address
CI / E2E Tests (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / Lint & Typecheck (pull_request) Failing after 20s
CI / Test (pull_request) Successful in 24s
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
Replace git config user.email from noreply.github.com to groombook-engineer@farh.net.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 14:42:01 +00:00
The Dogfather bddbf008b5 Merge pull request 'fix: correct apps/ path prefix in promote workflows (GRO-1248)' (#407) from fix/gro-1248-path-prefixes into dev
CI / Lint & Typecheck (push) Successful in 20s
CI / Test (push) Failing after 27s
CI / E2E Tests (push) Has been skipped
CI / Build (push) Has been skipped
CI / Build & Push Docker Images (push) Has been skipped
CI / Update Infra Image Tags (push) Has been skipped
CI / Web E2E (Dev) (push) Has been cancelled
CI / Deploy PR to groombook-dev (push) Has been cancelled
fix: correct apps/ path prefix in promote workflows (GRO-1248) (#407)

Approved-by: gb_lint (QA), gb_dogfather (CTO)
2026-05-20 13:01:11 +00:00
Chris Farhood 12ee1f054b fix(ci): Docker push auth + E2E DinD networking for Gitea
CI / Lint & Typecheck (pull_request) Failing after 19s
CI / Test (pull_request) Successful in 22s
CI / E2E Tests (pull_request) Has been skipped
CI / Build (pull_request) Has been skipped
CI / Build & Push Docker Images (pull_request) Has been skipped
CI / Update Infra Image Tags (pull_request) Has been skipped
CI / Web E2E (Dev) (pull_request) Has been cancelled
CI / Deploy PR to groombook-dev (pull_request) Has been cancelled
- Use git.farh.net registry with REGISTRY_TOKEN instead of ghcr.io/GITHUB_TOKEN
- Migrate all image tags from ghcr.io/groombook/* to git.fars.net/groombook/*
- Replace GHA cache with OCI registry cache (type=registry)
- Replace tibdex/github-app-token with oauth2+REGISTRY_TOKEN for infra clone
- Replace gh pr create/merge with Gitea API curl calls
- Replace actions/github-script@v7 Comment on PR with Gitea issues API curl
- Remove permissions: blocks from deploy-dev and cd jobs (Gitea-native)
- Update deploy-dev kubectl image refs to git.farh.net/groombook/*

Refs: GRO-1344
2026-05-20 11:38:07 +00:00
Chris Farhood 3063fde870 docs: add UAT test cases for size/coat booking and cascading delay
Updated UAT_PLAYBOOK.md §4.5 with TC-APP-4.5.7 through TC-APP-4.5.13
covering the booking wizard dropdowns, buffer-aware duration, cascade
trigger/shift/notification, day-boundary guard rail, and status guards.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 16:19:15 +00:00
Chris Farhood a7b3dc2f02 fix: restore missing columns to pets table
The schema edit that added sizeCategory/coatType accidentally removed
other existing columns (dateOfBirth, healthAlerts, groomingNotes, etc.).
Restoring them now.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 16:13:24 +00:00
Chris Farhood 90af76f222 feat(appointments): cascading delay prevention for appointment overruns
When a PATCH /appointments/:id extends endTime beyond the original, detect
and automatically shift downstream same-groomer appointments by the overrun
delta plus buffer. Only affects scheduled/confirmed appointments; appointments
that would shift outside business hours are flagged for manual review.

Clients receive email notification of rescheduled times.

GRO-1175: GRO-1162-G

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 16:08:05 +00:00
Chris Farhood 0c7cd96130 fix: resolve duplicate 'end' variable declaration in book.ts
Using `let end` so the buffer-aware recalculation can reassign the
variable rather than redeclaring it in a nested scope.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 15:59:24 +00:00
Chris Farhood 4bcc78f1e6 feat: add pet size/coat to booking flow with buffer-aware availability
- Add petSizeCategory and petCoatType dropdowns to booking wizard
  (after breed field, optional but encouraged)
- Pass selected values to GET /availability as query params
- large/x-large pets add service.defaultBufferMinutes to slot calculation
  and appointment end time (buffer never shown to client)
- POST /appointments saves size/coat to pet record
- Confirmation step shows total duration (service + buffer if applicable)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 15:53:56 +00:00
the-dogfather-cto[bot] f27110eb07 Merge pull request #418 from groombook/fix/GRO-1289-fix-ci-yml-infra-path
fix(GRO-1289): correct infra repo paths in ci.yml Update Infra Image Tags job
2026-05-14 20:55:50 +00:00
the-dogfather-cto[bot] d069eff7d6 fix: correct infra repo paths in ci.yml Update Infra Image Tags job (#417)
fix: correct infra repo paths in ci.yml Update Infra Image Tags job
2026-05-14 20:37:48 +00:00
Chris Farhood 3ed1e10ecb fix(GRO-1289): correct infra repo paths in ci.yml Update Infra Image Tags job
Fix 'stat apps/groombook/overlays/dev/kustomization.yaml: no such file'
error by correcting paths from apps/groombook/overlays/dev to apps/overlays/dev
and apps/groombook/base to apps/base.

GRO-1289
2026-05-14 20:36:38 +00:00
Chris Farhood 904cd9c1b9 fix: correct infra repo paths in ci.yml Update Infra Image Tags job
GRO-1287
2026-05-14 20:26:53 +00:00
the-dogfather-cto[bot] 573869e517 fix: correct infra paths in promote-to-uat workflow (#414)
* Promote dev → uat: ARIA modal fix + tip split atomicity (#335)

* feat(GRO-785): validate tip split totals before marking invoice paid

- PATCH /invoices/:id returns 400 when tipCents > 0 but no tip splits
  exist or splits don't sum to 100%
- POST /invoices/:id/tip-splits now returns 400 (not 422) on validation
  failure via router-level ZodError handler

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* feat(GRO-786): add ARIA label attributes to Modal dialog component

- Update Modal component to accept title and titleStyle props
- Add role="dialog", aria-modal="true", and aria-labelledby attributes
- Use useId() to generate stable ID for title heading association
- Update all 4 Modal call sites (New/Edit Client, Add/Edit Pet,
  Log Grooming Visit, Permanently Delete Client) with title props
- Delete modal passes titleStyle for red color on warning

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(GRO-786): remove duplicate dialog role and restore focus trap

- Remove role="dialog" and aria-modal="true" from outer backdrop div
- Keep ARIA attributes only on inner dialog div (the actual modal)
- Restore useEffect focus management: auto-focus first element,
  Tab cycle wrapping, Escape key handler, focus restore on close

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(GRO-785): restore atomic tip split save in PATCH and fix error message

- When body.tipSplits is provided in PATCH /invoices/:id, validate sum
  first then atomically replace existing splits (delete + insert)
- When no incoming splits, validate existing DB splits with corrected
  message: "Tip splits are required when tip amount is greater than zero"
  (previously misleading "must sum to 100%" when no splits existed)

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(GRO-785): address invoice tip split regression

- Use body.tipCents ?? current.tipCents for validation condition
  so that simultaneous status=paid + tipCents=0 skip split validation
- Use body.tipCents (now aliased as tipCents) instead of current.tipCents
  inside the atomic transaction for shareCents calculation
- Add explicit check for empty tipSplits array with appropriate error
  message ("Tip splits are required when tip amount is greater than zero")
  before the sum-to-100% check
- Destructure tipSplits out of body before spreading into update object
  to prevent it from leaking into the invoices table SET clause

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(GRO-785): wrap tip split save + invoice update in single transaction

Both tip split persistence (delete + insert) and the invoice PATCH update
are now inside one db.transaction() block. If the invoice update fails
after splits are written, the entire operation rolls back.

Also removed unnecessary eslint-disable comment on _tipSplits.

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(GRO-785): restore eslint-disable for intentionally unused _tipSplits var

Co-Authored-By: Paperclip <noreply@paperclip.ing>

---------

Co-authored-by: Flea Flicker <fleaflicker@groombook.farh.net>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: the-dogfather-cto[bot] <269737991+the-dogfather-cto[bot]@users.noreply.github.com>

* fix(gro-609): include stripePaymentIntentId in invoice list and wrap stats endpoint in try/catch

- Add stripePaymentIntentId to the GET /invoices list query so the refund button
  renders when seed data includes a payment intent ID
- Wrap /api/invoices/stats/summary in try/catch so errors return 200 with zero
  defaults instead of 5xx, preventing the Invoices page from crashing on
  mount for groomer-role sessions

Parent: GRO-882
Grandparent: GRO-816

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(gro-609): add payment stats to admin dashboard (AppointmentsPage)

- Fetch /api/invoices/stats/summary on mount and display Revenue/Outstanding/Refunds
  summary cards above the calendar view on /admin
- Mirrors the same stats section already on /admin/invoices
- Gracefully handles errors via try/catch on the stats endpoint

Parent: GRO-882
Grandparent: GRO-816

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(GRO-890): populate stripePaymentIntentId on all paid seed invoices

All paid invoices created by the seed script now get a deterministic
stripePaymentIntentId of the form pi_test_seed_NNNNNN, unblocking the
refund button conditional in Invoices.tsx:514 during UAT.

Pending/draft invoices retain null as before.

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(GRO-898): update CI to deploy on dev branch pushes

Update the Update Infra Image Tags job condition to also trigger
on pushes to the dev branch, not just main.

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix: correct infra paths in promote-to-uat workflow

Remove 'groombook/' prefix from 4 path references in promote-to-uat.yml since the groombook/infra repo has apps/overlays/ and apps/base/ at the root, not under a groombook/ subdirectory.

GRO-1274

---------

Co-authored-by: the-dogfather-cto[bot] <269737991+the-dogfather-cto[bot]@users.noreply.github.com>
Co-authored-by: Flea Flicker <fleaflicker@groombook.farh.net>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: lint-roller-qa[bot] <269744346+lint-roller-qa[bot]@users.noreply.github.com>
Co-authored-by: scrubs-mcbarkley-ceo[bot] <269735724+scrubs-mcbarkley-ceo[bot]@users.noreply.github.com>
Co-authored-by: Test User <test@example.com>
Co-authored-by: groombook-engineer[bot] <3141748+groombook-engineer[bot]@users.noreply.github.com>
Co-authored-by: Chris Farhood <chris@farhood.org>
2026-05-14 20:16:22 +00:00
the-dogfather-cto[bot] b31cbce82e fix: VITE_API_URL hardcoding that breaks CI E2E (GRO-1280)
fix: resolve VITE_API_URL hardcoding that breaks CI E2E (GRO-1280)
2026-05-14 20:11:31 +00:00
Chris Farhood 2398dabe3a fix: set VITE_API_URL env var in Build job
Ensures Vite sees VITE_API_URL as an empty string (not undefined) during
pnpm build, so the || window.location.origin fallback fires at runtime
instead of baking in the UAT URL.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 19:51:47 +00:00
Chris Farhood c2dd1dbf84 fix: add explicit ARG/ENV VITE_API_URL to Dockerfile
Without this, Vite sees VITE_API_URL as undefined (not empty string) at
build time. The ?? operator only replaces null/undefined, not a missing var,
so better-auth receives undefined — which it treats as a relative path and
prepends window.location.origin at build time, resulting in the UAT URL being
baked in.

Explicitly setting ARG VITE_API_URL= (empty string) in the Dockerfile makes
Vite see it as defined with empty value, so the || fallback fires at runtime.

Fixes GRO-1280.
2026-05-14 19:51:34 +00:00
Chris Farhood 7339d51acf fix: use window.location.origin as fallback for VITE_API_URL
Vite bakes VITE_* vars at build time, so hardcoding a URL in .env.production
breaks CI E2E which runs on localhost. Now falls back to the browser origin
at runtime, which works correctly since nginx reverse-proxies /api to the
local API container.

Fixes GRO-1280.
2026-05-14 19:40:59 +00:00
Chris Farhood 8eec29ad90 fix: correct infra paths in promote-to-uat workflow
Fix hardcoded apps/groombook/... paths to apps/... per GRO-1274.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 19:27:00 +00:00
groombook-engineer[bot] 050d478621 fix(GRO-1236): set VITE_API_URL and use /admin as OAuth callback URL (#403)
Two root causes fixed:
1. VITE_API_URL was empty in .env.production, so Better-Auth's client
   had no baseURL and could not correctly route the OAuth callback.
2. OAuth callbackURL was window.location.origin (root path), causing
   Better-Auth to redirect to / instead of /admin after login — since
   unauthenticated users at / are redirected to /login, this created a
   loop that appeared as 'session not persisting.'

With VITE_API_URL=https://uat.groombook.dev and callbackURL=/admin,
the callback lands on /admin which renders the admin layout and
correctly establishes the session cookie.

Co-authored-by: Chris Farhood <chris@farhood.org>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-14 19:25:36 +00:00
the-dogfather-cto[bot] 795081cf10 Merge pull request #409 from groombook/fleaflicker/add-staff-messages-uat-playbook
docs(UAT_PLAYBOOK): add §4.20 Staff Messages test cases
2026-05-14 16:45:01 +00:00
Chris Farhood 8d5b71dc0f docs(UAT_PLAYBOOK): add §4.20 Staff Messages test cases
Add missing test coverage for the staff Messages page introduced
by PR #405 (GRO-106). Covers inbox load, conversation open,
send message, empty state, unread indicator, and cross-tenant
isolation per QA review on PR #408.

Updated UAT_PLAYBOOK.md §4.20 — staff Messages feature (GRO-106)
2026-05-14 16:37:04 +00:00
the-dogfather-cto[bot] c2d38bd3ee feat(GRO-106): staff messages page (#405)
feat(GRO-106): staff messages page
2026-05-14 16:23:27 +00:00
Chris Farhood 6a7229f330 merge: resolve conflicts with dev (keep API-aligned frontend)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 16:20:40 +00:00
Chris Farhood 9d9d7da13d fix(GRO-985): fix Messages test mocks and scrollIntoView guard
- Wrap conversation mocks in { items, nextCursor } response shape
  (loadConversations reads json.items, bare array caused undefined.length crash)
- Guard scrollIntoView with ?. (jsdom doesn't implement it)
- Use getAllByText for text appearing in both preview and thread

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 16:15:24 +00:00
lint-roller-qa[bot] 2c29c5e4a9 Merge pull request #406 from groombook/flea-flicker/gro-1248-fix-infra-path-prefix
fix(ci): correct infra repo paths in promote workflows
2026-05-14 16:12:51 +00:00
the-dogfather-cto[bot] ba5f8a916d Merge pull request #398 from groombook/feat/GRO-106-portal-communication-real
feat(GRO-106): portal Communication tab — real backend
2026-05-14 16:07:33 +00:00
Chris Farhood acb65fa5bb fix: correct path prefix apps/groombook -> apps/ in promote workflows
GRO-1248: Path references incorrectly used apps/groombook/ prefix
instead of apps/ for overlay and base kustomization paths.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 16:05:14 +00:00
Chris Farhood e873f11e4f fix(GRO-1241): test and guard scrollIntoView in MessagesPage 2026-05-14 15:46:31 +00:00
Chris Farhood aae11c0c4d fix(GRO-1241): remove unused readOnly and senderName in Communication.tsx
- Rename readOnly to _readOnly in MessageThread destructuring
  (satisfies ESLint no-unused-vars rule)
- Remove unused senderName variable in messages map

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 15:26:03 +00:00
Chris Farhood 537b5cb0b3 fix(GRO-1241): resolve all CI failures from QA review
1. **Remove duplicate staffReadAt** in `packages/db/src/schema.ts`
   (TS1117 duplicate identifier — merge conflict artifact)

2. **Add count to db index exports** in `packages/db/src/index.ts`
   (`count` from drizzle-orm was used in conversations.ts but not exported)

3. **Use dev version of conversations.ts** (no type errors, sql\`count(*)\`)
   — PR branch version had incompatible type errors (staff.businessId,
   count, optedOutAt fields not in schema)

4. **Remove duplicate conversationsRouter import** in `apps/api/src/index.ts`

All 289 tests pass, 0 lint errors.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 14:46:52 +00:00
Chris Farhood d60200f8a7 fix(GRO-1241): remove duplicate staffReadAt + add count mock
- Remove duplicate staffReadAt column in conversations table schema
  (merge conflict artifact — TS1117 duplicate definition)
- Add count mock to conversations.test.ts mock @groombook/db export
  (PR switched from sql\`count(*)\` to Drizzle count() without updating mock)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 14:30:58 +00:00
Chris Farhood f150663047 fix(ci): correct infra repo paths in promote workflows
Replace incorrect `apps/groombook/` path prefix with `apps/` in both
promote-to-uat.yml and promote-prod.yml. The infra repo structure uses
`apps/` directly without a `groombook/` level.

GRO-1248

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 14:00:12 +00:00
Chris Farhood e605e1be74 fix(GRO-1242): align Messages frontend with conversations API contract
- Extract Conversation interface fields to match API response:
  replace lastMessageBody with lastMessage object, externalNumber with
  clientPhone, remove staffReadAt
- loadConversations(): extract json.items array instead of raw array
- loadMessages(): extract json.items and reverse() for chronological order
- Update test mocks to use { items, nextCursor } response shape

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:02:47 +00:00
Chris Farhood c4978be280 feat(GRO-106): staff messages page
- Adds staff conversations API (GET /api/conversations, GET /api/conversations/:id/messages, POST /api/conversations/:id/messages) with auth scoping and cross-tenant protection
- Adds staffReadAt column to conversations table for unread tracking
- Adds staff Messages page with two-column inbox layout (thread list + conversation view + composer)
- Adds Messages entry to staff sidebar navigation
- Includes tests for the MessagesPage component

Part of GRO-106 (SMS/MMS integration) Phase 1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 12:41:35 +00:00
Chris Farhood f43e566dbd fix(GRO-1215): resolve ESLint error, cursor pagination, and UAT playbook gaps
- Add and() + lt() imports from @groombook/db
- Apply businessId to conversation WHERE clause for cross-tenant isolation
  (GET /portal/conversation: clientId AND businessId both scoped)
- Fix cursor pagination: apply lt(messages.createdAt, cursorMsg.createdAt)
  to the cursor WHERE clause so pages actually paginate
- Add UAT_PLAYBOOK.md §4.9.1 Communication tab test cases:
  TC-APP-4.9.6 message history with conversation
  TC-APP-4.9.7 empty state (no conversation yet)
  TC-APP-4.9.8 composer disabled with tooltip
  TC-APP-4.9.9 cross-tenant isolation

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 12:40:06 +00:00