import BaseEntity from '../../common/entities/BaseEntity'; import JourneyStop from '../../JourneyStop/entity/JourneyStop'; import Vehicle from '../../Vehicle/entity/Vehicle'; import Journey from '../../Journey/entity/Journey'; import PassengerAllocation from '../../PassengerAllocation/entity/PassengerAllocation'; export default class JourneyVehicleStop extends BaseEntity { protected _journey_vehicle_stops: Array = []; protected _number_of_seats: number; protected _journey: Journey; protected _vehicle: Vehicle; protected _journey_stop: JourneyStop; protected _scheduled_arrival_time: string; protected _actual_arrival_time: string; protected _scheduled_departure_time: string; protected _actual_departure_time: string; private _passengers_allocated_pickup: Array = []; private _passengers_allocated_dropoff: Array = []; protected _name: string; private _journey_stop_id: string; get journey_vehicle_stops(): Array { return this._journey_vehicle_stops; } set journey_vehicle_stops(journey_vehicle_stops: Array) { this._journey_vehicle_stops = journey_vehicle_stops; } get number_of_seats(): number { return this._number_of_seats; } set number_of_seats(value: number) { this._number_of_seats = value; } get journey(): Journey { return this._journey; } set journey(value: Journey) { this._journey = value; } get vehicle(): Vehicle { return this._vehicle; } set vehicle(value: Vehicle) { this._vehicle = value; } get journey_stop(): JourneyStop { return this._journey_stop; } set journey_stop(value: JourneyStop) { this._journey_stop = value; } get scheduled_arrival_time(): string { return this._scheduled_arrival_time; } set scheduled_arrival_time(scheduled_arrival_time: string) { this._scheduled_arrival_time = scheduled_arrival_time; } get actual_arrival_time(): string { return this._actual_arrival_time; } set actual_arrival_time(actual_arrival_time: string) { this._actual_arrival_time = actual_arrival_time; } get scheduled_departure_time(): string { return this._scheduled_departure_time; } set scheduled_departure_time(scheduled_departure_time: string) { this._scheduled_departure_time = scheduled_departure_time; } get actual_departure_time(): string { return this._actual_departure_time; } set actual_departure_time(actual_departure_time: string) { this._actual_departure_time = actual_departure_time; } get name(): string { return this._name; } set name(name: string) { this._name = name; } get journey_stop_id(): string { return this._journey_stop_id; } set journey_stop_id(value: string) { this._journey_stop_id = value; } get passengers_allocated_pickup(): Array { return this._passengers_allocated_pickup; } set passengers_allocated_pickup(value: Array) { this._passengers_allocated_pickup = value; } get passengers_allocated_dropoff(): Array { return this._passengers_allocated_dropoff; } set passengers_allocated_dropoff(value: Array) { this._passengers_allocated_dropoff = value; } hasPassengersToPickupOrDrop() { return this.passengers_allocated_pickup.length + this.passengers_allocated_dropoff.length > 0; } isRemovable() { return !this.hasPassengersToPickupOrDrop(); } }