Skip to content

Added Room Cleaning Backend Feature#160

Merged
aditya-samal merged 2 commits intodevfrom
RsbhThakur
Mar 11, 2026
Merged

Added Room Cleaning Backend Feature#160
aditya-samal merged 2 commits intodevfrom
RsbhThakur

Conversation

@RsbhThakur
Copy link
Collaborator

Auth

User endpoints: Authorization: Bearer <user_jwt>
Admin endpoints: Authorization: Bearer <admin_jwt>

  1. Admin: Create/Update Slot
    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
}
]
}

@Ayan-Bain Ayan-Bain self-assigned this Feb 19, 2026
@nilotpal-n7 nilotpal-n7 self-requested a review February 20, 2026 08:05
@Ayan-Bain Ayan-Bain removed their assignment Feb 20, 2026
@aditya-samal
Copy link
Collaborator

Merging the frontend one

@aditya-samal aditya-samal reopened this Feb 21, 2026
@aditya-samal aditya-samal merged commit 2907490 into dev Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants