Le protocole de calcul sur le prix ne semble pas très adapté au

Transcription

Le protocole de calcul sur le prix ne semble pas très adapté au
Bookings
ID: Integer
Confirm_Date: Timestamp With Time Zone
Bill: Integer !! Montant en centimes
Currency: Character Varying(5)
Class: Enum(E, B)
Flight_Numbers: String[]
Users
#Primary
ID: Integer
#Constraints
for i from 1 to num(Flights)-1
Flight_Numbers[i+1] is in Flights[i+1].Flight_Numbers
if Flights[i+1] exists
(if Flights[i+1].From is Flights[i].To AND Flight_Numbers[i] is in Flights[i+1].Flight_Numbers
Flights[i+1].Departure > Flights[i].Arrival
else if Flights[i+1].From is Flights[i].To
Flights[i+1].Departure > Flights[i].Arrival + 02:00
else
Flights[i+1].Departure > Flights[i].Arrival + 03:00)
AND Flights[i].To.City is Flights[i+1].From.City
Le protocole de calcul sur le prix ne semble pas très adapté au format des contraintes,
surtout en tenant compte du nombre élevé d'indirections qui sont à mettre en jeu, et
relativement au fait qu'une fois qu'un client a choisi une offre qui comporte un prix, il
ne peut pas être modifié sans rompre le contrat.
ID: Integer
First Name: Character Varying(100)
Last Name: Character Varying(100)
Password: Character Varying(100)
E-Mail Address: Character Varying(150)
BUYS
1..1
0..n
IS ATTACHED TO
1..n
IS BOOKED BY
Distance
Les "Flights" sont des instances avec une date/heure universels fixés.
L'idée est qu'un "Schedule" définit des règles de planification, mais
ne permet pas d'avoir des instances claires de vols facilement identifiables.
Un "Flight" est par exemple programmé au premier janvier 2016 à 14h30 UTC et
non à 14h30 les jours 1, 2, 3 et 5 de la semaine. L'affichage avec la bonne
zone temporelle est facile à faire.
BOOKS
ID: Integer
AP1: String
AP2: String
Distance: Integer
#Primary
ID: Integer
0..n
Flights
2..2
ID: Integer
From: String
To: String
Departure: Timestamp With Time Zone
Arrival: Timestamp With Time Zone
Day_Offest: Integer
Aircraft: Integer
Duration: Integer
Flight_Numbers: String[]
SEPARATES
IS SEPARATED BY
#Primary
ID: Integer
#Constraints
Flight.Day_Offset = Schedule.Day_Offset
Flight.Duration = Schedule.Duration
Flight.Departure matches Schedule.Departure within Schedule.Valid_From to Schedule.Valid_To
regarding Schedule.Days
Flight.Arrival matches Schedule.Arrival regarding Schedule.Duration
Flight.From = Schedule.From
Flight.To = Schedule.To
Flight.Aircraft = Schedule.Aircraft
Flight.Flight_Numbers = Schedule.Flight_Numbers
0..n
Cities
Airports
Name: String
#Primary
Name: String, Countriy.Name
CONTAINS
1..n
1..1
IS IN
1..1
IATA: String
Full Name: String
ICAO: String
Latitude: Decimal(3,6)
Longitude: Decimal(3,6)
Altitude: Integer
Timezone: Integer
DST: Enum(A, E, N, O, S, U, Z)
1..1
Les numéros des vols sont séparés, pour
faciliter la correspondance "many to many".
#Primary
IATA: String
0..n
1..1
Flight Numbers
Number: String
From: String
To: String
DEFINES
IS BOUND TO
#Primary
Number: String
CONNECTS
IS CONNECTED BY
1..n
RECEIVES
Aircrafts
IS GIVEN TO
IATA: String
Full Name: String
ICAO: String
Capacity: Integer
Country: Integer
COUNTRY CONTAINS CITY
CITY IS IN COUNTRY
2..n
1..1
Schedules
ID: Integer
From: String
To: String
Valid_From: Timestamp With Time Zone
Valid_To: Timestamp With Time Zone
Days: Small Integer[]
Departure: Time
Arrival: Time
Day_Offest: Integer
Aircraft: Integer
Duration: Integer
#Primary
IATA: String
COUNTRY CONTAINS AIRPORT
AIRPORT IS IN COUNTRY
1..n
1..n
0..n
CHARTERS
#Primary
ID: Integer
IS SCHEDULED IN
#Constraints
Schedule.Arrival normalized to Schedule.To.Timezone + Schedule.Day_Offset Schedule.Departure normalized to Schedule.From.Timezone = Duration
IS BUILT IN
1..1
HOLDS PRODUCTION OF
1..1
SETS UP
0..n
0..n
IS DEFINED BY
Companies
Countries
Name: String
#Primary
Name: String
0..n
HAS HEADQUARTERS IN
0..n
1..1
IS HEADQUARTER FOR
IATA: String
Full Name: String
ICAO: String
Callsign: String
Country: Integer
Login Salt: String
Password: String
E-Mail Dispatch: String
#Primary
IATA: String
0..n
Précision importante : les vols
avec stops sont enregistrés en
plusieurs "schedules", avec
les mêmes numéros de vol.
L'instanciation en "Flights"
permet, à l'aide des dates
"absolues" de valider le fait
qu'ils sont enchaînés, et donc
constituent un seul et même
vol.