Skip to content

Commit

Permalink
separate search parameters to generic and specific
Browse files Browse the repository at this point in the history
  • Loading branch information
havan committed Dec 15, 2023
1 parent 2edc7e1 commit c408115
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 14 deletions.
16 changes: 11 additions & 5 deletions proto/cmp/services/accommodation/v1alpha1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ syntax = "proto3";
// This package is a **WIP**.
package cmp.services.accommodation.v1alpha1;

import "cmp/services/accommodation/v1alpha1/search_parameters_types.proto";
import "cmp/services/accommodation/v1alpha1/search_result_types.proto";
import "cmp/services/accommodation/v1alpha1/unit_types.proto";
import "cmp/types/v1alpha1/common.proto";
Expand All @@ -35,17 +36,22 @@ message AccommodationSearchRequest {
// Search request metadata
cmp.types.v1alpha1.SearchRequestMetadata metadata = 2;

// Search parameters. Example: inclusion of OnRequest options and inclusion of only the cheapest or all options.
cmp.types.v1alpha1.SearchParameters search_parameters = 3;
// Generic Search Parameters
// Ex: Inclusion of OnRequest options and inclusion of only the cheapest or all options.
cmp.types.v1alpha1.SearchParameters search_parameters_generic = 3;

// Accommodation Specific Search Parameters
// Ex: Specific search parameters like geo location, meal plan, rate plan and rate rules.
AccommodationSearchParameters search_parameters_accommodation = 4;

// Travel period
cmp.types.v1alpha1.TravelPeriod travel_period = 4;
cmp.types.v1alpha1.TravelPeriod travel_period = 5;

// Travellers
repeated cmp.types.v1alpha1.Traveller travellers = 5;
repeated cmp.types.v1alpha1.Traveller travellers = 6;

// Unit Types
repeated UnitType unit_types = 6;
repeated UnitType unit_types = 7;
}

// ### Accommodation Search Response
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
syntax = "proto3";

package cmp.services.accommodation.v1alpha1;

import "cmp/types/v1alpha1/location.proto";
import "cmp/types/v1alpha1/meal_plan.proto";
import "cmp/types/v1alpha1/rate.proto";

// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search_parameters_types.proto.dot.xs.svg)
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/accommodation/v1alpha1/search_parameters_types.proto.dot.svg)
message AccommodationSearchParameters {
// Geo Location for search, set only one of the fields at once.
//
// This "one of" field enforces only one of the fields below. They all share memory,
// setting one will remove the others.
oneof geo_location {
// FIXME: Do we need a list of location code here? Other fields are not lists.
cmp.types.v1alpha1.LocationCodes location_codes = 1;

// Single geographic point represented by two double fields.
cmp.types.v1alpha1.Coordinate location_coordinate = 2;

// Geo tree type, representted by Country, Region, and City_or_Resort.
cmp.types.v1alpha1.GeoTree location_geo_tree = 3;

// Geo circle. Represented by a coordinate and a distance for radius
cmp.types.v1alpha1.GeoCircle location_geo_circle = 4;

// Geo polygon. Represented by a list of coordinate points.
cmp.types.v1alpha1.GeoPolygon location_geo_polygon = 5;
}

// Mealplan codes
repeated cmp.types.v1alpha1.MealPlan meal_plan_codes = 6;

// Rate plans
repeated cmp.types.v1alpha1.RatePlan rate_plan = 7;

// Rate Rules
// FIXME: Did we decided to remove this from SearchParameters?
// FIXME: Maybe some users/distributors would want to search for only
// FIXME: RESELLABLE offers?
repeated cmp.types.v1alpha1.RateRule rate_rules = 8;
}
20 changes: 11 additions & 9 deletions proto/cmp/types/v1alpha1/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ message SearchParameters {
// agreed name/value pairs
repeated Filter filters = 8;

// Free-text field to provide more detials for better offer personalization.
// This field can be provided in combination with a Geo location or as stand-alone.
string search_description_text = 9;

// The speech is provided as a link to a recording to process for better offer
// personalization. This field can be provided in combination with a Geo
// location or as stand-alone.
string search_description_audio_url = 10;
}

message SearchParametersSpecific {
// Geo Location for search, set only one of the fields at once.
//
// This one of field enforces only one of the fields below. They all share memory,
Expand All @@ -64,15 +75,6 @@ message SearchParameters {
GeoPolygon location_geo_polygon = 13;
}

// Free-text field to provide more detials for better offer personalization.
// This field can be provided in combination with a Geo location or as stand-alone.
string search_description_text = 14;

// The speech is provided as a link to a recording to process for better offer
// personalization. This field can be provided in combination with a Geo
// location or as stand-alone.
string search_description_audio_url = 15;

// Mealplan codes
repeated MealPlan meal_plan_codes = 16;

Expand Down

0 comments on commit c408115

Please sign in to comment.