-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Location: backend/src/bookings/
Description
After a booking is created, admins need to manage its lifecycle — confirming it once payment is verified, marking it complete after the session ends, or cancelling it when needed. Members should also be able to cancel their own pending bookings. Each transition must validate that the current status allows the requested change to prevent invalid state jumps.
Acceptance Criteria
-
PATCH /bookings/:id/confirm— admin only (ADMIN,SUPER_ADMIN,STAFF)- Validates booking exists and current status is
PENDING— throwsBadRequestExceptionif not - Sets status to
CONFIRMED - Returns
{ success: true, message: "Booking confirmed successfully", data: Booking }
- Validates booking exists and current status is
-
PATCH /bookings/:id/cancel— accessible by the booking owner or admin- Validates booking exists
- Member can only cancel their own booking — throws
ForbiddenExceptionotherwise - Validates current status is
PENDINGorCONFIRMED— throwsBadRequestExceptionif alreadyCOMPLETEDorCANCELLED - Sets status to
CANCELLED - Returns
{ success: true, message: "Booking cancelled successfully", data: Booking }
-
PATCH /bookings/:id/complete— admin only- Validates booking exists and current status is
CONFIRMED— throwsBadRequestExceptionif not - Sets status to
COMPLETED - Returns
{ success: true, message: "Booking completed successfully", data: Booking }
- Validates booking exists and current status is
- Each action is handled by a dedicated provider class
-
npx tsc --noEmitpasses with no errors
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers