-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Description
In the makeReservation method we set the Car's available field to false. After that when finding the available cars we have placed a check on this available field of the Car object to see if it is available. This leads to incorrect behavior as then cars would only be booked once. Consider the following example: suppose there is a booking for a car from 20/04/2025 to 24/04/2025, therefore during the makeReservation call, this car's available field is set to false. Now if i want to make another reservation, say from 25/04/2025 to 30/04/2025, the condition "car.isAvailable()" will prevent me from making the reservation, while it is a valid reservation.
Metadata
Metadata
Assignees
Labels
No labels