fix(admin): pagination, patch tests, and per-page limits

Backend:
- Fix GetAllAdminBookingsHandler and SearchAdminBookingsHandler to
  return totalPages in response
- Auto-record patch tests when booking status progresses to "completed"
- Add GET/POST /api/admin/users/{id}/patch-tests endpoints
  Frontend:
- BookingsCard: proper pagination with 4 per page, prev/next buttons
- UsersCard, BookingCreateModal, WalkInCreateModal: per_page=4 for user
  search
- Add PatchTestModal for manual patch test entry in UserModal
- Hide patch test section when user has no eligible services
  Database:
- Add UNIQUE constraint on user_service_patch_tests(user_id, service_id)
This commit is contained in:
2026-02-20 22:17:37 +00:00
parent 5a4cd29b44
commit 7b0259c0db
11 changed files with 454 additions and 76 deletions
+2
View File
@@ -178,6 +178,8 @@ func main() {
r.Route("/admin/users", func(r chi.Router) {
r.Get("/", user.ListAdminUsersHandler)
r.Get("/{id}", user.GetAdminUserHandler)
r.Get("/{id}/patch-tests/eligible", user.GetEligiblePatchTestServicesHandler)
r.Post("/{id}/patch-tests", user.AddPatchTestHandler)
})
r.Route("/admin/today", func(r chi.Router) {