Feature Overview:
Currently users can create listings but cannot book them. We need to implement a booking system.
Requirements:
Add a Book Now button on listing detail page
Create a Booking model with fields user reference, listing reference, checkIn date, checkOut date, totalPrice, and guests
Prevent users from booking their own listing
Save booking data in database
Connect booking with user dashboard
Technical Notes:
Create Booking schema inside models folder
Add booking routes such as POST /bookings
Add controller logic for booking creation
Use authentication middleware
Calculate total price based on stay duration
Acceptance Criteria:
Booking gets stored in MongoDB
Booking appears in user dashboard
Proper validation for dates
User cannot book their own listing
Feature Overview:
Currently users can create listings but cannot book them. We need to implement a booking system.
Requirements:
Add a Book Now button on listing detail page
Create a Booking model with fields user reference, listing reference, checkIn date, checkOut date, totalPrice, and guests
Prevent users from booking their own listing
Save booking data in database
Connect booking with user dashboard
Technical Notes:
Create Booking schema inside models folder
Add booking routes such as POST /bookings
Add controller logic for booking creation
Use authentication middleware
Calculate total price based on stay duration
Acceptance Criteria:
Booking gets stored in MongoDB
Booking appears in user dashboard
Proper validation for dates
User cannot book their own listing