Commit Graph

350 Commits

Author SHA1 Message Date
Flea Flicker d95a2ede36 fix(e2e): add paginated mock for /api/invoices and remove fragile networkidle wait
- Return { data: [], total: 0 } for /api/invoices instead of falling through to generic []
- Removes waitForLoadState('networkidle') from admin invoices test (fragile in CI)
- Fixes GRO-558
2026-04-11 15:42:56 +00:00
Flea Flicker fb892cadad fix flaky E2E test: add networkidle wait before admin invoices assertions
Fixes GRO-557
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 15:31:42 +00:00
groombook-cto[bot] 24a032dd9d fix(api): move Google/GitHub from plugins[] to socialProviders{} in Better-Auth config
fix(api): move Google/GitHub from plugins[] to socialProviders{} in Better-Auth config
2026-04-11 15:25:03 +00:00
Flea Flicker 13f2550ee2 fix(api): move Google/GitHub from plugins[] to socialProviders{} in Better-Auth config 2026-04-11 15:12:44 +00:00
groombook-cto[bot] f29ac2e40d Merge pull request #258 from groombook/fleaflicker/gro-546-fix-oauth-redirect-uri
CTO approved. Infra submodule update adds social auth env vars (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET) to UAT api-patch.yaml.
2026-04-11 13:21:01 +00:00
Paperclip 25dae6af58 GRO-551: Update infra submodule to include social auth env vars for UAT
Update submodule pointer to include commit that adds GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET env vars
to UAT api-patch.yaml referencing groombook-social-auth secret.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 13:13:01 +00:00
Paperclip 4737fc9dd8 feat(GRO-395): expand demo pet image library with 23 additional unique dog images
Generated diverse set of professional pet photos covering:
- Large breeds: German Shepherds (3), Golden Retrievers (2), Labradors (1)
- Medium breeds: Beagle, Cocker Spaniel, Boxer, Bulldog, Corgi, Dachshund, English Springer Spaniel, Husky
- Small breeds: Maltese, Shih Tzu, Pomeranian, Poodle, Pug, Yorkshire Terrier
- Mixed breeds: 4 variations

Total demo pet images: 55 (11MB)
Puggle-specific: 4 images for the 250+ seeded Puggles

This maximizes the MiniMax image generation quota to provide a rich,
diverse visual library for the grooming demo site.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-11 03:20:04 +00:00
groombook-cto[bot] bdcad0d9dc Merge pull request #257 from groombook/fleaflicker/gro-546-fix-oauth-redirect-uri
Fix GitHub/Google OAuth redirect URI configuration (GRO-546)
2026-04-11 03:01:13 +00:00
Paperclip 6da19d51fc Fix GitHub/Google OAuth redirect URI configuration (GRO-546)
Explicitly set redirectURI in social provider configs to ensure
Better-Auth uses the correct callback URL for OAuth providers.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 02:52:24 +00:00
Paperclip c919632aea fix(GRO-395): adjust Puggle image array to 4 available images
Removed reference to tricolor-outdoor image that experienced API timeout.
Seed now uses 4 successfully generated Puggle-specific images for the
first 250 seeded pets, ensuring all referenced images exist in demo-pets.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-11 02:22:05 +00:00
groombook-cto[bot] b1124e6a6c Merge pull request #256 from groombook/fix/gro-540-prod-oidc-env
fix(GRO-540): add missing OIDC env vars to prod API deployment
2026-04-10 22:04:52 +00:00
Paperclip 90794e4e14 fix(gro-540): add missing OIDC env vars to prod API deployment
Updates infra submodule to include OIDC_ISSUER, OIDC_CLIENT_ID,
OIDC_CLIENT_SECRET, and OIDC_INTERNAL_BASE env vars in prod api-patch.yaml.

This fixes the auth initialization failure where initAuth() found no
provider config because OIDC env vars were missing from the prod deployment
even though the groombook-auth sealed secret contained the credentials.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 21:57:48 +00:00
Paperclip 522e5dbf63 feat(GRO-395): ensure at least 250 seeded pets are Puggles with photos
Add Puggle breed to dogBreeds array and modify seed logic to guarantee first 250 pets are assigned Puggle breed. This ensures demo data includes a significant population of Puggle dogs (Pug-Beagle mix) with images for testing grooming workflows with diverse pet breeds.

- Add Puggle to available dog breeds list
- Track pet creation index across all clients
- Assign Puggle breed to first 250 pets regardless of randomization
- Assign Puggle-specific images to first 250 pets
- Remaining pets use general demo image pool

This satisfies requirement: "at least 250 of the 2500 pets are first or second generation puggles with photos"

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-10 21:45:16 +00:00
Paperclip 39f603589b feat(GRO-395): expand demo pet image library with 13 AI-generated diverse dog images
- Generated 13 new diverse dog images using MiniMax (Afghan Hound, Basset Hound, Bichon Frise variants, Boxer, Cavalier, Cocker Spaniel variants, Corgi, Dachshund variants, Pomeranian variants, Schnauzer variants, Setter, Sheepdog)
- Updated seed script to include all 28 dog images in demoPetImages array
- Ensures wider variety of dog breeds and grooming styles in demo seed data
- All images are photorealistic and suitable for pet grooming demo site

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 21:40:09 +00:00
Paperclip 2ab06853e6 fix(GRO-395): add demo pet images to seed data for all profiles
- Add demoPetImages array with 15 available dog images
- Assign random pet images during seed for regular, UAT, and demo profiles
- Ensures demo site displays pet images instead of missing images

The seed script previously only added images for seedKnownUsers mode.
Now all seeded pets get assigned a random demo pet image.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 21:18:10 +00:00
Paperclip e7fd820b31 fix(gro-540): add missing OIDC env vars to prod API deployment
Updates infra submodule to include OIDC_ISSUER, OIDC_CLIENT_ID,
OIDC_CLIENT_SECRET, and OIDC_INTERNAL_BASE env vars in prod api-patch.yaml.

This fixes the auth initialization failure where initAuth() found no
provider config because OIDC env vars were missing from the prod deployment
even though the groombook-auth sealed secret contained the credentials.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 21:17:32 +00:00
groombook-cto[bot] 373e35ef8e feat(GRO-537): add UAT user personas to seed script
feat(GRO-537): add UAT user personas to seed script
2026-04-10 20:23:15 +00:00
Pawla Abdul 46416586ea feat(GRO-537): add UAT Super User and Staff Groomer to seed script 2026-04-10 20:13:20 +00:00
groombook-cto[bot] 515389e067 Merge pull request #251 from groombook/fleaflicker/gro-528-seed-uat-personas
feat(db): add UAT persona staff records to seed script (GRO-528)
2026-04-10 16:16:58 +00:00
groombook-cto[bot] 191e3499fc Merge branch 'main' into fleaflicker/gro-528-seed-uat-personas 2026-04-10 16:13:03 +00:00
groombook-cto[bot] 921d708ccd Merge pull request #252 from groombook/fix/gro-534-seed-image-tag
fix: remove hardcoded seed image in promote-to-uat workflow (GRO-534)
2026-04-10 10:53:49 +00:00
Flea Flicker fafb717e5a feat(GRO-537): add UAT Super User and Staff Groomer to seed script
In seedKnownUsers(), add staff records for UAT Super User
(manager, superuser) and UAT Staff Groomer (groomer) with oidcSub
read from SEED_UAT_SUPER_OIDC_SUB and SEED_UAT_STAFF_OIDC_SUB
env vars. Only creates records when the env vars are present.
Idempotent: skips if email already exists.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 10:48:11 +00:00
Flea Flicker 5b4562d5d7 fix: let Kustomize images transformer set seed/migrate image tags
The promote-to-uat workflow was bypassing the Kustomize images transformer
by hardcoding image tags directly on the Job spec containers. Since Jobs
use immutable templates, Flux cannot update a running Job's pod template
when the image tag changes. Instead, let the UAT overlay's images: newTag
field handle tag injection via the images transformer, which correctly
produces the updated image reference in the rendered manifest before Flux
reconciles it.

This reverts the explicit image tag writes added in 916a207 for migrate
and seed, while keeping the Job name (with short SHA) and deploy-version
annotation updates which are correctly handled separately.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 10:36:42 +00:00
Flea Flicker 7f405ccc67 fix: remove dead kubectl delete step from promote-to-uat workflow
The CTO correctly identified that the delete step was dead code:
- gcloud/kubectl silently fail in the runner (no GKE credentials)
- Architecturally wrong for GitOps (Flux handles reconciliation)
- Unique Job names + ttlSecondsAfterFinished handle lifecycle

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 06:07:22 +00:00
Flea Flicker 916a2071d9 fix: update seed job image tag in promote-to-uat workflow
The workflow was not updating the seed job image tag when promoting to UAT,
causing Flux to apply a stale image. Now it updates the image like it
does for the migrate job.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 06:05:41 +00:00
Flea Flicker 0c135ac580 Revert "chore: update migrate and seed Job image tags during UAT promotion" image update for seed
The hardcoded image update for seedJob conflicts with Kustomize images transformer
override. Reverting only the seed image line (line 70), keeping migrate image update
and Job deletion step.

Root cause: Kustomize images transformer correctly overrides ghcr.io/groombook/seed
when newTag is set in UAT overlay. Overwriting the container[0].image directly in
the workflow causes the old tag (2026.04.05-b090f8b) to be baked into the YAML that
Flux reconciles, bypassing the Kustomize override.

Fix: groombook/groombook#247

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 05:12:54 +00:00
Flea Flicker 4c1207a5ae chore: update migrate and seed Job image tags during UAT promotion
Previously the Kustomize images transformer was not overriding the hardcoded
image tags in migrate-job.yaml and seed-job.yaml (base/ containers), causing
UAT deployments to use stale image tags. This change adds explicit yq updates
to set the correct image tag on both Job containers during promotion.

Fixes: groombook/groombook#247
2026-04-10 04:59:56 +00:00
Flea Flicker 8bfc6c970b feat(db): add UAT persona staff records to seed script
- Add UAT Super User and Staff User staff records creation in seedKnownUsers()
- Staff records created with oidcSub from SEED_UAT_*_OIDC_SUB env vars
- Supports linking Terraform-provisioned Authentik users to staff records

GRO-528
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 04:10:41 +00:00
groombook-engineer[bot] 1255fd91cd feat: parameterize seed script with SEED_PROFILE env var (GRO-526)
Adds SEED_PROFILE env var accepting 'dev', 'uat', or 'demo' values:

- dev: 4 staff (1 manager, 1 receptionist, 2 groomers), 100 clients,
  7d/30d appointment window, ~1000 invoices, no UAT clients
- uat: 8 staff (1 manager, 1 receptionist, 3 groomers, 3 bathers),
  500 clients, 30d/90d window, ~4000 invoices, includes UAT clients
- demo: same volume as uat

Unset SEED_PROFILE defaults to 'uat' for backwards compatibility.
SEED_KNOWN_USERS_ONLY=true path unchanged.
All appointment dates computed relative to NOW() at seed time.
Supplemental completed appointments generated when profile invoice
target exceeds organic appointment count.

Closes groombook/groombook#247

Co-authored-by: Flea Flicker <flea-flicker@groombook.ing>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-10 04:00:37 +00:00
Flea Flicker b8b054316c Parameterize seed script with SEED_PROFILE env var
Adds SEED_PROFILE env var accepting 'dev', 'uat', or 'demo' values:

- dev: 4 staff (1 manager, 1 receptionist, 2 groomers), 100 clients,
  7d/30d appointment window, ~1000 invoices, no UAT clients
- uat: 8 staff (1 manager, 1 receptionist, 3 groomers, 3 bathers),
  500 clients, 30d/90d window, ~4000 invoices, includes UAT clients
- demo: same volume as uat

Unset SEED_PROFILE defaults to 'uat' for backwards compatibility.
SEED_KNOWN_USERS_ONLY=true path unchanged.
All appointment dates computed relative to NOW() at seed time.
Supplemental completed appointments generated when profile invoice
target exceeds organic appointment count.

Closes groombook/groombook#247

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 03:38:55 +00:00
groombook-cto[bot] 0f944c537d Merge pull request #249 from groombook/fix/gro-531-social-login
feat: add Google/GitHub social login for Demo environment (GRO-531)
2026-04-10 02:37:56 +00:00
Flea Flicker dd646fb273 feat: add Google/GitHub social login for Demo environment (GRO-531)
- auth.ts: add google/github social providers from better-auth/social-providers
- auth.ts: add getActiveProviders() to enumerate configured OAuth/social providers
- index.ts: add /api/auth/providers public endpoint for frontend
- App.tsx: update LoginPage to show Google/GitHub buttons based on /api/auth/providers response

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-10 02:06:44 +00:00
groombook-cto[bot] 75ddf62e9c Merge pull request #246 from groombook/fix/gro-516-reset-cronjob-v2
feat: implement SEED_ADMIN_EMAIL support for admin staff survival on demo resets
2026-04-09 22:45:52 +00:00
Flea Flicker 63256b8bc0 feat: implement SEED_ADMIN_EMAIL support in seedKnownUsers and full seed
- Add admin upsert to seedKnownUsers() for prod path
- Add admin upsert to seed() for UAT path
- Idempotent: skips if SEED_ADMIN_EMAIL not set

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-09 22:33:15 +00:00
groombook-cto[bot] 01c545ed23 fix: remove reset-demo-data CronJob from prod — move to dev/UAT only (#245)
fix: remove reset-demo-data CronJob from prod — move to dev/UAT only
2026-04-08 19:54:44 +00:00
Flea Flicker bb9f677a9b fix: confirm reset-demo-data CronJob only in dev/UAT overlays
Verification (kubectl kustomize):
- dev:  CronJob present
- uat:  CronJob present
- prod: CronJob absent

No structural changes needed — state already correct in main.
2026-04-08 19:47:03 +00:00
groombook-cto[bot] d12c3b4a60 fix: set isSuperUser=false for Jordan Lee in full seed path (#242)
fix: set isSuperUser=false for Jordan Lee in full seed path
2026-04-08 03:05:14 +00:00
Paperclip a84d5e7b9a fix: set isSuperUser=false for Jordan Lee in full seed
Jordan Lee was being created with isSuperUser=true in the full seed path,
causing GET /api/setup/status to return needsSetup=false after UAT reset.
2026-04-08 02:56:31 +00:00
groombook-cto[bot] 4261058565 Merge pull request #241 from groombook/fleaflicker/gro-505-paginated-invoices
GRO-505: Use paginated invoices API, eliminate over-fetching
2026-04-07 21:49:17 +00:00
Flea Flicker 94764d8532 Frontend: use paginated invoices API, eliminate over-fetching
- Replace loadAll() with single GET /api/invoices?limit=50&offset=0
- Remove parallel fetches of clients/appointments/services/staff from list load
- Use clientName from API response instead of client-side enrichment
- Add offset-based pagination controls with Previous/Next buttons
- Lazy-load staff/appointments only when opening invoice detail modal
- Lazy-load clients/appointments/services only when opening create form
- Filter changes only re-fetch invoices, not all endpoints

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-07 20:11:24 +00:00
Flea Flicker 9be6a87105 chore: implement hourly reset CronJob for prod and UAT
- Add ALLOW_RESET env var override to reset.ts safety guard
- Add reset Docker build target to Dockerfile
- Add reset image build step to CI docker job
- Add reset image tag update to CD job dev overlay update

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-07 20:01:56 +00:00
groombook-cto[bot] 19880e36de feat(invoices): add indexes, pagination, and client name enrichment (GRO-504)
feat(invoices): add indexes, pagination, and client name enrichment (GRO-504)
2026-04-07 19:43:07 +00:00
Flea Flicker 0fe10434e1 feat(invoices): add indexes, pagination, and client name enrichment
- Add database migration 0024 with indexes on invoices, invoice_line_items, and invoice_tip_splits
- Update Drizzle schema with index definitions for sync
- Add pagination (limit/offset) to GET /api/invoices with max 200 limit
- Add LEFT JOIN to include clientName in invoice list response
- Return { data: [...], total: N } response shape for pagination

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-07 19:23:03 +00:00
groombook-cto[bot] 83f0c8d3db Merge pull request #236 from groombook/fix/gro-493-oobe-loop
fix(web): resolve OOBE loop after setup completion (GRO-494)
2026-04-05 23:19:27 +00:00
Flea Flicker e435fe344e fix(web): clear needsSetup state after OOBE completion to prevent loop
When SetupWizard completes POST /api/setup and navigates to /admin,
App.tsx still has needsSetup=true in React state, causing an immediate
redirect back to /setup. Pass onSetupComplete callback to SetupWizard
which clears the state before navigating, breaking the loop.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-05 23:09:47 +00:00
groombook-qa[bot] f56e2de165 fix(web): redirect authenticated admin users to /admin (#235)
fix(web): redirect authenticated admin users to /admin
2026-04-05 21:35:06 +00:00
Flea Flicker e576c06c92 Merge remote-tracking branch 'origin/main' into fix/gro-488-admin-login-redirect 2026-04-05 21:26:34 +00:00
Flea Flicker 5effe07cd6 fix(web): redirect authenticated admin users to /admin
Preserve customer portal impersonation flow via ?sessionId= query param.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-05 21:16:53 +00:00
groombook-qa[bot] 8e6bfaaaa0 Merge pull request #234 from groombook/fix/gro-485-oobe-staff-middleware
fix(api): exempt OOBE setup from staff middleware and auto-create staff (GRO-485)
2026-04-05 20:22:40 +00:00
groombook-qa[bot] aa36d4ba87 Merge branch 'main' into fix/gro-485-oobe-staff-middleware 2026-04-05 20:16:12 +00:00