diff --git a/db/master-data.cds b/db/master-data.cds index 950fada3..ae6b9221 100644 --- a/db/master-data.cds +++ b/db/master-data.cds @@ -5,9 +5,12 @@ namespace sap.fe.cap.travel; @cds.autoexpose @readonly aspect MasterData {} +// Annotation @cds.collate: false will disable language-dependent ordering. +type AirlineId : String(3) @cds.collate: false; +type ConnectionId : String(4) @cds.collate: false; entity Airline : MasterData { - key AirlineID : String(3); + key AirlineID : AirlineId; Name : String(40); CurrencyCode : Currency; AirlinePicURL : String @UI : {IsImageURL : true}; @@ -15,7 +18,7 @@ entity Airline : MasterData { }; entity Airport : MasterData { - key AirportID : String(3); + key AirportID : String(3) @cds.collate : false; Name : String(40); City : String(40); CountryCode : Country; @@ -23,7 +26,7 @@ entity Airport : MasterData { entity Supplement : managed, MasterData { - key SupplementID : String(10); + key SupplementID : String(10) @cds.collate : false; Price : Decimal(16, 3); Type : Association to SupplementType; Description : localized String(1024); @@ -35,9 +38,9 @@ entity Flight : MasterData { // when cuid is added, the to_Airline & to_Connection can be made managed association, // furthermore the AirlineID and ConnectionID can be removed, // they will be replaced by the generate FKs for to_Airline & to_Connection - key AirlineID : String(3); + key AirlineID : AirlineId; key FlightDate : Date; - key ConnectionID : String(4); + key ConnectionID : ConnectionId; Price : Decimal(16, 3); CurrencyCode : Currency; @@ -55,8 +58,8 @@ entity FlightConnection : MasterData { // once the TODO in Flight is done, similar change can be applied here // to_Airline can be managed association and AirlineID can be removed // and will be replaced with the generated FK - key ConnectionID : String(4); - key AirlineID : String(3); + key ConnectionID : ConnectionId; + key AirlineID : AirlineId; DepartureAirport : Association to Airport; DestinationAirport : Association to Airport; DepartureTime : Time; @@ -71,7 +74,7 @@ entity FlightConnection : MasterData { // showcasing unique constrains ?? // @assert.unique.email: [EMailAddress] entity Passenger : managed, MasterData { - key CustomerID : String(6); + key CustomerID : String(6) @cds.collate : false; FirstName : String(40); LastName : String(40); Title : String(10); @@ -84,7 +87,7 @@ entity Passenger : managed, MasterData { }; entity TravelAgency : MasterData { - key AgencyID : String(6); + key AgencyID : String(6) @cds.collate : false; Name : String(80); Street : String(60); PostalCode : String(10); @@ -101,6 +104,7 @@ entity TravelAgency : MasterData { // entity SupplementType : sap.common.CodeList { + @cds.collate: false key code : String(2) enum { Beverage = 'BV'; Meal = 'ML'; diff --git a/db/schema.cds b/db/schema.cds index a53f20b1..e4970ff4 100644 --- a/db/schema.cds +++ b/db/schema.cds @@ -4,7 +4,8 @@ using { sap.fe.cap.travel.Passenger, sap.fe.cap.travel.TravelAgency, sap.fe.cap.travel.Supplement, - sap.fe.cap.travel.Flight + sap.fe.cap.travel.Flight, + sap.fe.cap.travel.ConnectionId } from './master-data'; namespace sap.fe.cap.travel; @@ -41,7 +42,7 @@ entity Booking : managed { key BookingUUID : UUID; BookingID : Integer @Core.Computed; BookingDate : Date; - ConnectionID : String(4); + ConnectionID : ConnectionId; FlightDate : Date; FlightPrice : Decimal(16, 3); CurrencyCode : Currency; @@ -71,6 +72,7 @@ entity BookingSupplement : managed { // entity BookingStatus : CodeList { + @cds.collate: false key code : String(1) enum { New = 'N'; Booked = 'B'; @@ -79,6 +81,7 @@ entity BookingStatus : CodeList { }; entity TravelStatus : CodeList { + @cds.collate: false key code : String(1) enum { Open = 'O'; Accepted = 'A';