Skip to content

Commit

Permalink
redesign TripSegment
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-c4t committed Oct 11, 2024
1 parent 3fd56c0 commit 176f6b9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 46 deletions.
2 changes: 1 addition & 1 deletion proto/cmp/services/transport/v1/list.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ message TransportProductListResponse {
cmp.types.v1.ResponseHeader header = 1;

// Product list: Trips
repeated cmp.services.transport.v3.Trip trips = 2;
repeated cmp.services.transport.v3.TripSchedule trips = 2;
}

// This service is used to get a product list for transportation.
Expand Down
98 changes: 53 additions & 45 deletions proto/cmp/services/transport/v3/trip_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,57 @@ message TransitEvent {

// A segment of a trip
message TripSegment {
// Segment Info
cmp.services.transport.v3.SegmentInfo info = 1;

// Flights, trains and transfers often offer different service types
// for a product. Think about economy or business for flights, first and second
// class on trains and a shared shuttle or a private transfer.
//
// Service type code examples:
// flight: "Y", "J", "F".
// train: "1st", "2nd" or "S", "C", "P"
// transfer: "S", "P", "VIP", "SS"
string service_type_code = 2;

// Service type description examples:
// flight: "Economy Class", "Business Class", "First Class"
// train: "First Class", "Second Class" or "standard", "comfort", and "premium",..
// transfer: "Shuttle", "Private", "VIP Limosine", "Speedy Shuttle",...
string service_type_description = 3;

// Included, optional or compulsary services for this segment or leg. Just a code and
// description can be included if it is a package (seat, priority, large carry-on).
// or a price detail can be included for optionally pre-ordered meals for example.
repeated cmp.types.v2.ServiceFact services = 4;

// Min PAX
//
// Ex: `1`
int32 min_pax = 5;

// Max PAX
//
// Ex: `3`
int32 max_pax = 6;
}

// A whole trip schedule from the first segment till the last one
message TripSchedule {
// Carrier Code
string carrier_code = 1;

// Carrier Type. Ex: airline, transfer company, train company, .. etc
string carrier_type = 2;

// Start and end datetime for the trip
cmp.types.v1.DateTimeRange period = 3;

// Schedule for each segment of the trip
repeated cmp.services.transport.v3.SegmentInfo segments = 4;
}

message SegmentInfo {
// Segment ID
// Ex: "SEG1234"
string segment_id = 1;
Expand Down Expand Up @@ -90,54 +141,11 @@ message TripSegment {
// Arrival
cmp.services.transport.v3.TransitEvent arrival = 8;

// Flights, trains and transfers often offer different service types
// for a product. Think about economy or business for flights, first and second
// class on trains and a shared shuttle or a private transfer.
//
// Service type code examples:
// flight: "Y", "J", "F".
// train: "1st", "2nd" or "S", "C", "P"
// transfer: "S", "P", "VIP", "SS"
string service_type_code = 9;

// Service type description examples:
// flight: "Economy Class", "Business Class", "First Class"
// train: "First Class", "Second Class" or "standard", "comfort", and "premium",..
// transfer: "Shuttle", "Private", "VIP Limosine", "Speedy Shuttle",...
string service_type_description = 10;

// Included, optional or compulsary services for this segment or leg. Just a code and
// description can be included if it is a package (seat, priority, large carry-on).
// or a price detail can be included for optionally pre-ordered meals for example.
repeated cmp.types.v2.ServiceFact services = 11;

// Segment duration in minutes
cmp.types.v1.Duration segment_duration = 12;
cmp.types.v1.Duration segment_duration = 9;

// Segment Distance
//
// Ex: `Length(value=15, unit=LengthUnit.DISTANCE_UNIT_KILOMETERS)`
cmp.types.v1.Length segment_distance = 13;

// Min PAX
//
// Ex: `1`
int32 min_pax = 14;

// Max PAX
//
// Ex: `3`
int32 max_pax = 15;
}

// A whole trip schedule from the first segment till the last one
message TripSchedule {
// Carrier Code
string carrier_code = 1;

// Carrier Type. Ex: airline, transfer company, train company, .. etc
string carrier_type = 2;

// Start and end datetime for the trip
cmp.types.v1.DateTimeRange period = 3;
cmp.types.v1.Length segment_distance = 10;
}

0 comments on commit 176f6b9

Please sign in to comment.