-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomer.proto
72 lines (60 loc) · 2.24 KB
/
customer.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
syntax = "proto3";
option csharp_namespace = "GsServer.Protobufs";
import "gs_protobufs/protos/user.proto";
import "gs_protobufs/protos/custom_types/dependent.proto";
import "gs_protobufs/protos/custom_types/person.proto";
import "gs_protobufs/protos/custom_types/void_value.proto";
import "google/protobuf/wrappers.proto";
package protos.customer;
service CustomerService {
rpc GetPaginatedAsync(GetPaginatedCustomersRequest) returns (GetPaginatedCustomersResponse);
rpc GetByIdAsync(GetCustomerByIdRequest) returns (GetCustomerByIdResponse);
// Options are a lean data structure for dropdowns and alike
rpc GetAllOptionsAsync(custom_types.void.VoidValue) returns (GetAllCustomersOptionsResponse);
rpc PostAsync(CreateCustomerRequest) returns (custom_types.void.VoidValue);
rpc PutAsync(UpdateCustomerRequest) returns (custom_types.void.VoidValue);
rpc DeleteAsync(DeleteCustomerRequest) returns (custom_types.void.VoidValue);
}
message GetPaginatedCustomersRequest {
google.protobuf.StringValue cursor = 1;
}
message GetPaginatedCustomersResponse {
repeated GetCustomerByIdResponse customers = 1;
google.protobuf.StringValue next_cursor = 2;
}
message GetCustomerByIdRequest {
string customer_id = 1;
}
message GetCustomerByIdResponse {
string customer_id = 1;
optional user.GetUserByIdResponse user = 2;
custom_types.person.Person person = 3;
repeated custom_types.dependent.Dependent dependents = 4;
string billing_address = 5;
string additional_information = 6;
}
message CustomerOption {
string customer_id = 1;
custom_types.person.Person person = 2;
repeated custom_types.dependent.Dependent dependents = 3;
}
message GetAllCustomersOptionsResponse {
repeated CustomerOption customer_options = 1;
}
message CreateCustomerRequest {
custom_types.person.Person person = 1;
repeated custom_types.dependent.Dependent dependents = 2;
string billing_address = 3;
string additional_information = 4;
}
message UpdateCustomerRequest {
string customer_id = 1;
optional user.GetUserByIdResponse user = 2;
custom_types.person.Person person = 3;
repeated custom_types.dependent.Dependent dependents = 4;
string billing_address = 5;
string additional_information = 6;
}
message DeleteCustomerRequest {
string customer_id = 1;
}