From 95988ad0390cdabb3fb8d15adcc82a3dc0ce4b9e Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 30 Apr 2024 15:51:23 +0300 Subject: [PATCH 01/22] [WIP] Seat map messages --- proto/cmp/types/v1alpha/seatmap.proto | 64 +++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 proto/cmp/types/v1alpha/seatmap.proto diff --git a/proto/cmp/types/v1alpha/seatmap.proto b/proto/cmp/types/v1alpha/seatmap.proto new file mode 100644 index 0000000..8ee5daf --- /dev/null +++ b/proto/cmp/types/v1alpha/seatmap.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; + +package cmp.types.v1alpha; + +// Basic representation of a seat with optional features. +message Seat { + // Unique identifier, e.g., "12B", "A26" + string seat_id = 1; + + SeatType type = 2; + + // Comma-separated features, e.g., "extra_leg_room,window" + // This field can be improved with a better enum and/or additional fields. + string features = 3; +} + +// A row of seats. +message Row { + // Row identifier, e.g., "A", "12" + string row_id = 1; + + // Collection of seats in this row + repeated Seat seats = 2; +} + +// Section could be a block of rows or a specific area in a venue. +message Section { + // Section identifier, e.g., "Section 101", "Orchestra" + string section_id = 1; + + // Rows in this section + repeated Row rows = 2; +} + +// Level for large venues like stadiums or theaters with multiple tiers. +message Level { + // Level identifier, e.g., "Upper", "Balcony" + string level_id = 1; + + repeated Section sections = 2; +} + +// High-level representation of a seat map. +message SeatMap { + // Unique identifier for the seat map + string map_id = 1; + + // Levels if applicable (mostly for large venues) + repeated Level levels = 2; + + // Sections if the venue does not have multiple levels + repeated Section sections = 3; + + // Direct rows if it's a simple configuration without sections + repeated Row rows = 4; +} + +enum SeatType { + SEAT_TYPE_UNSPECIFIED = 0; + SEAT_TYPE_STANDARD = 1; + SEAT_TYPE_PREMIUM = 2; + SEAT_TYPE_ACCESSIBLE = 3; + SEAT_TYPE_VIP = 4; +} From 808c8cb4d180ba18c5e8d460cf6f3bdb5d53020e Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 7 May 2024 04:17:29 +0300 Subject: [PATCH 02/22] Improve seat map types, add availability and image urls --- proto/cmp/types/v1alpha/seatmap.proto | 121 ++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 7 deletions(-) diff --git a/proto/cmp/types/v1alpha/seatmap.proto b/proto/cmp/types/v1alpha/seatmap.proto index 8ee5daf..c41d81e 100644 --- a/proto/cmp/types/v1alpha/seatmap.proto +++ b/proto/cmp/types/v1alpha/seatmap.proto @@ -2,16 +2,64 @@ syntax = "proto3"; package cmp.types.v1alpha; +import "cmp/types/v1alpha/description.proto"; +import "cmp/types/v1alpha/price.proto"; + // Basic representation of a seat with optional features. message Seat { // Unique identifier, e.g., "12B", "A26" string seat_id = 1; + // Seat type like STANDARD or PREMIUM etc SeatType type = 2; // Comma-separated features, e.g., "extra_leg_room,window" - // This field can be improved with a better enum and/or additional fields. + // TODO: This field can be improved with a better enum and/or additional fields. string features = 3; + + // Min age for this seat + int32 min_age = 4; + + // Max age for this seat. FIXME: Do we need this? + int32 max_age = 5; + + // Seat location + SeatMapLocation location = 6; + + // Localized description set for this seat. This can be used for example to + // describe features and amenities. + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 7; +} + +enum SeatType { + SEAT_TYPE_UNSPECIFIED = 0; + SEAT_TYPE_STANDARD = 1; + SEAT_TYPE_PREMIUM = 2; + SEAT_TYPE_ACCESSIBLE = 3; + SEAT_TYPE_VIP = 4; +} + +// Representation of a seat location in SVG or bitmap. +message SeatMapLocation { + // Vector Seat Location for SVG + message VectorSeatLocation { + // Label, e.g. "section-TERRACE-26-34-2-label" for SVG + string svg_label = 1; + } + + // X, Y, width and height + message BitmapSeatLocation { + int32 x = 1; + int32 y = 2; + int32 width = 3; + int32 height = 4; + } + + // Seat location + oneof location { + VectorSeatLocation vector = 1; + BitmapSeatLocation bitmap = 2; + } } // A row of seats. @@ -21,6 +69,10 @@ message Row { // Collection of seats in this row repeated Seat seats = 2; + + // Localized description set for this row. This can be used for example to + // describe features and amenities. + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 3; } // Section could be a block of rows or a specific area in a venue. @@ -30,6 +82,19 @@ message Section { // Rows in this section repeated Row rows = 2; + + // Location image URL for the seat map. This can be a SVG or bitmap. If this field + // is set, it is assumed that seats in this section is using this image URL for + // seat location. Unless the field `is_using_seat_map_image_for_location` is set + // to `True`. + string image_url = 3; + + // Set to True if the section is using seat map image for location + bool is_using_seat_map_image_for_location = 4; + + // Localized description set for this section. This can be used for example to + // describe features and amenities. + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 5; } // Level for large venues like stadiums or theaters with multiple tiers. @@ -37,10 +102,27 @@ message Level { // Level identifier, e.g., "Upper", "Balcony" string level_id = 1; + // Sections in this level repeated Section sections = 2; + + // Location image URL for the seat map. This can be a SVG or bitmap. If this field + // is set, it is assumed that seats in this level is using this image URL for + // seat location. Unless the field `is_using_seat_map_image_for_location` is set + // to `True`. + string image_url = 3; + + // Set to True if the level is using seat map image for location + bool is_using_seat_map_image_for_location = 4; + + // Localized description set for this level. This can be used for example to + // describe features and amenities. + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 5; } // High-level representation of a seat map. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seatmap.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seatmap.proto.dot.svg) message SeatMap { // Unique identifier for the seat map string map_id = 1; @@ -53,12 +135,37 @@ message SeatMap { // Direct rows if it's a simple configuration without sections repeated Row rows = 4; + + // Location image URL for the seat map. This can be a SVG or bitmap. + string image_url = 5; + + // Localized description set for this map. This can be used for example to + // describe features and amenities. + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 6; } -enum SeatType { - SEAT_TYPE_UNSPECIFIED = 0; - SEAT_TYPE_STANDARD = 1; - SEAT_TYPE_PREMIUM = 2; - SEAT_TYPE_ACCESSIBLE = 3; - SEAT_TYPE_VIP = 4; +message AvailableSeat { + string seat_id = 1; + cmp.types.v1alpha.Price price = 2; +} + +// Available seats as a repeated string of seat ids. +message AvailableSeats { + repeated AvailableSeats available_seats = 1; +} + +message SeatAvailability { + // Seat availability. This field can be used for the whole seat map if the seats + // have unique ids. If not, other fields like `rows`, `sections` and `levels` + // should be used. + AvailableSeats available_seats = 1; + + // Seat availability by row. Map of `row_id`` to `AvailableSeats`. + map available_seats_in_row = 2; + + // Seat availability by section. Map of `section_id`` to `AvailableSeats`. + map available_seats_in_section = 3; + + // Seat availability by level. Map of `level_id`` to `AvailableSeats`. + map available_seats_in_level = 4; } From 2feb15adecdefed2ee75b327cf27b94a11519047 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 7 May 2024 04:53:18 +0300 Subject: [PATCH 03/22] Update protodot generation script --- scripts/generate_protodot.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/generate_protodot.sh b/scripts/generate_protodot.sh index 5782ed9..eec50b2 100755 --- a/scripts/generate_protodot.sh +++ b/scripts/generate_protodot.sh @@ -12,6 +12,7 @@ declare -a BIG_ENUMS=( "country.proto" "currency.proto" "language.proto" + "price_type.proto" ) declare -a TRUNCATE=() @@ -72,6 +73,10 @@ TIMESTAMP_FILENAME=${TIMESTAMP_DIR}/timestamp.proto mkdir -p ${TIMESTAMP_DIR} curl https://raw.githubusercontent.com/protocolbuffers/protobuf/main/src/google/protobuf/timestamp.proto > $TIMESTAMP_FILENAME +# Get Empty proto file +EMPTY_FILENAME=${TIMESTAMP_DIR}/empty.proto +curl https://raw.githubusercontent.com/protocolbuffers/protobuf/main/src/google/protobuf/empty.proto > $EMPTY_FILENAME + # Generate diagrams for protofile in `find ${PROTO_DIR} -type f -name '*.proto'`; do # Set proto file dir From 989ed6ed9664c14c2b8d9be9a6ead20be172af95 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 7 May 2024 16:44:02 +0300 Subject: [PATCH 04/22] Use recursive structure for seat grouping --- proto/cmp/types/v1alpha/seatmap.proto | 172 +++++++++++--------------- 1 file changed, 71 insertions(+), 101 deletions(-) diff --git a/proto/cmp/types/v1alpha/seatmap.proto b/proto/cmp/types/v1alpha/seatmap.proto index c41d81e..bd8a401 100644 --- a/proto/cmp/types/v1alpha/seatmap.proto +++ b/proto/cmp/types/v1alpha/seatmap.proto @@ -10,113 +10,91 @@ message Seat { // Unique identifier, e.g., "12B", "A26" string seat_id = 1; - // Seat type like STANDARD or PREMIUM etc - SeatType type = 2; + // Seat location + SeatMapLocation location = 2; - // Comma-separated features, e.g., "extra_leg_room,window" - // TODO: This field can be improved with a better enum and/or additional fields. - string features = 3; + // Static seat features + repeated SeatFeature features = 3; +} - // Min age for this seat - int32 min_age = 4; +message SeatFeature { + // Static features of a seat like "extra_leg_room", "window", "min_age", etc. + // FIXME: Can we make this a big enum? + string name = 1; - // Max age for this seat. FIXME: Do we need this? - int32 max_age = 5; + // Human readable description + string description = 2; - // Seat location - SeatMapLocation location = 6; - - // Localized description set for this seat. This can be used for example to - // describe features and amenities. - cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 7; + // Value to be used for restrictions or conditions like "min_age" + int32 value = 3; } enum SeatType { SEAT_TYPE_UNSPECIFIED = 0; SEAT_TYPE_STANDARD = 1; SEAT_TYPE_PREMIUM = 2; - SEAT_TYPE_ACCESSIBLE = 3; - SEAT_TYPE_VIP = 4; + SEAT_TYPE_VIP = 3; } -// Representation of a seat location in SVG or bitmap. -message SeatMapLocation { - // Vector Seat Location for SVG - message VectorSeatLocation { - // Label, e.g. "section-TERRACE-26-34-2-label" for SVG - string svg_label = 1; - } +enum AreaType { + AREA_TYPE_UNSPECIFIED = 0; + AREA_TYPE_RECTANGLE = 1; + AREA_TYPE_CIRCLE = 2; + AREA_TYPE_POLYGON = 3; +} - // X, Y, width and height - message BitmapSeatLocation { - int32 x = 1; - int32 y = 2; - int32 width = 3; - int32 height = 4; - } +// Image location for seat maps with bitmap images. This info is generallt used with +// HTML `area` tag. +message BitmapSeatLocation { + AreaType type = 1; + repeated int32 coordinates = 2; +} - // Seat location +// Vector Seat Location for SVG +message VectorSeatLocation { + // Label, e.g. "section-TERRACE-26-34-2-label" for SVG + string svg_label = 1; +} + +// Representation of a seat location in SVG or bitmap. +message SeatMapLocation { + // Seat location it should be one of vector (SVG) or bitmap location message + // types. oneof location { VectorSeatLocation vector = 1; BitmapSeatLocation bitmap = 2; } } -// A row of seats. -message Row { - // Row identifier, e.g., "A", "12" - string row_id = 1; - - // Collection of seats in this row - repeated Seat seats = 2; - - // Localized description set for this row. This can be used for example to - // describe features and amenities. - cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 3; -} - -// Section could be a block of rows or a specific area in a venue. +// Section could be a block of rows or a specific area in a venue like a stage, or a +// section in a plane. message Section { - // Section identifier, e.g., "Section 101", "Orchestra" - string section_id = 1; + // Level, section or row identifier, e.g., "Upper", "Balcony" or "Section 101", + // "Orchestra" or "A", "12". + string id = 1; + + // Human readable name of the section + string name = 2; - // Rows in this section - repeated Row rows = 2; + // Collection of seats in this section. If it contains inner sections, this field + // can be left empty. + repeated Seat seats = 3; // Location image URL for the seat map. This can be a SVG or bitmap. If this field // is set, it is assumed that seats in this section is using this image URL for // seat location. Unless the field `is_using_seat_map_image_for_location` is set // to `True`. - string image_url = 3; + string image_url = 4; // Set to True if the section is using seat map image for location - bool is_using_seat_map_image_for_location = 4; + bool is_using_seat_map_image_for_location = 5; // Localized description set for this section. This can be used for example to // describe features and amenities. - cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 5; -} - -// Level for large venues like stadiums or theaters with multiple tiers. -message Level { - // Level identifier, e.g., "Upper", "Balcony" - string level_id = 1; - - // Sections in this level - repeated Section sections = 2; - - // Location image URL for the seat map. This can be a SVG or bitmap. If this field - // is set, it is assumed that seats in this level is using this image URL for - // seat location. Unless the field `is_using_seat_map_image_for_location` is set - // to `True`. - string image_url = 3; - - // Set to True if the level is using seat map image for location - bool is_using_seat_map_image_for_location = 4; + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 6; - // Localized description set for this level. This can be used for example to - // describe features and amenities. - cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 5; + // Recursive presentation of inner sections. + repeated Section sections = 7; } // High-level representation of a seat map. @@ -127,45 +105,37 @@ message SeatMap { // Unique identifier for the seat map string map_id = 1; - // Levels if applicable (mostly for large venues) - repeated Level levels = 2; - - // Sections if the venue does not have multiple levels - repeated Section sections = 3; - - // Direct rows if it's a simple configuration without sections - repeated Row rows = 4; + // This field represents a recursive `Section` message type that can be used to + // describe rows, sections, levels etc. + repeated Section sections = 2; // Location image URL for the seat map. This can be a SVG or bitmap. - string image_url = 5; + string image_url = 3; // Localized description set for this map. This can be used for example to // describe features and amenities. - cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 6; + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 4; } +// This is the seat availability for a given seat message AvailableSeat { string seat_id = 1; - cmp.types.v1alpha.Price price = 2; + + // Price of the seat with recursive price breakdown + cmp.types.v1alpha.PriceDetail price = 2; + + // Seat type like STANDARD or PREMIUM etc + SeatType type = 3; } -// Available seats as a repeated string of seat ids. -message AvailableSeats { - repeated AvailableSeats available_seats = 1; +// Available seat for given section and all its inner sections +message AvailableSectionSeats { + string section_id = 1; + repeated AvailableSeat available_seats = 2; + repeated AvailableSectionSeats sections = 3; } message SeatAvailability { - // Seat availability. This field can be used for the whole seat map if the seats - // have unique ids. If not, other fields like `rows`, `sections` and `levels` - // should be used. - AvailableSeats available_seats = 1; - - // Seat availability by row. Map of `row_id`` to `AvailableSeats`. - map available_seats_in_row = 2; - - // Seat availability by section. Map of `section_id`` to `AvailableSeats`. - map available_seats_in_section = 3; - - // Seat availability by level. Map of `level_id`` to `AvailableSeats`. - map available_seats_in_level = 4; + // Seat availability including the recursive inner sections + repeated AvailableSectionSeats available_seats = 1; } From 052570671e69e69d085d0f2d8e65515aea18cb2c Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 7 May 2024 17:25:05 +0300 Subject: [PATCH 05/22] remove boolean for image location from section --- proto/cmp/types/v1alpha/seatmap.proto | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/proto/cmp/types/v1alpha/seatmap.proto b/proto/cmp/types/v1alpha/seatmap.proto index bd8a401..180c5a5 100644 --- a/proto/cmp/types/v1alpha/seatmap.proto +++ b/proto/cmp/types/v1alpha/seatmap.proto @@ -82,19 +82,15 @@ message Section { // Location image URL for the seat map. This can be a SVG or bitmap. If this field // is set, it is assumed that seats in this section is using this image URL for - // seat location. Unless the field `is_using_seat_map_image_for_location` is set - // to `True`. + // seat location. (the `SeatMapLocation` message type in the `Seat` message) string image_url = 4; - // Set to True if the section is using seat map image for location - bool is_using_seat_map_image_for_location = 5; - // Localized description set for this section. This can be used for example to // describe features and amenities. - cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 6; + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 5; // Recursive presentation of inner sections. - repeated Section sections = 7; + repeated Section sections = 6; } // High-level representation of a seat map. From fd1153ef4fb4e4f8b4d0f9a757af19c12cb0c4c4 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 7 May 2024 17:27:21 +0300 Subject: [PATCH 06/22] add missing map_id to the availability message --- proto/cmp/types/v1alpha/seatmap.proto | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proto/cmp/types/v1alpha/seatmap.proto b/proto/cmp/types/v1alpha/seatmap.proto index 180c5a5..fff6004 100644 --- a/proto/cmp/types/v1alpha/seatmap.proto +++ b/proto/cmp/types/v1alpha/seatmap.proto @@ -132,6 +132,9 @@ message AvailableSectionSeats { } message SeatAvailability { + // Unique identifier for the seat map that this availability refers to. + string map_id = 1; + // Seat availability including the recursive inner sections - repeated AvailableSectionSeats available_seats = 1; + repeated AvailableSectionSeats available_seats = 2; } From 844ca1c62a01db8d5d5c5ba099d2f60cb88ac845 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 7 May 2024 17:33:19 +0300 Subject: [PATCH 07/22] split features and attributes --- proto/cmp/types/v1alpha/seatmap.proto | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/proto/cmp/types/v1alpha/seatmap.proto b/proto/cmp/types/v1alpha/seatmap.proto index fff6004..41a98f1 100644 --- a/proto/cmp/types/v1alpha/seatmap.proto +++ b/proto/cmp/types/v1alpha/seatmap.proto @@ -14,11 +14,14 @@ message Seat { SeatMapLocation location = 2; // Static seat features - repeated SeatFeature features = 3; + repeated SeatAttribute features = 3; + + // Restrictions + repeated SeatAttribute restrictions = 4; } -message SeatFeature { - // Static features of a seat like "extra_leg_room", "window", "min_age", etc. +message SeatAttribute { + // Static attributes to be used for features and restrictions // FIXME: Can we make this a big enum? string name = 1; From 05f2776597d4d0204bccfe7651931185532a4777 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Wed, 8 May 2024 01:51:53 +0300 Subject: [PATCH 08/22] rename availability messages --- proto/cmp/types/v1alpha/seatmap.proto | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/proto/cmp/types/v1alpha/seatmap.proto b/proto/cmp/types/v1alpha/seatmap.proto index 41a98f1..230aeec 100644 --- a/proto/cmp/types/v1alpha/seatmap.proto +++ b/proto/cmp/types/v1alpha/seatmap.proto @@ -20,9 +20,9 @@ message Seat { repeated SeatAttribute restrictions = 4; } +// FIXME: Can we make this a big enum? message SeatAttribute { // Static attributes to be used for features and restrictions - // FIXME: Can we make this a big enum? string name = 1; // Human readable description @@ -117,7 +117,7 @@ message SeatMap { } // This is the seat availability for a given seat -message AvailableSeat { +message SeatAvailability { string seat_id = 1; // Price of the seat with recursive price breakdown @@ -128,16 +128,20 @@ message AvailableSeat { } // Available seat for given section and all its inner sections -message AvailableSectionSeats { +message SectionAvailability { string section_id = 1; - repeated AvailableSeat available_seats = 2; - repeated AvailableSectionSeats sections = 3; + + // Seats in this section + repeated SeatAvailability seats = 2; + + // Inner sections in this section + repeated SectionAvailability sections = 3; } -message SeatAvailability { +message SeatMapAvailability { // Unique identifier for the seat map that this availability refers to. string map_id = 1; // Seat availability including the recursive inner sections - repeated AvailableSectionSeats available_seats = 2; + repeated SectionAvailability sections = 2; } From f20c8ea639d725b53423de0e9879087580fa309b Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Wed, 8 May 2024 02:03:41 +0300 Subject: [PATCH 09/22] add seatmap service to transport package --- .../services/transport/v1alpha/seatmap.proto | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 proto/cmp/services/transport/v1alpha/seatmap.proto diff --git a/proto/cmp/services/transport/v1alpha/seatmap.proto b/proto/cmp/services/transport/v1alpha/seatmap.proto new file mode 100644 index 0000000..1bd900d --- /dev/null +++ b/proto/cmp/services/transport/v1alpha/seatmap.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; + +package cmp.services.transport.v1alpha; + +import "cmp/types/v1alpha/common.proto"; +import "cmp/types/v1alpha/seatmap.proto"; + +// Request for seat map data +// +// Requests the seat map data for a given map ID +message SeatMapRequest { + // Request header + // + // Header contains information about the request + cmp.types.v1alpha.RequestHeader header = 1; + + // Unique identifier for the seat map + // + // This is the map ID that is received in the search result + string map_id = 2; +} + +// Response for seat map request +// +// Contains the seat map data for a given map ID +message SeatMapResponse { + // Response header + // + // Header contains information about the response + cmp.types.v1alpha.ResponseHeader header = 1; + + // Seat map data + // + // Contains the seat map data for the requested map ID + cmp.types.v1alpha.SeatMap seat_map = 2; +} + +// Service for requesting seat map data +// +// Service is used to request the seat map data for a given map ID +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha/seatmap.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha/seatmap.proto.dot.svg) +service SeatMapService { + // Get seat map data + // + // Requests the seat map data for a given map ID + rpc SeatMap(SeatMapRequest) returns (SeatMapResponse); +} From bc85ebc967bf062e7f1444008104a6401cadab32 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Wed, 8 May 2024 02:18:25 +0300 Subject: [PATCH 10/22] fix enum truncation for multi enum files for diagrams --- scripts/generate_protodot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate_protodot.sh b/scripts/generate_protodot.sh index eec50b2..2e32548 100755 --- a/scripts/generate_protodot.sh +++ b/scripts/generate_protodot.sh @@ -33,7 +33,7 @@ shorten_protobuf() { # Process the file awk ' BEGIN { print_flag=1; enum_count=0; } - /enum [^ ]+ {/ { print_flag=0; print; next; } + /enum [^ ]+ {/ { print_flag=0; enum_count=0; print; next; } /}/ { if (print_flag == 0) { print " X_TRUNCATED_X = 999;"; print; print_flag=1; } else { print; } next; } { if (print_flag) { print; } else { if (enum_count < 7) { print; enum_count++; } } } ' "$filename" > "${filename}.tmp" From 26b433e2cd14b2af22e4ecc908607a906d83e78d Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Wed, 8 May 2024 02:26:04 +0300 Subject: [PATCH 11/22] use correct naming pattern for fields and filenames --- .../transport/v1alpha/{seatmap.proto => seat_map.proto} | 6 +++--- proto/cmp/types/v1alpha/{seatmap.proto => seat_map.proto} | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename proto/cmp/services/transport/v1alpha/{seatmap.proto => seat_map.proto} (86%) rename proto/cmp/types/v1alpha/{seatmap.proto => seat_map.proto} (97%) diff --git a/proto/cmp/services/transport/v1alpha/seatmap.proto b/proto/cmp/services/transport/v1alpha/seat_map.proto similarity index 86% rename from proto/cmp/services/transport/v1alpha/seatmap.proto rename to proto/cmp/services/transport/v1alpha/seat_map.proto index 1bd900d..b4b18b8 100644 --- a/proto/cmp/services/transport/v1alpha/seatmap.proto +++ b/proto/cmp/services/transport/v1alpha/seat_map.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package cmp.services.transport.v1alpha; import "cmp/types/v1alpha/common.proto"; -import "cmp/types/v1alpha/seatmap.proto"; +import "cmp/types/v1alpha/seat_map.proto"; // Request for seat map data // @@ -39,8 +39,8 @@ message SeatMapResponse { // // Service is used to request the seat map data for a given map ID // -// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha/seatmap.proto.dot.xs.svg) -// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha/seatmap.proto.dot.svg) +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha/seat_map.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha/seat_map.proto.dot.svg) service SeatMapService { // Get seat map data // diff --git a/proto/cmp/types/v1alpha/seatmap.proto b/proto/cmp/types/v1alpha/seat_map.proto similarity index 97% rename from proto/cmp/types/v1alpha/seatmap.proto rename to proto/cmp/types/v1alpha/seat_map.proto index 230aeec..4b174ce 100644 --- a/proto/cmp/types/v1alpha/seatmap.proto +++ b/proto/cmp/types/v1alpha/seat_map.proto @@ -98,8 +98,8 @@ message Section { // High-level representation of a seat map. // -// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seatmap.proto.dot.xs.svg) -// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seatmap.proto.dot.svg) +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seat_map.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seat_map.proto.dot.svg) message SeatMap { // Unique identifier for the seat map string map_id = 1; From bd402127edbd138655fcc7e50d7066f26db0d88c Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Wed, 8 May 2024 03:00:26 +0300 Subject: [PATCH 12/22] move seat map service and add availability service --- .../seat_map/v1alpha/availability.proto | 46 +++++++++++++++++++ .../v1alpha/seat_map.proto | 6 +-- 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 proto/cmp/services/seat_map/v1alpha/availability.proto rename proto/cmp/services/{transport => seat_map}/v1alpha/seat_map.proto (86%) diff --git a/proto/cmp/services/seat_map/v1alpha/availability.proto b/proto/cmp/services/seat_map/v1alpha/availability.proto new file mode 100644 index 0000000..efaaa3b --- /dev/null +++ b/proto/cmp/services/seat_map/v1alpha/availability.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +package cmp.services.seat_map.v1alpha; + +import "cmp/types/v1alpha/common.proto"; +import "cmp/types/v1alpha/seat_map.proto"; + +// Request for seat map availability data +// +// Requests the seat map availability data for a given map ID +message SeatMapAvailabilityRequest { + // Message header + // + // Header contains information about the request + cmp.types.v1alpha.RequestHeader header = 1; + + // Required. Unique identifier for the seat map. + // This is the map ID that is received in the search result. + string map_id = 2; +} + +// Response for seat map availability request +// +// Contains the seat map availability data for a given map ID +message SeatMapAvailabilityResponse { + // Message header + // + // Header contains information about the response + cmp.types.v1alpha.ResponseHeader header = 1; + + // Required. Seat map availability data. + cmp.types.v1alpha.SeatMapAvailability seat_map = 2; +} + +// Service for requesting seat map availability data +// +// Service is used to request the seat map availability data for a given map ID +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/seat_map/v1alpha/availability.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/seat_map/v1alpha/availability.proto.dot.svg) +service SeatMapAvailabilityService { + // Get seat map availability data + // + // Requests the seat map availability data for a given map ID + rpc SeatMapAvailability(SeatMapAvailabilityRequest) returns (SeatMapAvailabilityResponse); +} diff --git a/proto/cmp/services/transport/v1alpha/seat_map.proto b/proto/cmp/services/seat_map/v1alpha/seat_map.proto similarity index 86% rename from proto/cmp/services/transport/v1alpha/seat_map.proto rename to proto/cmp/services/seat_map/v1alpha/seat_map.proto index b4b18b8..8151cd1 100644 --- a/proto/cmp/services/transport/v1alpha/seat_map.proto +++ b/proto/cmp/services/seat_map/v1alpha/seat_map.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package cmp.services.transport.v1alpha; +package cmp.services.seat_map.v1alpha; import "cmp/types/v1alpha/common.proto"; import "cmp/types/v1alpha/seat_map.proto"; @@ -39,8 +39,8 @@ message SeatMapResponse { // // Service is used to request the seat map data for a given map ID // -// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha/seat_map.proto.dot.xs.svg) -// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/transport/v1alpha/seat_map.proto.dot.svg) +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/seat_map/v1alpha/seat_map.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/seat_map/v1alpha/seat_map.proto.dot.svg) service SeatMapService { // Get seat map data // From c760eed578b4d0c4deffc66ec3b201b9829834ba Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Wed, 8 May 2024 20:22:25 +0300 Subject: [PATCH 13/22] remove price from seat availability --- proto/cmp/types/v1alpha/seat_map.proto | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/proto/cmp/types/v1alpha/seat_map.proto b/proto/cmp/types/v1alpha/seat_map.proto index 4b174ce..e7377de 100644 --- a/proto/cmp/types/v1alpha/seat_map.proto +++ b/proto/cmp/types/v1alpha/seat_map.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package cmp.types.v1alpha; import "cmp/types/v1alpha/description.proto"; -import "cmp/types/v1alpha/price.proto"; // Basic representation of a seat with optional features. message Seat { @@ -120,11 +119,8 @@ message SeatMap { message SeatAvailability { string seat_id = 1; - // Price of the seat with recursive price breakdown - cmp.types.v1alpha.PriceDetail price = 2; - // Seat type like STANDARD or PREMIUM etc - SeatType type = 3; + SeatType type = 2; } // Available seat for given section and all its inner sections From 90ad220c698a83e97da59f6dac2a721e349a20c1 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Mon, 13 May 2024 21:54:44 +0300 Subject: [PATCH 14/22] add integer availability info to section --- proto/cmp/types/v1alpha/seat_map.proto | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/proto/cmp/types/v1alpha/seat_map.proto b/proto/cmp/types/v1alpha/seat_map.proto index e7377de..8d4e3a9 100644 --- a/proto/cmp/types/v1alpha/seat_map.proto +++ b/proto/cmp/types/v1alpha/seat_map.proto @@ -132,6 +132,18 @@ message SectionAvailability { // Inner sections in this section repeated SectionAvailability sections = 3; + + // Total number of seats in this section. Ignored if the 'seats` field is set. + // + // This field is intended to be used with sections that do not have individual + // seat information. For example a standing area for a concert or an arena. + int32 total_seat_count = 4; + + // Remaining number of seats in this section. Ignored if the 'seats` field is set. + // + // This field is intended to be used with sections that do not have individual + // seat information. For example a standing area for a concert or an arena. + int32 remaining_seat_count = 5; } message SeatMapAvailability { From 02d52fcf358f46e4244e4f31d5a4336c8aba1abf Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Mon, 13 May 2024 23:16:15 +0300 Subject: [PATCH 15/22] update validate message to include seat info refactor availability message names to inventory update availability service with different identifiers --- .../cmp/services/book/v1alpha/validate.proto | 10 ++++++ .../seat_map/v1alpha/availability.proto | 21 ++++++++++--- proto/cmp/types/v1alpha/search.proto | 6 ++++ proto/cmp/types/v1alpha/seat_map.proto | 31 ++++++++++++------- 4 files changed, 52 insertions(+), 16 deletions(-) diff --git a/proto/cmp/services/book/v1alpha/validate.proto b/proto/cmp/services/book/v1alpha/validate.proto index be18568..49f25df 100644 --- a/proto/cmp/services/book/v1alpha/validate.proto +++ b/proto/cmp/services/book/v1alpha/validate.proto @@ -4,6 +4,7 @@ package cmp.services.book.v1alpha; import "cmp/types/v1alpha/common.proto"; import "cmp/types/v1alpha/price.proto"; +import "cmp/types/v1alpha/seat_map.proto"; message ValidationRequest { // Message header @@ -16,6 +17,13 @@ message ValidationRequest { // Result ID that is that is returned by `result_id` field of the search result // messages, for example: `AccommodationSearchResult`. int32 result_id = 3; + + // Unit identifier that is used to describe selected units from the `result_id`. + // For example: seats for a concert. + oneof unit_identifier { + // Selected seat(s) represented as a seat map inventory message type. + cmp.types.v1alpha.SeatMapInventory seat_selection = 4; + } } message ValidationResponse { @@ -33,6 +41,8 @@ message ValidationResponse { // message. // // TODO: Better name? +// TODO: Do we also need `search_id` here? +// TODO: Do we also need `unit_identifier` here? message ValidationObject { int32 result_id = 1; cmp.types.v1alpha.PriceDetail price_detail = 2; diff --git a/proto/cmp/services/seat_map/v1alpha/availability.proto b/proto/cmp/services/seat_map/v1alpha/availability.proto index efaaa3b..85c87e9 100644 --- a/proto/cmp/services/seat_map/v1alpha/availability.proto +++ b/proto/cmp/services/seat_map/v1alpha/availability.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package cmp.services.seat_map.v1alpha; import "cmp/types/v1alpha/common.proto"; +import "cmp/types/v1alpha/search.proto"; import "cmp/types/v1alpha/seat_map.proto"; // Request for seat map availability data @@ -14,9 +15,21 @@ message SeatMapAvailabilityRequest { // Header contains information about the request cmp.types.v1alpha.RequestHeader header = 1; - // Required. Unique identifier for the seat map. - // This is the map ID that is received in the search result. - string map_id = 2; + // Required. The identifier of the seat map. + oneof identifier { + // Mint Identifier + // + // Example: For flights which book before seat selection. In this case, the + // buyer already have a `mint_id` because the service is already booked (minted + // on-chain). + string mint_id = 2; + + // Search result identifier with `search_id` & `result_id` + // + // Example: For requesting seat availability for search results. In this case, + // booking has not happended yet. + cmp.types.v1alpha.SearchIdentifier search_identifier = 3; + } } // Response for seat map availability request @@ -29,7 +42,7 @@ message SeatMapAvailabilityResponse { cmp.types.v1alpha.ResponseHeader header = 1; // Required. Seat map availability data. - cmp.types.v1alpha.SeatMapAvailability seat_map = 2; + cmp.types.v1alpha.SeatMapInventory seat_map = 2; } // Service for requesting seat map availability data diff --git a/proto/cmp/types/v1alpha/search.proto b/proto/cmp/types/v1alpha/search.proto index 4dbf37b..65d2564 100644 --- a/proto/cmp/types/v1alpha/search.proto +++ b/proto/cmp/types/v1alpha/search.proto @@ -102,3 +102,9 @@ message SearchResponseMetadata { // sessions. string external_session_id = 6; } + +// Search identifier +message SearchIdentifier { + UUID search_id = 1; + int32 result_id = 2; +} diff --git a/proto/cmp/types/v1alpha/seat_map.proto b/proto/cmp/types/v1alpha/seat_map.proto index 8d4e3a9..9d7bce2 100644 --- a/proto/cmp/types/v1alpha/seat_map.proto +++ b/proto/cmp/types/v1alpha/seat_map.proto @@ -31,6 +31,7 @@ message SeatAttribute { int32 value = 3; } +// FIXME: Do we need this? enum SeatType { SEAT_TYPE_UNSPECIFIED = 0; SEAT_TYPE_STANDARD = 1; @@ -115,23 +116,26 @@ message SeatMap { cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 4; } -// This is the seat availability for a given seat -message SeatAvailability { +// This is the seat inventory for a given seat +message SeatInventory { string seat_id = 1; - // Seat type like STANDARD or PREMIUM etc + // Seat type like STANDARD or PREMIUM etc. + // + // FIXME: Needs refinement. Do we really need this? Or is seat features enough? SeatType type = 2; } -// Available seat for given section and all its inner sections -message SectionAvailability { +// Selection of seats for given section and all its inner sections. Used for seat +// availability and seat selection messages. +message SectionInventory { string section_id = 1; // Seats in this section - repeated SeatAvailability seats = 2; + repeated SeatInventory seats = 2; // Inner sections in this section - repeated SectionAvailability sections = 3; + repeated SectionInventory sections = 3; // Total number of seats in this section. Ignored if the 'seats` field is set. // @@ -139,17 +143,20 @@ message SectionAvailability { // seat information. For example a standing area for a concert or an arena. int32 total_seat_count = 4; - // Remaining number of seats in this section. Ignored if the 'seats` field is set. + // Remaining number of seats in this section. Ignored if the 'seats` field is set + // or it is a seat selection message. // // This field is intended to be used with sections that do not have individual // seat information. For example a standing area for a concert or an arena. int32 remaining_seat_count = 5; } -message SeatMapAvailability { - // Unique identifier for the seat map that this availability refers to. +// Inventory of seats for a given seat map used for seat selection or seat +// availability. +message SeatMapInventory { + // Unique identifier for the seat map that this Inventory refers to. string map_id = 1; - // Seat availability including the recursive inner sections - repeated SectionAvailability sections = 2; + // Seat inventory including the recursive inner sections + repeated SectionInventory sections = 2; } From 931eade5cf3fef22c31dcb9b551f26c21137ce4c Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 14 May 2024 16:53:39 +0300 Subject: [PATCH 16/22] remove SeatType message --- proto/cmp/types/v1alpha/seat_map.proto | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/proto/cmp/types/v1alpha/seat_map.proto b/proto/cmp/types/v1alpha/seat_map.proto index 9d7bce2..557f9a8 100644 --- a/proto/cmp/types/v1alpha/seat_map.proto +++ b/proto/cmp/types/v1alpha/seat_map.proto @@ -31,14 +31,6 @@ message SeatAttribute { int32 value = 3; } -// FIXME: Do we need this? -enum SeatType { - SEAT_TYPE_UNSPECIFIED = 0; - SEAT_TYPE_STANDARD = 1; - SEAT_TYPE_PREMIUM = 2; - SEAT_TYPE_VIP = 3; -} - enum AreaType { AREA_TYPE_UNSPECIFIED = 0; AREA_TYPE_RECTANGLE = 1; @@ -119,11 +111,6 @@ message SeatMap { // This is the seat inventory for a given seat message SeatInventory { string seat_id = 1; - - // Seat type like STANDARD or PREMIUM etc. - // - // FIXME: Needs refinement. Do we really need this? Or is seat features enough? - SeatType type = 2; } // Selection of seats for given section and all its inner sections. Used for seat From d45ed69b814e23a26ce5cccd0fe0f233a24066c9 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 14 May 2024 17:09:40 +0300 Subject: [PATCH 17/22] update inventory system for section and seat - SeatInventory updated to be a a list of seat_ids - SectionInventory now contains a oneof field of seats that has seat_inventory and seat_counts fields. - SeatCounts msg type contains total and remaining seat counts --- proto/cmp/types/v1alpha/seat_map.proto | 41 +++++++++++++++----------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/proto/cmp/types/v1alpha/seat_map.proto b/proto/cmp/types/v1alpha/seat_map.proto index 557f9a8..3cd0a91 100644 --- a/proto/cmp/types/v1alpha/seat_map.proto +++ b/proto/cmp/types/v1alpha/seat_map.proto @@ -108,9 +108,18 @@ message SeatMap { cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 4; } -// This is the seat inventory for a given seat +// Seat inventory list message SeatInventory { - string seat_id = 1; + repeated string seat_ids = 1; +} + +// Total and remaining number of seats in a section. +message SeatCounts { + // Total number of seats + int32 total_seat_count = 1; + + // Remaining number of seats available for booking + int32 remaining_seat_count = 2; } // Selection of seats for given section and all its inner sections. Used for seat @@ -118,24 +127,20 @@ message SeatInventory { message SectionInventory { string section_id = 1; - // Seats in this section - repeated SeatInventory seats = 2; - - // Inner sections in this section - repeated SectionInventory sections = 3; + oneof seats { + // Seats in this section. Contains a list of individual seat IDs. + SeatInventory seat_inventory = 2; - // Total number of seats in this section. Ignored if the 'seats` field is set. - // - // This field is intended to be used with sections that do not have individual - // seat information. For example a standing area for a concert or an arena. - int32 total_seat_count = 4; + // Seat counts in this section. + // + // This field is intended to be used with sections that do not have individual + // seat information. For example a standing area for a concert or an arena. It + // includes total and remaining seat counts. + SeatCounts seat_counts = 3; + } - // Remaining number of seats in this section. Ignored if the 'seats` field is set - // or it is a seat selection message. - // - // This field is intended to be used with sections that do not have individual - // seat information. For example a standing area for a concert or an arena. - int32 remaining_seat_count = 5; + // Inner sections in this section. + repeated SectionInventory sections = 4; } // Inventory of seats for a given seat map used for seat selection or seat From 5fdd24eba72574e19a9f3e1dbabeffc215fae72f Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 14 May 2024 17:20:41 +0300 Subject: [PATCH 18/22] update validation messages - validation messages now uses the validation object and search identifier - this removes redundant code and makes it simpler --- .../cmp/services/book/v1alpha/validate.proto | 38 +++++++++---------- proto/cmp/types/v1alpha/search.proto | 5 +++ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/proto/cmp/services/book/v1alpha/validate.proto b/proto/cmp/services/book/v1alpha/validate.proto index 49f25df..e90b77c 100644 --- a/proto/cmp/services/book/v1alpha/validate.proto +++ b/proto/cmp/services/book/v1alpha/validate.proto @@ -4,26 +4,15 @@ package cmp.services.book.v1alpha; import "cmp/types/v1alpha/common.proto"; import "cmp/types/v1alpha/price.proto"; +import "cmp/types/v1alpha/search.proto"; import "cmp/types/v1alpha/seat_map.proto"; message ValidationRequest { // Message header cmp.types.v1alpha.RequestHeader header = 1; - // Search ID that is returned in the search response message in the `metadata`` - // (`SearchResponseMetadata`) field. - string search_id = 2; - - // Result ID that is that is returned by `result_id` field of the search result - // messages, for example: `AccommodationSearchResult`. - int32 result_id = 3; - - // Unit identifier that is used to describe selected units from the `result_id`. - // For example: seats for a concert. - oneof unit_identifier { - // Selected seat(s) represented as a seat map inventory message type. - cmp.types.v1alpha.SeatMapInventory seat_selection = 4; - } + // Validation object + ValidationObject validation_object = 2; } message ValidationResponse { @@ -35,17 +24,24 @@ message ValidationResponse { // Validation object ValidationObject validation_object = 3; + + // Price details for the validated product + cmp.types.v1alpha.PriceDetail price_detail = 4; } // Validation message that represents a single `result_id` from the search results -// message. -// -// TODO: Better name? -// TODO: Do we also need `search_id` here? -// TODO: Do we also need `unit_identifier` here? +// message and also the optional `unit_identifier` for specific services that +// requires it. For example a seat for a concert. message ValidationObject { - int32 result_id = 1; - cmp.types.v1alpha.PriceDetail price_detail = 2; + // Search result identifier with `search_id` & `result_id` + cmp.types.v1alpha.SearchIdentifier search_identifier = 1; + + // Unit identifier that is used to describe selected units from the `result_id`. + // For example: seats for a concert. + oneof unit_identifier { + // Selected seat(s) represented as a seat map inventory message type. + cmp.types.v1alpha.SeatMapInventory seat_selection = 2; + } } // ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/book/v1alpha/validate.proto.dot.xs.svg) diff --git a/proto/cmp/types/v1alpha/search.proto b/proto/cmp/types/v1alpha/search.proto index 65d2564..b9f5400 100644 --- a/proto/cmp/types/v1alpha/search.proto +++ b/proto/cmp/types/v1alpha/search.proto @@ -105,6 +105,11 @@ message SearchResponseMetadata { // Search identifier message SearchIdentifier { + // Search ID that is returned in the search response message in the `metadata`` + // (`SearchResponseMetadata`) field. UUID search_id = 1; + + // Result ID that is that is returned by `result_id` field of the search result + // messages, for example: `AccommodationSearchResult`. int32 result_id = 2; } From a68cba403328b07332a655ed531db12f3a1b230a Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 14 May 2024 17:24:05 +0300 Subject: [PATCH 19/22] update comments for the seat map service --- proto/cmp/services/seat_map/v1alpha/seat_map.proto | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/proto/cmp/services/seat_map/v1alpha/seat_map.proto b/proto/cmp/services/seat_map/v1alpha/seat_map.proto index 8151cd1..ab8901b 100644 --- a/proto/cmp/services/seat_map/v1alpha/seat_map.proto +++ b/proto/cmp/services/seat_map/v1alpha/seat_map.proto @@ -16,7 +16,8 @@ message SeatMapRequest { // Unique identifier for the seat map // - // This is the map ID that is received in the search result + // This is the map ID that is received in the search results and also from the + // product info responses. string map_id = 2; } @@ -35,9 +36,7 @@ message SeatMapResponse { cmp.types.v1alpha.SeatMap seat_map = 2; } -// Service for requesting seat map data -// -// Service is used to request the seat map data for a given map ID +// Service for requesting seat map data for a given map ID // // ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/seat_map/v1alpha/seat_map.proto.dot.xs.svg) // [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/seat_map/v1alpha/seat_map.proto.dot.svg) From 1b471962b95e214a6059b0bd2f70c7dc2eefba69 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 14 May 2024 23:16:23 +0300 Subject: [PATCH 20/22] loose the prefix and update comments --- proto/cmp/types/v1alpha/seat_map.proto | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/proto/cmp/types/v1alpha/seat_map.proto b/proto/cmp/types/v1alpha/seat_map.proto index 3cd0a91..a3856fc 100644 --- a/proto/cmp/types/v1alpha/seat_map.proto +++ b/proto/cmp/types/v1alpha/seat_map.proto @@ -6,8 +6,9 @@ import "cmp/types/v1alpha/description.proto"; // Basic representation of a seat with optional features. message Seat { - // Unique identifier, e.g., "12B", "A26" - string seat_id = 1; + // Unique identifier, e.g., "12B", "A26". Must be unique inside the section that + // this seat belongs to. + string id = 1; // Seat location SeatMapLocation location = 2; @@ -48,7 +49,7 @@ message BitmapSeatLocation { // Vector Seat Location for SVG message VectorSeatLocation { // Label, e.g. "section-TERRACE-26-34-2-label" for SVG - string svg_label = 1; + string label = 1; } // Representation of a seat location in SVG or bitmap. @@ -65,7 +66,7 @@ message SeatMapLocation { // section in a plane. message Section { // Level, section or row identifier, e.g., "Upper", "Balcony" or "Section 101", - // "Orchestra" or "A", "12". + // "Orchestra" or "A", "12". Must be unique for each section. string id = 1; // Human readable name of the section @@ -94,7 +95,7 @@ message Section { // [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seat_map.proto.dot.svg) message SeatMap { // Unique identifier for the seat map - string map_id = 1; + string id = 1; // This field represents a recursive `Section` message type that can be used to // describe rows, sections, levels etc. @@ -110,7 +111,8 @@ message SeatMap { // Seat inventory list message SeatInventory { - repeated string seat_ids = 1; + // List of seat IDs + repeated string ids = 1; } // Total and remaining number of seats in a section. @@ -125,7 +127,8 @@ message SeatCounts { // Selection of seats for given section and all its inner sections. Used for seat // availability and seat selection messages. message SectionInventory { - string section_id = 1; + // Unique identifier for the section. Must be unique within the seat map. + string id = 1; oneof seats { // Seats in this section. Contains a list of individual seat IDs. @@ -147,7 +150,7 @@ message SectionInventory { // availability. message SeatMapInventory { // Unique identifier for the seat map that this Inventory refers to. - string map_id = 1; + string id = 1; // Seat inventory including the recursive inner sections repeated SectionInventory sections = 2; From 16fc140f0d7f3b6ab1516b3ab028396ee47ce3fe Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Wed, 15 May 2024 00:25:28 +0300 Subject: [PATCH 21/22] move seats and total/remaining seats into oneof fields - comments updated/improved - SeatMapLocation renamed to SeatLocation - image_urls replaced with the Image type from file.proto - remaining_seats renamed to seat_count for availability & seat selection - helper types moved to the end of the file --- proto/cmp/types/v1alpha/seat_map.proto | 232 +++++++++++++++---------- 1 file changed, 139 insertions(+), 93 deletions(-) diff --git a/proto/cmp/types/v1alpha/seat_map.proto b/proto/cmp/types/v1alpha/seat_map.proto index a3856fc..f47458d 100644 --- a/proto/cmp/types/v1alpha/seat_map.proto +++ b/proto/cmp/types/v1alpha/seat_map.proto @@ -3,67 +3,38 @@ syntax = "proto3"; package cmp.types.v1alpha; import "cmp/types/v1alpha/description.proto"; +import "cmp/types/v1alpha/file.proto"; +import "google/protobuf/wrappers.proto"; -// Basic representation of a seat with optional features. +// Represents a basic seat with optional features and restrictions. Each seat has a +// unique identifier, a location within the seat map, and can have various static +// features and restrictions associated with it. message Seat { - // Unique identifier, e.g., "12B", "A26". Must be unique inside the section that - // this seat belongs to. + // Unique identifier for the seat, such as "12B" or "A26". This identifier must be + // unique within the section to which this seat belongs. string id = 1; - // Seat location - SeatMapLocation location = 2; + // The location of the seat within the seat map. This can be defined using either + // a vector (SVG) or bitmap format. + SeatLocation location = 2; - // Static seat features + // Static features associated with the seat, such as type, amenities, etc. repeated SeatAttribute features = 3; - // Restrictions + // Restrictions associated with the seat, such as age limits or accessibility requirements. repeated SeatAttribute restrictions = 4; } -// FIXME: Can we make this a big enum? -message SeatAttribute { - // Static attributes to be used for features and restrictions - string name = 1; - - // Human readable description - string description = 2; - - // Value to be used for restrictions or conditions like "min_age" - int32 value = 3; -} - -enum AreaType { - AREA_TYPE_UNSPECIFIED = 0; - AREA_TYPE_RECTANGLE = 1; - AREA_TYPE_CIRCLE = 2; - AREA_TYPE_POLYGON = 3; +// List of seats +message SeatList { + repeated Seat seats = 1; } -// Image location for seat maps with bitmap images. This info is generallt used with -// HTML `area` tag. -message BitmapSeatLocation { - AreaType type = 1; - repeated int32 coordinates = 2; -} - -// Vector Seat Location for SVG -message VectorSeatLocation { - // Label, e.g. "section-TERRACE-26-34-2-label" for SVG - string label = 1; -} - -// Representation of a seat location in SVG or bitmap. -message SeatMapLocation { - // Seat location it should be one of vector (SVG) or bitmap location message - // types. - oneof location { - VectorSeatLocation vector = 1; - BitmapSeatLocation bitmap = 2; - } -} - -// Section could be a block of rows or a specific area in a venue like a stage, or a -// section in a plane. +// A Section represents a distinct area within a venue, which can be defined by +// various attributes. It can be a block of rows in a theater, a specific area in a +// concert venue such as the stage or standing area, a section of seating in a +// stadium, or a section in an airplane. Each Section is uniquely identified and can +// contain information about its seats, layout, and additional properties. message Section { // Level, section or row identifier, e.g., "Upper", "Balcony" or "Section 101", // "Orchestra" or "A", "12". Must be unique for each section. @@ -72,24 +43,35 @@ message Section { // Human readable name of the section string name = 2; - // Collection of seats in this section. If it contains inner sections, this field - // can be left empty. - repeated Seat seats = 3; + // Seats in this section. + oneof seat_info { + // List of seats in this section. + SeatList seat_list = 3; - // Location image URL for the seat map. This can be a SVG or bitmap. If this field - // is set, it is assumed that seats in this section is using this image URL for - // seat location. (the `SeatMapLocation` message type in the `Seat` message) - string image_url = 4; - - // Localized description set for this section. This can be used for example to - // describe features and amenities. - cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 5; + // Total number of seats in this section as an integer. + google.protobuf.Int32Value total_seats = 4; + } - // Recursive presentation of inner sections. - repeated Section sections = 6; + // Image that provides a visual representation of the section's layout, which can + // be either a vector (SVG) or bitmap image. + // + // If set, it is assumed that this image is used for locating seats within the + // section. (the `SeatLocation` message type in the `Seat` message above is + // used to represent seat location inside this image). + cmp.types.v1alpha.Image image = 5; + + // A set of localized descriptions for this section, useful for providing + // information about features and amenities in multiple languages. + cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 6; + + // Nested sections within this section, allowing for a hierarchical representation + // of the venue's layout. + repeated Section sections = 7; } -// High-level representation of a seat map. +// High-level representation of a seat map, which defines the layout and structure +// of seating within a venue. This message provides a comprehensive overview of the +// seating arrangement, including sections, images, and localized descriptions. // // ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seat_map.proto.dot.xs.svg) // [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/types/v1alpha/seat_map.proto.dot.svg) @@ -97,61 +79,125 @@ message SeatMap { // Unique identifier for the seat map string id = 1; - // This field represents a recursive `Section` message type that can be used to - // describe rows, sections, levels etc. + // A list of sections within the seat map. Each section represents a distinct area + // within the venue, such as rows, sections, levels, or blocks of seats. This + // field is recursive, allowing for hierarchical structuring of the seating + // layout. repeated Section sections = 2; - // Location image URL for the seat map. This can be a SVG or bitmap. - string image_url = 3; + // Image that provides a visual representation of the seat map, illustrating the + // location and arrangement of seats. The image can be in vector format (SVG) or + // bitmap format. + cmp.types.v1alpha.Image image = 3; - // Localized description set for this map. This can be used for example to - // describe features and amenities. + // A set of localized descriptions for the seat map. This can be used to describe + // features and amenities of the seating arrangement in multiple languages. cmp.types.v1alpha.LocalizedDescriptionSet localized_description_set = 4; } -// Seat inventory list +// List of _only_ seat IDs to be used for seat selection or seat availability. message SeatInventory { // List of seat IDs repeated string ids = 1; } -// Total and remaining number of seats in a section. -message SeatCounts { - // Total number of seats - int32 total_seat_count = 1; - - // Remaining number of seats available for booking - int32 remaining_seat_count = 2; -} - -// Selection of seats for given section and all its inner sections. Used for seat -// availability and seat selection messages. +// Represents the inventory of seats for a specific section and all its inner +// sections. This message is used for both seat availability and seat selection +// purposes, providing information about either the remaining or selected seats +// within the section. message SectionInventory { // Unique identifier for the section. Must be unique within the seat map. string id = 1; - oneof seats { - // Seats in this section. Contains a list of individual seat IDs. - SeatInventory seat_inventory = 2; + oneof seat_info { + // List of individual seat IDs within this section. + SeatInventory seat_list = 2; - // Seat counts in this section. + // Seat count in this section, representing either the remaining seats for + // availability purposes or the selected seats for seat selection messages. // - // This field is intended to be used with sections that do not have individual - // seat information. For example a standing area for a concert or an arena. It - // includes total and remaining seat counts. - SeatCounts seat_counts = 3; + // This field is intended for sections without individual seat details, such as + // standing areas at a concert or an arena. + google.protobuf.Int32Value seat_count = 3; } - // Inner sections in this section. + // Nested inner sections within this section, allowing for a hierarchical + // representation of seat inventory. Each inner section can have its own seat + // information and further nested sections. repeated SectionInventory sections = 4; } -// Inventory of seats for a given seat map used for seat selection or seat -// availability. +// Represents the inventory of seats for a specific seat map, used for both seat +// selection and seat availability purposes. This message provides a comprehensive +// overview of the seating inventory, including detailed information about each +// section and its inner sections. message SeatMapInventory { // Unique identifier for the seat map that this Inventory refers to. string id = 1; - // Seat inventory including the recursive inner sections + // A list of seat inventories for each section within the seat map. This field + // includes detailed seat information and supports nested sections, allowing for a + // hierarchical representation of the seating arrangement. repeated SectionInventory sections = 2; } + +/* Helper messages */ + +// Defines a static attribute for a seat, which can be used for specifying features +// and restrictions. Attributes include a name, a human-readable description, and a +// value that can be used for various conditions or restrictions. +// +// FIXME: Can we make this a big enum? +message SeatAttribute { + // Name of the attribute, used to identify the feature or restriction. + string name = 1; + + // Human-readable description of the attribute, providing more details about its purpose. + string description = 2; + + // Integer value associated with the attribute, which can be used for conditions + // or restrictions, such as "min_age". + int32 value = 3; +} + +// Enumerates the types of areas that can be defined within a seat map. This is used +// for specifying the shape of regions in bitmap images. +enum AreaType { + AREA_TYPE_UNSPECIFIED = 0; + AREA_TYPE_RECTANGLE = 1; + AREA_TYPE_CIRCLE = 2; + AREA_TYPE_POLYGON = 3; +} + +// Defines the location of a seat within a bitmap image seat map. This information +// is generally used with the HTML `area` tag to specify clickable regions. +message BitmapSeatLocation { + // The type of area defining the seat location, such as rectangle, circle, or polygon. + AreaType type = 1; + + // Coordinates defining the area. The format of the coordinates depends on the + // area type (e.g., top-left (x1,y1) and bottom-right (x2,y2) corners for a + // rectangle: ` Date: Wed, 15 May 2024 00:43:16 +0300 Subject: [PATCH 22/22] update diagram script and add wrappers.proto include --- scripts/generate_protodot.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/generate_protodot.sh b/scripts/generate_protodot.sh index 2e32548..a3ebe86 100755 --- a/scripts/generate_protodot.sh +++ b/scripts/generate_protodot.sh @@ -67,16 +67,21 @@ for protofile in `find ${PROTO_DIR} -type f -name '*.proto'`; do fi done +INCLUDE_PROTO_DIR=${PROTO_DIR}/google/protobuf + # Get TIMESTAMP google/protobuf/timestamp.proto -TIMESTAMP_DIR=${PROTO_DIR}/google/protobuf -TIMESTAMP_FILENAME=${TIMESTAMP_DIR}/timestamp.proto -mkdir -p ${TIMESTAMP_DIR} +TIMESTAMP_FILENAME=${INCLUDE_PROTO_DIR}/timestamp.proto +mkdir -p ${INCLUDE_PROTO_DIR} curl https://raw.githubusercontent.com/protocolbuffers/protobuf/main/src/google/protobuf/timestamp.proto > $TIMESTAMP_FILENAME # Get Empty proto file -EMPTY_FILENAME=${TIMESTAMP_DIR}/empty.proto +EMPTY_FILENAME=${INCLUDE_PROTO_DIR}/empty.proto curl https://raw.githubusercontent.com/protocolbuffers/protobuf/main/src/google/protobuf/empty.proto > $EMPTY_FILENAME +# Get Wrappers proto file +WRAPPERS_FILENAME=${INCLUDE_PROTO_DIR}/wrappers.proto +curl https://raw.githubusercontent.com/protocolbuffers/protobuf/main/src/google/protobuf/wrappers.proto > $WRAPPERS_FILENAME + # Generate diagrams for protofile in `find ${PROTO_DIR} -type f -name '*.proto'`; do # Set proto file dir @@ -100,5 +105,5 @@ for truncated_file in "${TRUNCATE[@]}"; do revert_protobuf ${truncated_file} done -# Clean up TIMESTAMP google/protobuf/timestamp.proto -rm -rfv ${TIMESTAMP_DIR} \ No newline at end of file +# Clean up INCLUDE_PROTO_DIR +rm -rfv ${INCLUDE_PROTO_DIR} \ No newline at end of file