Files
playzer/apps/backend
Jose Selesan dce312d426 feat: add reschedule functionality for admin bookings
- Implemented rescheduleAdminBooking service to allow users to change court and time for confirmed bookings.
- Added validation for court availability, maintenance status, and overlapping bookings.
- Created reschedule-admin-booking handler to process rescheduling requests and send confirmation emails.
- Updated booking email service to include rescheduling notifications.
- Enhanced frontend components to support booking rescheduling, including a new dialog for selecting new court and time.
- Added tests for rescheduling logic, covering various scenarios including validation errors and successful reschedules.
- Updated Prisma schema to log previous court and time for audit purposes.
2026-06-24 08:38:10 -03:00
..

To install dependencies:

bun install

To run:

bun run dev

open http://localhost:3000

Tests

Run all backend tests:

bun run test

Test naming convention

  • *.test.ts or *.spec.ts: service-level tests. These run with the shared Prisma preload at test/support/prisma.mock.ts.
  • *.handler.test.ts: handler-level tests. These should mock the service module locally with mock.module(...) and import the handler after the mock is in place.
  • Keep business logic tests focused on the service layer.
  • Use handler tests only to verify request parsing, status mapping, and response shaping.
  • Put shared Prisma mocking helpers in test/support/.