Commit Graph
5 Commits
Author SHA1 Message Date
GandClaude Opus 5 c65ac4b7d7 chore: add a formatter (#71)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style: format with prettier (252 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: teach git blame to skip the reformat

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 10:05:01 +00:00
g-butandClaude Sonnet 4.6 2bfb48cd4f test(api): add integration tests for admin users and professionals routes
18 new tests: admin/users GET (401, empty list, isVerified=null for pet_owner,
isVerified from vetProfiles); admin/users/[userId] PATCH (401, invalid role,
self-demotion guard, last-admin guard, promote, 404); admin/professionals/[userId]
PATCH (401, 400 non-pro, 404 no profile, 200 verify vet/sitter, 404 no profile).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 22:12:18 +02:00
g-butandClaude Sonnet 4.6 2fdae4ddfb feat(admin): add professional verification — isVerified toggle in admin panel
- Add /api/admin/professionals/[userId] PATCH endpoint (admin-only, sets isVerified)
- Update /api/admin/users GET to include isVerified status for vet/sitter users
- Admin users table: Verified column with Verify/revoke toggle buttons
- VerifyCell component: handles no-profile, unverified, and verified states
- Stats card: replace Admins count with Verified Profiles count
- Use inArray() instead of or(...map()) for professional ID filtering

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 15:19:42 +02:00
g-butandClaude Sonnet 4.6 da93c12230 feat(admin): add role management — promote users to vet/sitter/admin
- New PATCH /api/admin/users/[userId] endpoint (admin-only) with guards
  against self-demotion and removing the last admin
- Admin users page: inline role dropdown per row, optimistic update,
  "Saving…" indicator; adds Veterinarians stat card

Unblocks Phase 2: admins can now promote users to veterinarian/pet_sitter
so they can create professional profiles and accept bookings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 14:14:55 +02:00
g-butandClaude Sonnet 4.6 cfadd2ba2e feat(admin): add admin panel users page + health chart polish
Admin panel:
- app/(admin)/admin/layout.tsx: dark sidebar with teal logo, user chip, back-to-portal link
- app/(admin)/admin/users/page.tsx: users table with stats (total, pets, admins), role badges
- app/api/admin/users/route.ts: GET all users with pet count (requireAdmin guard)

Health page polish:
- Replace bg-green-50/bg-red-50 raw classes with design tokens (--green-bg/--danger-bg)
- Swap 📊 emoji empty state for Lucide BarChart3 icon in teal box
- Replace ← text arrow with ChevronLeft icon

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 15:12:44 +02:00