Green-Light-Innovation / flight-booking-system

CMP5332 Flight Booking System Coursework Project
1 stars 0 forks source link

Max Flight Capacity can be exceeded #1

Closed Aduceus closed 1 year ago

Aduceus commented 1 year ago

When passengers are added to a Flight object there are no checks against the max capacity attribute passengerCapacity within the addPassengers() method of the Flight class, allowing for more passengers to be booked to a flight than the capacity allows for. https://github.com/Green-Light-Innovation/flight-booking-system/blob/3d3c17fee2d095a9c29c2faee6d4d9bcf50f778b/src/bcu/cmp5332/bookingsystem/model/Flight.java#L199-L205

Aduceus commented 1 year ago

Fixed here https://github.com/Green-Light-Innovation/flight-booking-system/blob/647c347695da55b5152bccdf8f64935729c263d2/src/bcu/cmp5332/bookingsystem/model/Flight.java#L210-L223