From 43522a23f77d8fd9ed83d043a5fe4fe4e0a119b4 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Thu, 21 Dec 2023 16:05:10 +0300 Subject: [PATCH] [PRODUCT-LIST] Add product list service for Activities (#3) --- .../cmp/services/activity/v1alpha1/list.proto | 32 +++++++++++++++++++ .../v1alpha1/search_result_types.proto | 20 +++++++++--- 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 proto/cmp/services/activity/v1alpha1/list.proto diff --git a/proto/cmp/services/activity/v1alpha1/list.proto b/proto/cmp/services/activity/v1alpha1/list.proto new file mode 100644 index 0000000..4f02027 --- /dev/null +++ b/proto/cmp/services/activity/v1alpha1/list.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package cmp.services.activity.v1alpha1; + +import "cmp/services/activity/v1alpha1/search_result_types.proto"; +import "cmp/types/v1alpha1/common.proto"; +import "google/protobuf/timestamp.proto"; + +message ActivityProductListRequest { + // Message header + cmp.types.v1alpha1.Header header = 1; + + // Only respond with the products that are modified after this timestamp + google.protobuf.Timestamp modified_after = 2; +} + +message ActivityProductListResponse { + // Message header + cmp.types.v1alpha1.Header header = 1; + + // Product list: Activities + repeated Activity activities = 2; +} + +// This service is used to get a product list for activities. +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha1/list.proto.dot.xs.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/activity/v1alpha1/list.proto.dot.svg) +service ActivityProductListService { + // Gets an optional `modified_after` date and returns a product list. + rpc ActivityProductList(ActivityProductListRequest) returns (ActivityProductListResponse); +} diff --git a/proto/cmp/services/activity/v1alpha1/search_result_types.proto b/proto/cmp/services/activity/v1alpha1/search_result_types.proto index 1d1d0cd..69c325a 100644 --- a/proto/cmp/services/activity/v1alpha1/search_result_types.proto +++ b/proto/cmp/services/activity/v1alpha1/search_result_types.proto @@ -20,7 +20,7 @@ message ActivitySearchResult { int32 result_id = 1; // Activity basic info - ActivityInfo info = 2; + Activity info = 2; // Schedule cmp.types.v1alpha1.DateTimeRange schedule = 3; @@ -45,10 +45,10 @@ message ActivitySearchResult { PricingType pricing_type = 9; } -// ### Activity Info +// Represents an Activity product. // // FIXME: We need optimizations in this type -message ActivityInfo { +message Activity { // Ex: "TC000000" string product_code = 1; @@ -78,6 +78,12 @@ message ActivityInfo { // Ex: "Safari" string type_name = 10; + + // Status + // + // FIXME: We need to make this an ENUM (this is also used for several other + // verticals) + string status = 11; } // ### Activity Location @@ -99,8 +105,12 @@ message PickupDropoffEvent { // Ex: "Sunny Beach Hotel", string location_name = 2; - // Ex: "true", - bool pickup_ind = 3; + // True if this pickup location is selected for the activity + // + // Ex: "true" + // + // FIXME: How is this relevant for the search result message? + bool pickup_indicator = 3; // Ex: "OTHERS / Parking Varadero(bus stop css nÂș50)", string other_info = 4;