Commit Graph

374 Commits

Author SHA1 Message Date
groombook-cto[bot] dadabb0ea7 fix(GRO-631): pin pnpm version and guard against duplicate CD PRs
fix(GRO-631): pin pnpm version and guard against duplicate CD PRs
2026-04-14 17:41:07 +00:00
groombook-cto[bot] d5a8b19322 Merge branch 'main' into feature/gro-631-ci-pnpm-pin 2026-04-14 17:34:02 +00:00
groombook-cto[bot] 4d1d94296f fix(GRO-631): add tag validation to promote-prod workflow (#282)
CTO review approved. Tag format validation and GHCR image existence check are correct and well-placed.
2026-04-14 16:40:07 +00:00
groombook-cto[bot] c6800a6144 Merge branch 'main' into feature/gro-631-prod-tag-validation 2026-04-14 16:35:46 +00:00
groombook-cto[bot] 000e90a617 feat(GRO-631): add security headers to nginx.conf
feat(GRO-631): add security headers to nginx.conf
2026-04-14 16:25:57 +00:00
Flea Flicker 70e9465b68 fix(GRO-631): add tag validation to promote-prod workflow
- Validate tag format against regex YYYY.MM.DD-sha7 before proceeding
- Verify image exists in GHCR using gh api with packages: read permission
- Add packages: read permission to job permissions block

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-14 16:22:23 +00:00
Flea Flicker 8c3e0f9554 feat(GRO-631): add security headers to nginx.conf
Add X-Content-Type-Options, X-Frame-Options, Referrer-Policy, X-XSS-Protection,
and Permissions-Policy headers to server block and static assets location.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-14 16:10:04 +00:00
Flea Flicker f4f522d5e6 fix(GRO-631): pin pnpm version and guard against duplicate CD PRs
- Pin pnpm/action-setup@v4 to version 9.15.4 in all 5 jobs
- Add duplicate PR guard in CD job before gh pr create
- Remove stale kubectl delete job migrate-schema command

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-14 15:56:15 +00:00
Flea Flicker e8455195ee feat(GRO-631): add Docker HEALTHCHECK and update .dockerignore
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-14 15:47:06 +00:00
groombook-cto[bot] c438f5772c feat(GRO-607): Stripe Elements payment UI replacing mock flow
* GRO-605: Stripe SDK integration + payment service

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

* GRO-606: Add payment API endpoints (pay invoice, payment methods, refunds)

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

* feat(GRO-597): Stripe payment backend — schema, service, API, webhooks

Consolidates GRO-605, GRO-606, GRO-608 into a single clean PR:
- GRO-605: Stripe SDK integration + payment service
- GRO-606: Payment API endpoints (pay invoice, payment methods, refunds)
- GRO-608: Stripe webhook handler

Migration consolidation:
- Single 0026_stripe_payment.sql migration adds stripeCustomerId to clients
  and stripe_payment_intent_id, stripe_refund_id, payment_failure_reason to invoices
- Removed duplicate 0027_stripe_identifiers.sql

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

* GRO-607: Install Stripe frontend packages

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

* GRO-607: Add /portal/config endpoint + rename date field

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

* GRO-607: Replace mock payment flow with real Stripe Elements

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

* fix(GRO-607): Stripe Elements payment UI - lint/type fixes

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

* fix(GRO-607): remove unused eslint-disable directive in CustomerPortal

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

* fix(GRO-607): CTO review fixes — payment security and correctness

- Fix multi-invoice total calculation: use inArray() instead of eq()
  on single ID, sum all invoices not just first
- Add ownership check to payment method deletion: verify the payment
  method belongs to the authenticated Stripe customer before detaching
- Remove duplicate /config endpoint in portal.ts
- Fix webhook Stripe client: use getStripeClient() from payment service
  instead of constructing with WEBHOOK_SECRET
- Remove unnecessary body validator on /invoices/:id/pay route
- Export getStripeClient() for use by stripe-webhooks.ts
- Add inArray import to payment.ts

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-14 08:27:03 +00:00
groombook-qa[bot] 4f6a1e8149 fix(GRO-574): switch rate limit to memory storage to unblock UAT
* feat(GRO-566): add SKIP_OOBE env var to bypass setup wizard

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

* Add rate_limit table migration for Better Auth (GRO-574)

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

* fix(GRO-574): switch rate limit to memory storage to unblock UAT

Better Auth rate_limit table migration exists on branch but hasn't
been deployed to UAT. Switching to memory storage bypasses the
missing table entirely, restoring auth functionality immediately.

Memory storage is per-instance (not shared) — rate limiting still
functions but won't be distributed across pods. This is acceptable
for UAT while the migration is being promoted through the pipeline.

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

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: groombook-qa[bot] <269744346+groombook-qa[bot]@users.noreply.github.com>
2026-04-12 12:20:00 +00:00
groombook-cto[bot] be3cfa9a54 Merge pull request #268 from groombook/feature/gro-565-better-auth-phase3
feat(GRO-565): Better Auth Phase 3 - password change, OIDC discovery, session cleanup, email verification
2026-04-12 11:29:06 +00:00
groombook-cto[bot] 06e7ddaa61 Merge branch 'main' into feature/gro-565-better-auth-phase3 2026-04-12 11:25:35 +00:00
groombook-cto[bot] 15131b72f0 fix(GRO-574): add rate_limit table migration for Better Auth
Adds the missing rate_limit table that Better Auth v1.5.6 requires when rateLimit.storage is set to 'database'. Without this table, all auth endpoints return HTTP 500.

Also includes GRO-566: SKIP_OOBE env var to bypass setup wizard in dev/test.

cc @cpfarhood
2026-04-12 03:30:45 +00:00
Paperclip bc1f11a901 feat(GRO-565): Better Auth Phase 3 - password change, OIDC discovery, session cleanup, email verification
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-12 02:47:17 +00:00
groombook-cto[bot] f4e34f2826 fix(GRO-564): prevent admin nav logout button overflow
fix(GRO-564): prevent admin nav logout button overflow
2026-04-12 02:31:46 +00:00
Paperclip 2396eaab4d fix(GRO-564): wrap admin nav links in scrollable div to prevent logout overflow
- Add flexShrink:0 to logo div to prevent shrinking
- Wrap Book + NAV_LINKS in scrollable div with overflow-x:auto, flex:1, minWidth:0
- Add flexShrink:0 to all nav links
- Move logout button outside scrollable div with flexShrink:0 instead of marginLeft:auto
- Keeps logout button always visible regardless of nav item count

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-12 02:07:04 +00:00
groombook-ceo[bot] 97b71d5396 feat(GRO-564): Better Auth Phase 2 Security Hardening
feat(GRO-564): Better Auth Phase 2 Security Hardening
2026-04-11 23:07:36 +00:00
Paperclip bbe95df9ca merge: resolve conflict with main for GRO-564 security hardening
Keep rate limiting config from feature branch during merge with main.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 22:59:50 +00:00
Paperclip 1380d5a9d3 feat(GRO-564): Better Auth Phase 2 security hardening
- Add logout button to admin layout header (signOut from better-auth)
- AUTH_DISABLED production guard already present in auth.ts middleware
- Remove automatic email-based staff-user linking (security fix)
- Add PATCH /api/staff/:id/link-user endpoint for manual linking by admins
- Add rate limiting to Better Auth (10 req/min, database storage)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 22:53:00 +00:00
groombook-cto[bot] 41dff6f0e2 fix(GRO-563): stabilize OAuth login - upgrade better-auth, fix service worker, add 503 handling
Phase 1 Better Auth stabilization:
- Upgrade better-auth to ^1.5.6 in apps/web (matches api)
- Switch OAuth state to cookie storage (BA v1.5+ requirement)
- Remove manual redirectURI overrides
- Exclude /api/auth/* from service worker caching
- Add 503 error handling when auth not configured
- Display login errors inline on login page
- Update infra submodule with social auth env vars

Closes GRO-563

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 21:07:41 +00:00
Paperclip 8002a3db96 fix(GRO-563): stabilize OAuth login - upgrade better-auth, fix service worker, add 503 handling
- apps/web: upgrade better-auth from ^1.0.0 to ^1.5.6 (matches API)
- apps/web/vite.config.ts: exclude /api/auth/* from service worker caching
- apps/api/index.ts: return 503 when auth not configured
- apps/api/middleware/auth.ts: return 503 when auth not initialized

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 20:35:10 +00:00
Paperclip 88e6845027 chore: update infra submodule to include social auth env vars (GRO-545)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 18:13:24 +00:00
Paperclip 085c8b9cfa fix(GRO-545): switch OAuth state to cookie storage and add login error display
The OAuth callback was failing with "please_restart_the_process" because
Better-Auth's default DB-backed state (verification table) was unreliable —
the UAT hourly reset wipes all tables including verification records. Switch
to cookie-based state storage so the encrypted state survives in the browser
cookie across the redirect flow.

Also removes explicit redirectURI from socialProviders (Better-Auth derives
it from baseURL) and adds visible error feedback on the login page when
OAuth callbacks fail.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 18:01:59 +00:00
groombook-qa[bot] 1d76c63137 fix(e2e): use domcontentloaded instead of networkidle in admin invoices test
The networkidle wait causes flakiness in CI due to slow external resource loading.
Use domcontentloaded which fires earlier and is sufficient for SPA navigation checks.

Co-authored-by: Pawla Abdul (Bot) <pawla@groombook.dev>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-11 16:50:35 +00:00
groombook-engineer[bot] 9a0a63d1df fix(gro-558): add paginated mock for /api/invoices (#261)
fix(e2e): add paginated mock for /api/invoices in navigation.spec.ts

Fixes GRO-557. The generic E2E API mock returned [] for /api/invoices, but the InvoicesPage component expects { data: [], total: 0 }. This crashed React and prevented the page from rendering, causing the admin invoices test to fail consistently.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-11 16:38:51 +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