Skip to content

Commit

Permalink
inusrance branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-c4t committed Sep 13, 2024
1 parent d7e0fe8 commit e9df44a
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 45 deletions.
79 changes: 43 additions & 36 deletions proto/cmp/services/insurance/v1alpha/insurance_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ syntax = "proto3";
package cmp.services.insurance.v1alpha;

import "cmp/types/v1/contact_info.proto";
import "cmp/types/v1/currency.proto";
import "cmp/types/v1/file.proto";
import "cmp/types/v1/link.proto";
import "cmp/types/v1/price.proto";
import "cmp/types/v2alpha/product_code.proto";
import "google/protobuf/timestamp.proto";

// This represents Insurance types which is needed for different insurance services (search, info, ... etc)
Expand All @@ -27,7 +29,7 @@ message Insurance {

message InsurancePolicy {
// Product Code
string product_code = 1; // TODO: shall we use ProductCode here ?!!
cmp.types.v2alpha.ProductCode product_code = 1;

// Description
string description = 2;
Expand All @@ -48,13 +50,13 @@ message PolicyExtendedInfo {
string carrier_name = 3;

// url to logo
cmp.types.v1.Link logo = 4; // TODO: shall we use image here instead of link ?
cmp.types.v1.Image logo = 4;

// enum of possible types, to be used for filtering
PolicyType policy_type = 5;

// Support contact
cmp.types.v1.ContactInfo support_contact = 6; // TODO: I removed emergency number as it can be included in the contact
cmp.types.v1.ContactInfo support_contact = 6;

// Criteria
repeated PolicyCriteria criteria = 7;
Expand All @@ -81,29 +83,8 @@ message PolicyUnit {
// Unit name
string name = 2;

// Maximum coverage amount
double max_coverage_amount = 3;

// Currency
cmp.types.v1.Currency max_coverage_currency = 4;

// url to Detailed list of risks covered
cmp.types.v1.Link coverage_link = 5;

// url to Specific events or conditions that are not covered by the policy
cmp.types.v1.Link exclusions_link = 6;

// pre-existing conditions coverage
bool preconditions_coverage = 7;

// url to Details on whether pre-existing medical conditions are covered, and if so, under what terms.
cmp.types.v1.Link preconditions_coverage_link = 8;

// url to Full legal terms of the policy, privacy policy. compliance,..
cmp.types.v1.Link terms = 9;

// url to Frequently asked questions about the policy page
cmp.types.v1.Link faq = 10;
// Coverage details
PolicyCoverage policy_coverage = 4;
}

message PolicyService {
Expand All @@ -115,18 +96,44 @@ message PolicyService {

// Codes of units
repeated string units_codes = 3;
double max_coverage_amount = 4; // TODO: repeated from Units
cmp.types.v1.Currency max_coverage_currency = 5; // repeated from Units
cmp.types.v1.Link coverage_link = 6; // repeated from Units
cmp.types.v1.Link exclusions_link = 7; // repeated from Units
bool preconditions_coverage = 8; // repeated from Units
cmp.types.v1.Link preconditions_coverage_link = 9; // repeated from Units
cmp.types.v1.Link terms = 10; // repeated from Units
cmp.types.v1.Link faq = 11; // repeated from Units

// Coverage details
PolicyCoverage policy_coverage = 4;
}

// TODO: what are the types here ?!
enum PolicyType {
POLICY_TYPE_UNSPECIFIED = 0;
POLICY_TYPE_OTHER = 1;
POLICY_TYPE_CANCEL = 2;
POLICY_TYPE_TRAVEL = 3;
POLICY_TYPE_TRAVEL_MEDICAL = 4;
POLICY_TYPE_MEDICAL = 5;
POLICY_TYPE_EMERGENCY = 6;
POLICY_TYPE_RENTAL_CAR = 7;
POLICY_TYPE_PERSONAL_BELONGINGS = 8;
POLICY_TYPE_FLIGHT = 9;
POLICY_TYPE_DEATH = 10;
}

message PolicyCoverage {
// Maximum coverage amount
cmp.types.v1.Price max_coverage_amount = 3;

// url to Detailed list of risks covered
cmp.types.v1.Link coverage_link = 4;

// url to Specific events or conditions that are not covered by the policy
cmp.types.v1.Link exclusions_link = 5;

// pre-existing conditions coverage
bool preconditions_coverage = 6;

// url to Details on whether pre-existing medical conditions are covered, and if so, under what terms.
cmp.types.v1.Link preconditions_coverage_link = 7;

// url to Full legal terms of the policy, privacy policy. compliance,..
cmp.types.v1.Link terms = 8;

// url to Frequently asked questions about the policy page
cmp.types.v1.Link faq = 9;
}
2 changes: 1 addition & 1 deletion proto/cmp/services/insurance/v1alpha/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ message InsuranceSearchRequest {
// In the search parameters multiple filters can be applied for upfront filtering
// of the search results to for example to only include hotels that are less than
// one kilometer from the beach, have a kids club and offer an a la carte restaurant
cmp.types.v1.SearchParameters search_parameters_generic = 3; // TODO: what do you mean by this ? enhance enum FilterType with value -Type-"
cmp.types.v1.SearchParameters search_parameters_generic = 3;

// This field represents a list of search queries that can be used to create
// multiroom multi location searches.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ syntax = "proto3";

package cmp.services.insurance.v1alpha;

import "cmp/types/v2alpha/country.proto";
import "cmp/types/v1/currency.proto";
import "cmp/types/v1/travel_period.proto";
import "cmp/types/v1/traveller.proto";
import "cmp/types/v2alpha/country.proto";
import "cmp/types/v2alpha/loyalty_program.proto";
import "cmp/types/v2alpha/network.proto";
import "cmp/types/v2alpha/product_code.proto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ package cmp.services.insurance.v1alpha;

import "cmp/services/insurance/v1alpha/search_parameters_types.proto";

// TODO: why do we have it in a separate file and not in types ?!
message InsuranceSearchQuery {
// Integer query ID, unique per search request
int32 query_id = 1;

// Insurance specific search parameters Ex: Specific search parameters like
// insured booking, nationality, blockchain, ... etc
InsuranceSearchParameters search_parameters_accommodation = 2;
InsuranceSearchParameters search_parameters_insurance = 2;
}
16 changes: 13 additions & 3 deletions proto/cmp/services/insurance/v1alpha/search_result_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ syntax = "proto3";

package cmp.services.insurance.v1alpha;

import "cmp/services/insurance/v1alpha/insurance_types.proto";
import "cmp/types/v1/bookability.proto";
import "cmp/types/v1/price.proto";

Expand All @@ -19,8 +18,8 @@ message InsuranceSearchResult {
// This field represents the query ID associated with the search result.
int32 query_id = 2;

// Units for this search result
repeated PolicyUnit policies = 3; // TODO: which message we should use here ?
// Policies for this search result
repeated PolicyCodes policies = 3;

// ## Total price in detail, with breakdowns
cmp.types.v1.PriceDetail total_price_detail = 4;
Expand All @@ -31,3 +30,14 @@ message InsuranceSearchResult {
// Status of the result, whether it is immediately bookable or not
cmp.types.v1.Bookability bookability = 6;
}

message PolicyCodes {
// Product Code
string product_code = 1;

// Unit Code
string unit_code = 2;

// Service Code
string service_code = 3;
}
4 changes: 2 additions & 2 deletions proto/cmp/types/v2alpha/loyalty_program.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package cmp.types.v2alpha;

import "cmp/types/v2alpha/link.proto";
import "cmp/types/v1/link.proto";

// Loyalty Program
//
Expand All @@ -16,5 +16,5 @@ message LoyaltyProgram {
string name = 2;

// Url to the details of the loyalty program
cmp.types.v2alpha.Link link = 3;
cmp.types.v1.Link link = 3;
}
1 change: 1 addition & 0 deletions proto/cmp/types/v2alpha/product_code.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ message ProductCode {
int32 number = 2;
ProductCodeType type = 3;
}

// TODO: here we added an enum, should we create a new version of it ?
// Product Code type
enum ProductCodeType {
Expand Down

0 comments on commit e9df44a

Please sign in to comment.