Skip to content

Enable booking functionality#38

Open
Sappymukherjee214 wants to merge 5 commits intoAMANkumar0004:mainfrom
Sappymukherjee214:enable-booking-functionality
Open

Enable booking functionality#38
Sappymukherjee214 wants to merge 5 commits intoAMANkumar0004:mainfrom
Sappymukherjee214:enable-booking-functionality

Conversation

@Sappymukherjee214
Copy link
Contributor

This pull request adds major new features to the application, including a booking system for listings, user dashboards for managing bookings and trips, and an itinerary planner with favorites functionality. It also introduces new database schemas and validation, updates navigation, and improves schema validation and seed data handling.

Issue: #29

Booking System and Validation

  • Added a complete booking system: users can book listings (except their own), with guest count and date validation, and owners can view booking history for their listings. Includes a new Booking model and booking-related controllers, routes, and middleware. [1] [2] [3] [4] [5] [6] [7] [8]
  • Users now have a "My Bookings" dashboard to view their booking history. [1] [2] [3] [4] [5]

Itinerary Planner and Favorites

  • Introduced an itinerary planner: users can add listings to favorites, create/edit/delete itineraries, and view them in a dedicated dashboard. Includes new Itinerary model and planner routes/controllers. [1] [2] [3] [4] [5] [6]

Schema and Model Enhancements

  • Updated Listing schema to include maxGuests for guest validation during booking. [1] [2]
  • Updated user schema to support a favorites array for the planner feature.

Seed Data and Environment Handling

  • Improved seed data initialization: ensures required fields and environment variable loading, and closes DB connection after seeding.

UI/UX Improvements

  • Navigation bar now includes links to "My Bookings" and "My Trips" dashboards for logged-in users.
  • Minor fixes to map display code for consistency.

These changes collectively provide users with the ability to book listings, manage their bookings, plan trips, and maintain favorites, significantly enhancing the application's functionality and user experience.

Screenshot:

image

Copilot AI review requested due to automatic review settings March 4, 2026 10:07
@Sappymukherjee214
Copy link
Contributor Author

@AMANkumar0004 I have added the feature along with screenshot. Please label the PR for the issue #29

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables end-to-end booking and trip-planning functionality, adding booking creation/history views plus a favorites-based itinerary planner.

Changes:

  • Added Booking and Itinerary models with corresponding routes/controllers and new dashboard views.
  • Introduced favorites + itinerary planner UI and navigation entry points.
  • Expanded listing schema/validation to support max guest limits and booking validation.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
wanderLust Updates subproject pointer to include the new booking/planner work.
views/users/dashboard.ejs Adds “My Bookings” dashboard UI.
views/planner/new_itinerary.ejs Adds itinerary creation form with dynamic destination items.
views/planner/edit_itinerary.ejs Adds itinerary editing UI with dynamic items.
views/planner/dashboard.ejs Adds planner dashboard showing favorites + itineraries.
views/listings/show.ejs Adds booking form, favorites toggle, and refactors map data bootstrapping.
views/listings/new.ejs Adds “max guests” input to listing creation UI.
views/listings/edit.ejs Adds “max guests” input to listing edit UI.
views/listings/bookings.ejs Adds owner-facing booking history table for a listing.
views/includes/navbar.ejs Adds nav links to “My Bookings” and “My Trips”.
routes/user.js Adds /dashboard route (bookings dashboard).
routes/planner.js Adds favorites + itinerary planner endpoints.
routes/booking.js Adds nested booking endpoints under listings.
public/js/map.js Updates map initialization to use refactored listing bootstrap data.
models/user.js Adds favorites field referencing listings.
models/listing.js Adds maxGuests and formatting updates.
models/itinerary.js Introduces Itinerary schema/model.
models/booking.js Introduces Booking schema/model.
middleware.js Adds Joi booking validation middleware.
init/index.js Updates seeding behavior and environment loading.
controllers/users.js Adds dashboard controller to render user bookings.
controllers/bookings.js Adds booking creation + listing booking-history controllers.
app.js Wires planner + booking routers and formats session config.
Schema.js Adds booking schema and extends listing schema with maxGuests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AMANkumar0004
Copy link
Owner

@Sappymukherjee214 conflicts

@Sappymukherjee214
Copy link
Contributor Author

@AMANkumar0004 conflicts resolved

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.

3 participants