Merged
Conversation
nilotpal-n7
approved these changes
Feb 20, 2026
Collaborator
|
Merging the frontend one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auth
User endpoints: Authorization: Bearer <user_jwt>
Admin endpoints: Authorization: Bearer <admin_jwt>
POST /api/room-cleaning/admin/slots
Request (create)
{
"weekDay": "sunday",
"startTime": "2026-02-15T08:00:00.000Z",
"endTime": "2026-02-15T10:00:00.000Z",
"maxSlots": 5,
"maxBookingsPerUserPerWeek": 1
}
Request (update existing slot)
{
"slotId": "69907738d954acef4db661ad",
"maxSlots": 8,
"maxBookingsPerUserPerWeek": 2
}
Response (success)
{
"message": "Room cleaning slot saved successfully",
"data": {
"id": "69907738d954acef4db661ad",
"hostelId": "690720609bfe9286a32bf8d0",
"weekDay": "sunday",
"startTime": "2026-02-15T08:00:00.000Z",
"endTime": "2026-02-15T10:00:00.000Z",
"maxSlots": 5,
"maxBookingsPerUserPerWeek": 1,
"bookedSlots": 0,
"availableSlots": 5
}
}
2. User: List Slots
GET /api/room-cleaning/slots?hostelId=&weekDay=sunday
Response (success)
{
"slots": [
{
"id": "69907738d954acef4db661ad",
"hostelId": "690720609bfe9286a32bf8d0",
"weekDay": "sunday",
"startTime": "2026-02-15T08:00:00.000Z",
"endTime": "2026-02-15T10:00:00.000Z",
"maxSlots": 5,
"maxBookingsPerUserPerWeek": 1,
"bookedSlots": 1,
"availableSlots": 4
}
]
}
3. User: Create Booking
POST /api/room-cleaning/booking/request
Request
{
"slotId": "69907738d954acef4db661ad",
"requestedDate": "2026-02-15",
"notes": "Please come after 9 AM"
}
Response (success)
{
"message": "Room cleaning slot booked successfully",
"status": "confirmed",
"booking": {
"user": "6968fddfb06d9116d2ed1147",
"hostelId": "690720609bfe9286a32bf8d0",
"slot": "69907738d954acef4db661ad",
"requestedDate": "2026-02-14T18:30:00.000Z",
"notes": "Please come after 9 AM",
"status": "confirmed",
"_id": "699077834a272d2b5193d7d8",
"createdAt": "2026-02-14T13:24:19.779Z",
"updatedAt": "2026-02-14T13:24:19.779Z",
"__v": 0
},
"availability": {
"requestedDate": "2026-02-14T18:30:00.000Z",
"maxSlots": 5,
"bookedSlots": 1,
"availableSlots": 4
}
}
Response (weekly limit hit)
{
"message": "Weekly booking limit reached for room cleaning",
"status": "pending"
}
4. User: Cancel Booking
POST /api/room-cleaning/booking/cancel
Request
{
"bookingId": "699077834a272d2b5193d7d8"
}
Response (success)
{
"message": "Room cleaning booking cancelled successfully",
"status": "cancelled",
"booking": {
"_id": "699077834a272d2b5193d7d8",
"user": "6968fddfb06d9116d2ed1147",
"hostelId": "690720609bfe9286a32bf8d0",
"slot": "69907738d954acef4db661ad",
"requestedDate": "2026-02-14T18:30:00.000Z",
"notes": "Please come after 9 AM",
"status": "cancelled",
"createdAt": "2026-02-14T13:24:19.779Z",
"updatedAt": "2026-02-14T13:24:20.633Z",
"__v": 0
},
"availability": {
"requestedDate": "2026-02-14T18:30:00.000Z",
"bookedSlots": 0
}
}
Response (too late to cancel)
{
"message": "Cancellation window is closed for this booking",
"status": "pending"
}
5. User: My Bookings
GET /api/room-cleaning/booking/my
Response (success)
{
"bookings": [
{
"_id": "699077854a272d2b5193d7ee",
"user": "6968fddfb06d9116d2ed1147",
"hostelId": "690720609bfe9286a32bf8d0",
"slot": {
"_id": "69907738d954acef4db661ae",
"weekDay": "sunday",
"hostelId": "690720609bfe9286a32bf8d0",
"startTime": "2026-02-15T09:30:00.000Z",
"endTime": "2026-02-15T10:30:00.000Z",
"maxSlots": 5,
"maxBookingsPerUserPerWeek": 1,
"bookedSlots": 1
},
"requestedDate": "2026-02-14T18:30:00.000Z",
"notes": "limit b2 after cancel",
"status": "confirmed",
"createdAt": "2026-02-14T13:24:21.290Z",
"updatedAt": "2026-02-14T13:24:21.290Z",
"__v": 0
}
]
}