'Car Rental System : System design . perseisting date range
Imagine we system design situation - car rental service like zoom car. Here users can search cars in the particular date range. like user A comes and search between 27 March and 30 March. here his intention is booking for 3 days.
How we will persist this range booking in DB.Like entity structure. for example, where suppose we save a booking in this form:
class CarBooking{
Car car;
User user;``
Date startDate;
Date endDate;
Date booking date;
}
But Now another comes and want to search for available cars in date 28 March to 1 April . How will be managing this search logic? Like, will be search booking for each date (28 to 1) and see how many cars are not booked for all range?
Or some other entity structure search logic is needed
Its theoretical question discussing best design
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
