diff --git a/db.mv.db b/db.mv.db index ba83a79..866d9fe 100644 Binary files a/db.mv.db and b/db.mv.db differ diff --git a/diagrams/entities/entities.plantuml b/diagrams/entities/entities.plantuml deleted file mode 100644 index 5516e89..0000000 --- a/diagrams/entities/entities.plantuml +++ /dev/null @@ -1,100 +0,0 @@ -@startuml entities - -class Airport { - __ attributes __ - - id: Long - - airportName: String - - city: String - - country: String - - longitude: double - - latitude: double - - timezone: int -} - -class Airline { - __ attributes __ - - id: Long - - name: String - - country: String - - price: double - // more properties, like calculator, restriction etc. -} - -class Route { - __ attributes __ - - routeId: Long - - srcAirportId: Long - - dstAirportId: Long - - connections: Array -} - -class Connection { - __ attributes __ -<<<<<<< HEAD - - connectionId: int - - airline: String - - srcAirport: String - - dstAirport: String - - departureDate: Date - - arrivalDate: Date -======= - - connectionId: Long - - airlineId: Long - - srcAirportId: Long - - dstAirportId: Long ->>>>>>> 7e004466981416afe071e0209bf859e41c7e3e9d -} - -class Flight { - __ attributes __ - - flightId: Long - - connection: Connection - - peopleCapacity: int - - departureDate: Date - - arrivalDate: Date -} - -class Ticket { - __ attributes __ - - ticketId: Long - - flight: Flight - - passenger: Passenger - - purchaseDate: Date - - flightClass: String - - seatNumber: int - - maxLuggageWeight: double - - price: Price - // maybe more parameters -} - -class Passenger { - __ attributes __ - -firstname: String - -surname: String - -dateOfBirth: Date - -phoneNumber: String - -email: String - -idOrPesel: String -} - -class Trip { - __ attributes __ - - id: Long - - oneWayTrip: boolean - - tickets: Array - - departureDate: Date - - arrivalDate: Date - - totalPrice: Price -} - -Route --.> Airport -Route --.> Airline -Route o-- Connection -Connection --.> Airline -Connection --.> Airport -Flight o-- Connection -Ticket o-- Flight -Ticket *-- Passenger -Trip *-- Ticket - -@enduml diff --git a/diagrams/entities/entities.svg b/diagrams/entities/entities.svg index 2cbdeae..6b6a1bd 100644 --- a/diagrams/entities/entities.svg +++ b/diagrams/entities/entities.svg @@ -1,105 +1,108 @@ -Airportid: intiata: Stringicao: StringairportName: Stringcity: Stringcountry: Stringcoordinates: Pointtimezone: intattributesAirlineid: intiata: Stringicao: Stringname: String// more properties, like calculator, restriction etc.attributesRouterouteId: intsrcAirportCode: StringdstAirportCode: Stringconnections: Array<Connection>attributesConnectionconnectionId: intairline: StringsrcAirport: StringdstAirport: StringattributesFlightflightId: intconnection: ConnectionpeopleCapacity: intdepartureDate: DatearrivalDate: DateattributesTicketticketId: intflight: Flightpassenger: PassengerpurchaseDate: DateflightClass: StringseatNumber: intmaxLuggageWeight: doubleprice: Price// maybe more parametersattributesPassengerfirstname: Stringsurname: StringdateOfBirth: DatephoneNumber: Stringemail: StringidOrPesel: StringattributesTripid: intoneWayTrip: booleantickets: Array<Ticket>departureDate: DatearrivalDate: DatetotalPrice: PriceattributesAirportid: Longname: Stringcity: Stringcountry: Stringlongitude: doublelatitude: doubletimezone: intattributesAirlineid: Longname: Stringcountry: StringattributesConnectionid: LongsrcAirport: AirportdstAirport: AirportdepartureDate: LocalDateTimearrivalDate: LocalDateTimeattributesFlightid: Longconnection: Connectionairline: AirlinenumberSeats: intprice: doubleattributesTicketid: Longpassenger: PassengerpurchaseDate: LocalDateTimeseatNumber: intprice: doubleconnections: Array<Flight>//luggage weight, flightClassattributesPassengerfirstname: Stringsurname: StringdateOfBirth: LocalDatephoneNumber: Stringemail: Stringpesel: StringattributesTripid: LongoneWayTrip: booleantickets: Array<Ticket>departureDate: LocalDateTimearrivalDate: LocalDateTimetotalPrice: Price//one way tripattributesAvaiableTripsid: LongavaiableTrips: Array<Trip>attributes \ No newline at end of file diff --git a/diagrams/entities/entities.txt b/diagrams/entities/entities.txt new file mode 100644 index 0000000..2ab605a --- /dev/null +++ b/diagrams/entities/entities.txt @@ -0,0 +1,83 @@ +@startuml +class Airport { + __ attributes __ + - id: Long + - name: String + - city: String + - country: String + - longitude: double + - latitude: double + - timezone: int +} + +class Airline { + __ attributes __ + - id: Long + - name: String + - country: String +} + +class Connection { + __ attributes __ + - id: Long + - srcAirport: Airport + - dstAirport: Airport + - departureDate: LocalDateTime + - arrivalDate: LocalDateTime +} + +class Flight { + __ attributes __ + - id: Long + - connection: Connection + - airline: Airline + - numberSeats: int + - price: double +} + +class Ticket { + __ attributes __ + - id: Long + - passenger: Passenger + - purchaseDate: LocalDateTime + - seatNumber: int + - price: double + - connections: Array + //luggage weight, flightClass +} + +class Passenger { + __ attributes __ + -firstname: String + -surname: String + -dateOfBirth: LocalDate + -phoneNumber: String + -email: String + -pesel: String +} + +class Trip { + __ attributes __ + - id: Long + - oneWayTrip: boolean + - tickets: Array + - departureDate: LocalDateTime + - arrivalDate: LocalDateTime + - totalPrice: Price + //one way trip +} + +class AvaiableTrips { + __ attributes __ + - id: Long + - avaiableTrips: Array +} + +Connection --.> Airline +Connection --.> Airport +Flight *-- Connection +Ticket o-- Passenger +Ticket o-- Flight +Trip *-- Ticket +AvaiableTrips o-- Trip +@enduml \ No newline at end of file diff --git a/src/main/resources/db/migration/V2__init_Connection_Route_and_ConnectionRoute_table.sql b/src/main/resources/db/migration/V2__init_Connection_Route_and_ConnectionRoute_table.sql index b6c1f6b..bae8a3e 100644 --- a/src/main/resources/db/migration/V2__init_Connection_Route_and_ConnectionRoute_table.sql +++ b/src/main/resources/db/migration/V2__init_Connection_Route_and_ConnectionRoute_table.sql @@ -6,7 +6,6 @@ create table connections( connection_id bigint auto_increment , airport_src_id bigint not null, airport_dst_id bigint not null, - airline_id bigint not null, number_seats int not null, departure_date date not null, arrival_date date not null,