Commit Graph

6 Commits

Author SHA1 Message Date
Chris Farhood 821ea0046d Auto-create staff records for OAuth users with no existing staff record
Fixes GRO-1118 - uat-tester receives HTTP 403 post-login

When a user authenticates via OAuth but has no corresponding staff record,
the RBAC middleware now auto-creates a staff record with a default
"receptionist" role instead of returning 403. This allows new OAuth
users to access the app immediately.

The middleware now checks for staff records in this order:
1. By userId (Better-Auth user ID)
2. By oidcSub (legacy OIDC subject)
3. By email (auto-link existing staff)
4. Create new staff record if authenticated user has email and name

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-12 19:19:02 +00:00
the-dogfather-cto[bot] c9b699527c docs: add UAT_PLAYBOOK.md for API service (#3)
docs: add UAT_PLAYBOOK.md for API service
2026-05-11 14:14:31 +00:00
Chris Farhood 54a6b047fb docs: add UAT_PLAYBOOK.md for API service
Created comprehensive UAT playbook covering all 13 route groups with test cases for authentication, client management, pet management, appointment scheduling, services, staff management, invoicing & payments, customer portal, waitlist, search, reports, impersonation, and settings & setup.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-11 13:47:51 +00:00
Hugh Hackman 1855b374b5 refactor: inline packages/db and packages/types into api package
Phase 2 extraction: groombook/api from groombook/app monorepo.

Changes:
- Move packages/db content to apps/api/src/db/
- Move packages/types content to apps/api/src/types/
- Inline database schema and migrations into api package
- Update Dockerfile to build single package
- Update CI workflow for single-package structure
- Fix vitest.config.ts aliases

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 21:21:42 +00:00
Hugh Hackman 004725ae6e Add pnpm-lock.yaml
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 21:11:55 +00:00
Hugh Hackman 51f95e0fd6 Initial extraction: groombook/api from groombook/app monorepo
Part of GRO-802 monorepo breakdown.

Changes:
- Extract apps/api/ as the main API service
- Inline packages/db/ (database schema, migrations, utilities)
- Inline packages/types/ (shared TypeScript types)
- Add CI workflow for lint, typecheck, test, build, docker
- Port Dockerfile with 4 stages: runner, migrate, seed, reset

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 21:10:21 +00:00