Skip to content

Commit

Permalink
[INFO] Country entry requirements service (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
havan authored Apr 17, 2024
1 parent dfcf343 commit 36ab966
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 0 deletions.
111 changes: 111 additions & 0 deletions proto/cmp/services/info/v1alpha/entry_requirements.proto
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;
}
8 changes: 8 additions & 0 deletions proto/cmp/types/v1alpha/filter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,30 @@ message Filter {
// Filter Type
enum FilterType {
FILTER_TYPE_UNSPECIFIED = 0;

// provider specific codes - discouraged to be used as this increases maintenance
// of APIs
FILTER_TYPE_PROVIDER_CODE = 1;

// DRV GlobalTypes https://globaltypecenter.com/
FILTER_TYPE_GLOBAL_TYPE = 2;

// International Air Transport Association https://www.iata.org/
FILTER_TYPE_IATA = 3;

// International Civil Aviation Organization, an agency of the UN
// https://www.icao.int/
FILTER_TYPE_ICAO = 4;

// rail standarization of the UIC https://uic.org/standardisation
FILTER_TYPE_UIC = 5;

// code standard for car classification codes https://www.acriss.org/
FILTER_TYPE_ACRISS = 6;

// well known standard https://www.iso.org/
FILTER_TYPE_ISO = 7;

// settlement services provider https://www.arccorp.com/
FILTER_TYPE_ARC = 8;
}
10 changes: 10 additions & 0 deletions proto/cmp/types/v1alpha/localized.proto
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;
}
11 changes: 11 additions & 0 deletions proto/cmp/types/v1alpha/travel_type.proto
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;
}

0 comments on commit 36ab966

Please sign in to comment.