-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INFO] Country entry requirements service (#19)
- Loading branch information
Showing
4 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
111 changes: 111 additions & 0 deletions
111
proto/cmp/services/info/v1alpha/entry_requirements.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
syntax = "proto3"; | ||
|
||
package cmp.services.info.v1alpha; | ||
|
||
import "cmp/types/v1alpha/common.proto"; | ||
import "cmp/types/v1alpha/country.proto"; | ||
import "cmp/types/v1alpha/datetime_range.proto"; | ||
import "cmp/types/v1alpha/filter.proto"; | ||
import "cmp/types/v1alpha/language.proto"; | ||
import "cmp/types/v1alpha/localized.proto"; | ||
import "cmp/types/v1alpha/travel_type.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/info/v1alpha/entry_requirements.proto.dot.xs.svg) | ||
// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/info/v1alpha/entry_requirements.proto.dot.svg) | ||
service CountryEntryRequirementsService { | ||
rpc CountryEntryRequirements(CountryEntryRequirementsRequest) returns (CountryEntryRequirementsResponse); | ||
} | ||
|
||
message CountryEntryRequirementsRequest { | ||
// Message header | ||
cmp.types.v1alpha.RequestHeader header = 1; | ||
|
||
// Departure country | ||
cmp.types.v1alpha.Country departure = 2; | ||
|
||
// Destination country | ||
cmp.types.v1alpha.Country destination = 3; | ||
|
||
// Citizenship | ||
cmp.types.v1alpha.Country citizenship = 4; | ||
|
||
// Residence | ||
cmp.types.v1alpha.Country residence = 5; | ||
|
||
// Transit country | ||
cmp.types.v1alpha.Country transit = 6; | ||
|
||
// Travel type, ex: business or tourism | ||
cmp.types.v1alpha.TravelType travel_type = 7; | ||
|
||
// Date time range, start and end dates of visit, as timestamp. | ||
cmp.types.v1alpha.DateTimeRange datetime_range = 8; | ||
|
||
// Languages requested | ||
repeated cmp.types.v1alpha.Language languages = 9; | ||
|
||
bool exclude_categories = 10; | ||
|
||
bool include_items = 11; | ||
|
||
repeated cmp.types.v1alpha.Filter filters = 12; | ||
} | ||
|
||
message CountryEntryRequirementsResponse { | ||
// Message header | ||
cmp.types.v1alpha.ResponseHeader header = 1; | ||
|
||
// This must be a UUID according to RFC 4122 | ||
string response_id = 2; | ||
|
||
// Categories | ||
repeated CountryEntryRequirementCategory categories = 3; | ||
|
||
// Items | ||
repeated CountryEntryRequirementItem items = 4; | ||
} | ||
|
||
// Types | ||
|
||
message CountryEntryRequirementCategory { | ||
// Category key. FIXME: Can this field be an enum? | ||
string key = 1; | ||
|
||
// List of localized names | ||
repeated cmp.types.v1alpha.LocalizedString names = 2; | ||
|
||
// Items | ||
CountryEntryRequirementItem items = 3; | ||
|
||
// Sub categories | ||
repeated CountryEntryRequirementCategory sub_categories = 4; | ||
} | ||
|
||
message CountryEntryRequirementItem { | ||
// Item type key. FIXME: Can this field be an enum? | ||
string key = 1; | ||
|
||
// Language specific names and descriptions | ||
repeated LocalizedItemInfo info = 2; | ||
|
||
// Status of the item. TODO: Add more explanation, what it means if it's false? | ||
ItemStatus status = 3; | ||
|
||
// Significant update date | ||
google.protobuf.Timestamp last_significant_update = 4; | ||
} | ||
|
||
message LocalizedItemInfo { | ||
string name = 1; | ||
string description = 2; | ||
cmp.types.v1alpha.Language language = 3; | ||
} | ||
|
||
// FIXME: We need to clarify what true, false and undefined means for status and | ||
// maybe update this enum accordingly | ||
enum ItemStatus { | ||
ITEM_STATUS_UNSPECIFIED = 0; | ||
ITEM_STATUS_TRUE = 1; | ||
ITEM_STATUS_FALSE = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
syntax = "proto3"; | ||
|
||
package cmp.types.v1alpha; | ||
|
||
import "cmp/types/v1alpha/language.proto"; | ||
|
||
message LocalizedString { | ||
string text = 1; | ||
Language language = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
syntax = "proto3"; | ||
|
||
package cmp.types.v1alpha; | ||
|
||
enum TravelType { | ||
TRAVEL_TYPE_UNSPECIFIED = 0; | ||
TRAVEL_TYPE_LEISURE = 1; | ||
TRAVEL_TYPE_BUSINESS = 2; | ||
TRAVEL_TYPE_CONFERENCE = 3; | ||
TRAVEL_TYPE_GROUP = 4; | ||
} |