Promote dev → main: GRO-639, GRO-642, GRO-666, GRO-724 #318

Merged
the-dogfather-cto[bot] merged 15 commits from dev into main 2026-04-17 11:43:47 +00:00

15 Commits

Author SHA1 Message Date
the-dogfather-cto[bot] 6e1e51fba7 fix(GRO-639): replace N+1 per-appointment queries with single JOIN query (#306)
fix(reminders): replace N+1 per-appointment queries with single JOIN query
2026-04-17 10:45:17 +00:00
groombook-engineer[bot] 5a8ea2fd14 Merge pull request #313 from groombook/feature/gro-628-frontend-error-handling
fix(GRO-628): implement frontend error handling and code quality fixes
2026-04-17 07:12:27 +00:00
Test User b00d6a8ca0 fix(GRO-642): restrict allowed logo MIME types to bitmap formats only
Exclude image/svg+xml from the frontend allowlist since SVG poses greater
XSS risk due to its ability to contain scripts, even with proper Content-Type
validation. The server-side validation (commit 8182870) still accepts SVG
and validates magic bytes, but the frontend restrict to safer bitmap formats
as specified in the issue.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-17 06:46:24 +00:00
Test User f8ea417799 fix(GRO-642): sanitize logo MIME type to prevent XSS in data URL rendering
Add ALLOWED_LOGO_TYPES allowlist check before constructing data URL from
user-controlled logoBase64 and logoMimeType fields. Only MIME types that
the API explicitly accepts (image/png, image/jpeg, image/gif, image/webp,
image/svg+xml) can be rendered as data URLs.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-17 06:45:14 +00:00
groombook-engineer[bot] edf2ef8f7e fix(GRO-666): leave staff.user_id NULL in seed so middleware can auto-link by email (#314)
The resolveStaffMiddleware auto-links on first API call when staff.user_id
IS NULL. Setting userId at seed time blocks this path since Better-Auth's
user.id is opaque and unknown pre-auth. Remove userId from all staff inserts
so the middleware can populate it on first authenticated call.

Co-authored-by: Test User <test@example.com>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-17 06:35:33 +00:00
Flea Flicker 8182870d38 feat(GRO-642): add logo magic-bytes validation to prevent MIME confusion attacks
Defensive validation in /api/branding ensures base64-encoded logo content
matches its declared MIME type by checking image magic bytes (PNG, JPEG,
GIF, WebP). If the content doesn't match, the legacy base64 fields are
nulled out before returning to prevent MIME type confusion attacks.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-17 02:58:15 +00:00
Test User 5df8837b5f ci: add dev to pull_request branch list
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-17 02:08:08 +00:00
Flea Flicker 0abb79010d fix(GRO-639): replace sql ANY() with inArray for Drizzle compatibility
Use Drizzle's inArray() instead of raw sql template with = ANY()
to avoid PostgreSQL array binding issues in the reminder scheduler
bulk sent-check query.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-17 02:08:03 +00:00
Test User eab97b2ebd fix(GRO-666): leave staff.user_id NULL in seed so middleware can auto-link by email
The resolveStaffMiddleware auto-links on first API call when staff.user_id
IS NULL. Setting userId at seed time blocks this path since Better-Auth's
user.id is opaque and unknown pre-auth. Remove userId from all staff inserts
so the middleware can populate it on first authenticated call.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-17 01:32:28 +00:00
Test User f301b1a5a0 fix(GRO-642): add real-time validation for tip split percentages
Add pre-submit validation in markPaid() that checks tip split percentages
sum to 100% before allowing the payment to be processed. This addresses
Finding #7 from the frontend code quality review (GRO-628).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-17 00:56:10 +00:00
Paperclip c786544369 Fix frontend error handling and code quality (GRO-642)
HIGH Priority:
1. SetupWizard.jsx -> SetupWizard.tsx: renamed to .tsx with proper TypeScript types
2. deleteAppt missing error handling: added try/catch, response.ok check, alert on failure
3. GlobalSearch missing error state: added error state with user-visible error message

MEDIUM Priority:
4. CustomerPortal unsafe type cast: fixed 'as any' to proper PortalAppointment type
5. Logo upload XSS risk: sanitized MIME types to png/jpeg/gif/webp only, removed SVG
6. Reports error handling: added ok checks before json() parsing to guard against invalid JSON on error responses

LOW Priority:
8. Modal accessibility: added role='dialog', aria-modal='true', focus trap, Escape key handler, restore focus on close
9. PetPhotoUpload file size: added 50MB max file size check before resize
10. Types package: added photoKey and photoUploadedAt to Pet interface

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-16 22:38:23 +00:00
groombook-engineer[bot] 85c76b5209 fix(GRO-724): rename dev hostname from groombook.dev.farh.net to dev.groombook.dev (#308)
Updates playwright baseURL to the canonical dev.groombook.dev FQDN
per canonical infra targets.

Co-authored-by: Flea Flicker <fleaflicker@groombook.farh.net>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-16 18:58:03 +00:00
Chris Farhood d8dbec1be1 Merge pull request #304 from groombook/docs/branch-strategy-contributing
docs: add CONTRIBUTING.md with branch strategy (GRO-702)
2026-04-16 06:59:15 -04:00
Scrubs McBarkley 4a65c30d40 docs: fix bash snippet quoting and add uat→main pr command
- Fix \n quoting in two gh pr create commands: use ANSI-C $'...'
  quoting so newlines render correctly in PR bodies (not literal \n)
- Add missing gh pr create example for the UAT → main promotion step

Addresses Greptile review feedback on PR #304.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-16 10:43:12 +00:00
Scrubs McBarkley cab17e0230 docs: add CONTRIBUTING.md with branch strategy
Document the three-branch GitOps model (dev/uat/main), developer
workflow, promotion flow, and branch protection rules.

Refs GRO-702

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-16 10:39:40 +00:00