-
Notifications
You must be signed in to change notification settings - Fork 0
/
entity.proto
100 lines (92 loc) · 2.55 KB
/
entity.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
syntax = "proto3";
package er.schema.entity.v1;
import "google/type/date.proto";
import "google/type/datetime.proto";
import "google/type/latlng.proto";
//import "google/protobuf/timestamp.proto";
//import "google/type/phone_number.proto";
//import "google/type/postal_address.proto";
import "validate/validate.proto";
option java_multiple_files = true;
option java_package = "er.schema.entity.v1";
// Address US PostalAddress
message Address {
optional string suite = 1; // Apartment / Unit #
string street = 2;
// streetNumber + streetName
string city = 3 [(validate.rules).string = {pattern: "(?i)^[a-zA-Z]+$"}];
// stateOrProvince
string state = 4 [(validate.rules).string = {pattern: "(?i)^[a-zA-Z]+$"}];
// postalCode
string code = 5;
optional string country = 6 [(validate.rules).string = {pattern: "(?i)^[a-zA-Z]+$"}];
optional google.type.LatLng location = 7;
}
/*
message Location {
double lat = 1 [(validate.rules).double = { gte: -90, lte: 90 }];
double lng = 2 [(validate.rules).double = { gte: -180, lte: 180 }];
}
*/
message Name {
string first = 1 [(validate.rules).string = {
min_len: 3,
pattern: "(?i)^[a-zA-Z]+$",
max_bytes: 256,
}];
string last = 2 [(validate.rules).string = {
min_len: 2,
pattern: "(?i)^[a-zA-Z]+$",
max_bytes: 256,
}];
optional string middle = 3;
optional string title = 4;
}
enum Status {
STATUS_UNSPECIFIED = 0;
STATUS_FULL_MATCH = 1;
STATUS_PARTIAL_MATCH = 2;
STATUS_NO_HIT = 3;
STATUS_NEW = 4;
}
enum Gender {
GENDER_UNSPECIFIED = 0;
GENDER_MALE = 1;
GENDER_FEMALE = 2;
GENDER_OTHER = 3;
}
message Member {
string external_id = 1 [(validate.rules).string.uuid = true];
optional string national_id = 2;
repeated Name names = 3 [(validate.rules).repeated.min_items = 1];
google.type.Date dob = 4;
Gender gender = 5 [(validate.rules).enum.defined_only = true];
map<string, string> emails = 6 [(validate.rules).map = {
max_pairs: 5
keys: {
string: {min_len: 4}
}
values: {
string: {email: true}
}
}];
map<string, string> phones = 7 [(validate.rules).map = {
max_pairs: 5
keys: {
string: {min_len: 4}
}
values: {
string: {
min_len: 6,
pattern: "(?i)^[0-9]+$",
max_len: 20
}
}
}];
// map<string, google.type.PhoneNumber> phones = 7 ;
repeated Address addresses = 8;
// repeated google.type.PostalAddress addresses = 8;
map<string, string> identifies = 9;
optional google.type.DateTime created_on = 20;
optional google.type.DateTime updated_on = 21;
}