@restorecommerce/protos 2.0.2 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/google/protobuf/timestamp.proto +147 -0
  3. package/io/restorecommerce/access_control.proto +3 -5
  4. package/io/restorecommerce/address.proto +38 -37
  5. package/io/restorecommerce/attribute.proto +4 -4
  6. package/io/restorecommerce/auth.proto +15 -15
  7. package/io/restorecommerce/authentication_log.proto +12 -14
  8. package/io/restorecommerce/command.proto +10 -12
  9. package/io/restorecommerce/commandinterface.proto +3 -4
  10. package/io/restorecommerce/contact_point.proto +11 -13
  11. package/io/restorecommerce/contact_point_type.proto +5 -7
  12. package/io/restorecommerce/country.proto +7 -9
  13. package/io/restorecommerce/credential.proto +9 -9
  14. package/io/restorecommerce/customer.proto +9 -11
  15. package/io/restorecommerce/file.proto +23 -0
  16. package/io/restorecommerce/filter.proto +1 -1
  17. package/io/restorecommerce/fulfillment.proto +87 -104
  18. package/io/restorecommerce/fulfillment_courier.proto +15 -17
  19. package/io/restorecommerce/fulfillment_product.proto +44 -47
  20. package/io/restorecommerce/geometry.proto +23 -0
  21. package/io/restorecommerce/graph.proto +17 -17
  22. package/io/restorecommerce/image.proto +13 -12
  23. package/io/restorecommerce/invoice.proto +49 -51
  24. package/io/restorecommerce/job.proto +44 -46
  25. package/io/restorecommerce/locale.proto +6 -8
  26. package/io/restorecommerce/location.proto +11 -13
  27. package/io/restorecommerce/manufacturer.proto +6 -8
  28. package/io/restorecommerce/meta.proto +5 -5
  29. package/io/restorecommerce/notification.proto +8 -10
  30. package/io/restorecommerce/notification_channel.proto +6 -6
  31. package/io/restorecommerce/notification_req.proto +16 -16
  32. package/io/restorecommerce/oauth.proto +1 -1
  33. package/io/restorecommerce/order.proto +65 -72
  34. package/io/restorecommerce/organization.proto +15 -17
  35. package/io/restorecommerce/ostorage.proto +31 -33
  36. package/io/restorecommerce/payment.proto +32 -34
  37. package/io/restorecommerce/payment_method.proto +7 -7
  38. package/io/restorecommerce/policy.proto +16 -18
  39. package/io/restorecommerce/policy_set.proto +12 -14
  40. package/io/restorecommerce/price_group.proto +6 -8
  41. package/io/restorecommerce/product.proto +146 -48
  42. package/io/restorecommerce/product_category.proto +10 -12
  43. package/io/restorecommerce/product_prototype.proto +8 -10
  44. package/io/restorecommerce/rendering.proto +2 -2
  45. package/io/restorecommerce/resource_base.proto +20 -20
  46. package/io/restorecommerce/role.proto +6 -8
  47. package/io/restorecommerce/rule.proto +20 -22
  48. package/io/restorecommerce/search.proto +4 -6
  49. package/io/restorecommerce/status.proto +13 -8
  50. package/io/restorecommerce/tax.proto +13 -10
  51. package/io/restorecommerce/tax_type.proto +13 -9
  52. package/io/restorecommerce/timezone.proto +5 -7
  53. package/io/restorecommerce/token.proto +11 -13
  54. package/io/restorecommerce/user.proto +46 -49
  55. package/package.json +2 -2
@@ -2,20 +2,21 @@ syntax = "proto3";
2
2
 
3
3
  package io.restorecommerce.product;
4
4
 
5
+ import "google/protobuf/any.proto";
5
6
  import "io/restorecommerce/resource_base.proto";
6
7
  import "io/restorecommerce/meta.proto";
7
8
  import "io/restorecommerce/image.proto";
9
+ import "io/restorecommerce/file.proto";
8
10
  import "io/restorecommerce/auth.proto";
9
11
  import "io/restorecommerce/status.proto";
10
12
  import "io/restorecommerce/attribute.proto";
13
+ import "io/restorecommerce/geometry.proto";
11
14
  import "io/restorecommerce/options.proto";
12
15
 
13
16
  // Used by resolvers
14
17
  import "io/restorecommerce/manufacturer.proto";
15
18
 
16
- service Service {
17
- option (io.restorecommerce.options.service_name) = "product";
18
-
19
+ service ProductService {
19
20
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (ProductListResponse) {
20
21
  option (io.restorecommerce.options.is_query) = true;
21
22
  };
@@ -25,22 +26,63 @@ service Service {
25
26
  rpc Upsert (ProductList) returns (ProductListResponse);
26
27
  }
27
28
 
28
- // Product resource
29
- message MainProduct {
30
- string id = 1;
29
+ enum AssociationType {
30
+ Miscellaneous = 0;
31
+ Accessory = 1;
32
+ Recommendation = 2;
33
+ }
34
+
35
+ message Association {
36
+ optional string product_id = 1 [
37
+ (io.restorecommerce.options.resolver) = {
38
+ target_type: ".io.restorecommerce.product.Product",
39
+ target_service: "catalog",
40
+ target_sub_service: "product",
41
+ target_method: "Read",
42
+ field_name: "product",
43
+ }
44
+ ];
45
+ AssociationType type = 2;
46
+ repeated string tags = 3;
47
+ google.protobuf.Any data = 4;
48
+ }
49
+
50
+ message Appendix {
51
+ optional int64 index = 1;
52
+ optional string name = 2;
53
+ optional string description = 3;
54
+ repeated string tags = 4;
55
+ optional string url = 5;
56
+ optional string content_type = 6;
57
+ optional io.restorecommerce.image.Image thumbnail = 7;
58
+ }
59
+
60
+ // Product resource entity
61
+ message Product {
62
+ option (restorecommerce.options.kafka_subscriber) = {
63
+ plural: "products"
64
+ topic: "io.restorecommerce.product.resource"
65
+ created: "productCreated"
66
+ updated: "productUpdated"
67
+ deleted: "productDeleted"
68
+ };
69
+
70
+ optional string id = 1;
71
+ io.restorecommerce.meta.Meta meta = 2;
31
72
  oneof product_type {
32
- Product product = 2;
33
- Bundle bundle = 3;
73
+ IndividualProduct product = 3;
74
+ Bundle bundle = 4;
34
75
  }
35
- bool active = 4;
36
- io.restorecommerce.meta.Meta meta = 5;
76
+ optional bool active = 5;
77
+ repeated string tags = 6;
78
+ repeated Association associations = 7;
79
+ google.protobuf.Any data = 8;
37
80
  }
38
81
 
39
- message Product {
40
- string id = 1;
41
- string name = 2;
42
- string description = 3;
43
- string manufacturer_id = 4 [
82
+ message IndividualProduct {
83
+ optional string name = 1;
84
+ optional string description = 2;
85
+ optional string manufacturer_id = 3 [
44
86
  (io.restorecommerce.options.resolver) = {
45
87
  target_type: ".io.restorecommerce.manufacturer.Manufacturer",
46
88
  target_service: "catalog",
@@ -49,24 +91,47 @@ message Product {
49
91
  field_name: "manufacturer",
50
92
  }
51
93
  ];
52
- string taric_code = 5;
94
+ optional string taric_code = 4;
53
95
  oneof classification {
54
- Identifier prototype = 6;
55
- Identifier category = 7;
96
+ string prototype_id = 5 [
97
+ (io.restorecommerce.options.resolver) = {
98
+ target_type: ".io.restorecommerce.product_prototype.ProductPrototype",
99
+ target_service: "catalog",
100
+ target_sub_service: "product_prototype",
101
+ target_method: "Read",
102
+ field_name: "prototype",
103
+ }
104
+ ];
105
+ string category_id = 6 [
106
+ (io.restorecommerce.options.resolver) = {
107
+ target_type: ".io.restorecommerce.product_category.ProductCategory",
108
+ target_service: "catalog",
109
+ target_sub_service: "product_category",
110
+ target_method: "Read",
111
+ field_name: "category",
112
+ }
113
+ ];
56
114
  }
57
- repeated string tax_id = 8;
58
- repeated Variant variants = 9;
59
- string gtin = 10;
115
+ repeated string tax_ids = 7;
116
+ optional string gtin = 8;
117
+ oneof nature {
118
+ PhysicalProduct physical = 9;
119
+ VirtualProduct virtual = 10;
120
+ };
121
+ }
122
+
123
+ message PhysicalProduct {
124
+ repeated PhysicalVariant variants = 1;
60
125
  }
61
126
 
62
- message Identifier {
63
- string id = 1;
127
+ message VirtualProduct {
128
+ repeated VirtualVariant variants = 1;
64
129
  }
65
130
 
66
131
  message ProductList {
67
- repeated MainProduct items = 1;
68
- uint32 total_count = 2;
69
- io.restorecommerce.auth.Subject subject = 3;
132
+ repeated Product items = 1;
133
+ optional uint32 total_count = 2;
134
+ optional io.restorecommerce.auth.Subject subject = 3;
70
135
  }
71
136
 
72
137
  message ProductListResponse {
@@ -76,38 +141,71 @@ message ProductListResponse {
76
141
  }
77
142
 
78
143
  message ProductResponse {
79
- MainProduct payload = 1;
144
+ Product payload = 1;
80
145
  io.restorecommerce.status.Status status = 3;
81
146
  }
82
147
 
83
- message Variant {
84
- string id = 1;
85
- string name = 2;
86
- string description = 3;
87
- int32 stock_level = 4;
88
- double price = 5;
89
- bool sale = 6;
90
- double sale_price = 7;
91
- repeated io.restorecommerce.image.Image image = 8;
92
- string stock_keeping_unit = 9;
93
- string template_variant = 10;
94
- repeated io.restorecommerce.attribute.Attribute attributes = 11;
148
+ message Package {
149
+ optional io.restorecommerce.geometry.BoundingBox3D size_in_cm = 1;
150
+ optional double weight_in_kg = 2;
151
+ optional bool rotatable = 3;
152
+ }
153
+
154
+ message PhysicalVariant {
155
+ optional string id = 1;
156
+ optional string name = 2;
157
+ optional string description = 3;
158
+ optional int32 stock_level = 4;
159
+ optional double price = 5;
160
+ optional bool sale = 6;
161
+ optional double sale_price = 7;
162
+ repeated io.restorecommerce.image.Image images = 8;
163
+ repeated io.restorecommerce.file.File files = 9;
164
+ optional string stock_keeping_unit = 10;
165
+ optional string template_variant = 11;
166
+ optional Package package = 12;
167
+ repeated io.restorecommerce.attribute.Attribute attributes = 13;
168
+ }
169
+
170
+ message VirtualVariant {
171
+ optional string id = 1;
172
+ optional string name = 2;
173
+ optional string description = 3;
174
+ optional int32 stock_level = 4;
175
+ optional double price = 5;
176
+ optional bool sale = 6;
177
+ optional double sale_price = 7;
178
+ repeated io.restorecommerce.image.Image images = 8;
179
+ repeated io.restorecommerce.file.File files = 9;
180
+ optional string stock_keeping_unit = 10;
181
+ optional string template_variant = 11;
182
+ repeated io.restorecommerce.attribute.Attribute attributes = 12;
95
183
  }
96
184
 
97
185
  message Bundle {
98
- string id = 1;
99
- string name = 3;
100
- string description = 4;
101
- repeated io.restorecommerce.image.Image image = 5;
102
- repeated BundleProduct product = 6;
103
- double price = 7;
186
+ optional string name = 1;
187
+ optional string description = 2;
188
+ repeated io.restorecommerce.image.Image images = 3;
189
+ repeated BundleProduct products = 4;
190
+ optional double price = 5;
191
+ optional Package pre_packaged = 6;
104
192
  }
105
193
 
106
194
  message BundleProduct {
107
- string product_id = 1;
108
- uint32 quantity = 2;
195
+ optional string product_id = 1 [
196
+ (io.restorecommerce.options.resolver) = {
197
+ target_type: ".io.restorecommerce.product.Product",
198
+ target_service: "catalog",
199
+ target_sub_service: "product",
200
+ target_method: "Read",
201
+ field_name: "product",
202
+ }
203
+ ];
204
+ optional string variant_id = 2;
205
+ optional uint32 quantity = 3;
206
+ optional double tax_ratio = 4; //Discount in relation to the bundle price
109
207
  }
110
208
 
111
209
  message Deleted {
112
- string id = 1;
210
+ optional string id = 1;
113
211
  }
@@ -14,11 +14,11 @@ import "io/restorecommerce/price_group.proto";
14
14
 
15
15
  // ProductCategory resource
16
16
  message ProductCategory {
17
- string id = 1;
18
- io.restorecommerce.meta.Meta meta = 2;
19
- string name = 3;
20
- string description = 4;
21
- string price_group_id = 5 [
17
+ optional string id = 1;
18
+ optional io.restorecommerce.meta.Meta meta = 2;
19
+ optional string name = 3;
20
+ optional string description = 4;
21
+ optional string price_group_id = 5 [
22
22
  (io.restorecommerce.options.resolver) = {
23
23
  target_type: ".io.restorecommerce.price_group.PriceGroup",
24
24
  target_service: "catalog",
@@ -27,13 +27,13 @@ message ProductCategory {
27
27
  field_name: "priceGroup",
28
28
  }
29
29
  ];
30
- io.restorecommerce.image.Image image = 6;
31
- Parent parent = 7;
30
+ optional io.restorecommerce.image.Image image = 6;
31
+ optional Parent parent = 7;
32
32
  }
33
33
 
34
34
  message ProductCategoryList {
35
35
  repeated ProductCategory items = 1;
36
- uint32 total_count = 2;
36
+ optional uint32 total_count = 2;
37
37
  io.restorecommerce.auth.Subject subject = 3;
38
38
  }
39
39
 
@@ -53,12 +53,10 @@ message Deleted {
53
53
  }
54
54
 
55
55
  message Parent {
56
- string parent_id = 1;
56
+ optional string parent_id = 1;
57
57
  }
58
58
 
59
- service Service {
60
- option (io.restorecommerce.options.service_name) = "product_category";
61
-
59
+ service ProductCategoryService {
62
60
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (ProductCategoryListResponse) {
63
61
  option (io.restorecommerce.options.is_query) = true;
64
62
  };
@@ -10,17 +10,17 @@ import "io/restorecommerce/options.proto";
10
10
 
11
11
  // ProductPrototype resource
12
12
  message ProductPrototype {
13
- string id = 1;
14
- io.restorecommerce.meta.Meta meta = 2;
15
- string name = 3;
16
- string version = 4;
17
- string description = 5;
18
- string category_id = 6;
13
+ optional string id = 1;
14
+ optional io.restorecommerce.meta.Meta meta = 2;
15
+ optional string name = 3;
16
+ optional string version = 4;
17
+ optional string description = 5;
18
+ optional string category_id = 6;
19
19
  }
20
20
 
21
21
  message ProductPrototypeList {
22
22
  repeated ProductPrototype items = 1;
23
- uint32 total_count = 2;
23
+ optional uint32 total_count = 2;
24
24
  io.restorecommerce.auth.Subject subject = 3;
25
25
  }
26
26
 
@@ -39,9 +39,7 @@ message Deleted {
39
39
  string id = 1;
40
40
  }
41
41
 
42
- service Service {
43
- option (io.restorecommerce.options.service_name) = "product_prototype";
44
-
42
+ service ProductPrototypeService {
45
43
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (ProductPrototypeListResponse) {
46
44
  option (io.restorecommerce.options.is_query) = true;
47
45
  };
@@ -25,10 +25,10 @@ message Payload {
25
25
  message RenderRequest {
26
26
  string id = 1; // identifies the render request payload
27
27
  // List of templates with associated data and rendering options
28
- repeated Payload payload = 2;
28
+ repeated Payload payloads = 2;
29
29
  }
30
30
 
31
31
  message RenderResponse {
32
32
  string id = 1;
33
- repeated google.protobuf.Any response = 2; // error or HTML contents
33
+ repeated google.protobuf.Any responses = 2; // error or HTML contents
34
34
  }
@@ -17,8 +17,8 @@ service Service {
17
17
  }
18
18
 
19
19
  message FieldFilter {
20
- string name = 1;
21
- bool include = 2;
20
+ optional string name = 1;
21
+ optional bool include = 2;
22
22
  }
23
23
 
24
24
  message Sort {
@@ -28,7 +28,7 @@ message Sort {
28
28
  DESCENDING = 2;
29
29
  }
30
30
  string field = 1;
31
- SortOrder order = 2;
31
+ optional SortOrder order = 2;
32
32
  }
33
33
 
34
34
  message Filter {
@@ -53,35 +53,35 @@ message Filter {
53
53
  DATE = 3;
54
54
  ARRAY = 4;
55
55
  }
56
- ValueType type = 4;
56
+ optional ValueType type = 4;
57
57
  repeated io.restorecommerce.filter.FilterOp filters = 5; // for nested filtering and to make optional its in separate filter.proto file
58
58
  }
59
59
 
60
60
  message FilterOp {
61
- repeated Filter filter = 1;
61
+ repeated Filter filters = 1;
62
62
  enum Operator {
63
63
  and = 0;
64
64
  or = 1;
65
65
  }
66
- Operator operator = 2;
66
+ optional Operator operator = 2;
67
67
  }
68
68
 
69
69
  message Search {
70
- string search = 1; // search string
70
+ optional string search = 1; // search string
71
71
  repeated string fields = 2; // list of fields to be searched on entity (if not specified all indexed fields will be searched)
72
- bool case_sensitive = 3; // default search is case insensitive
72
+ optional bool case_sensitive = 3; // default search is case insensitive
73
73
  }
74
74
 
75
75
  message ReadRequest {
76
- uint32 offset = 1;
77
- uint32 limit = 2;
78
- repeated Sort sort = 3;
76
+ optional uint32 offset = 1;
77
+ optional uint32 limit = 2;
78
+ repeated Sort sorts = 3;
79
79
 
80
80
  /// Filter based on fieldName|operation, value|list
81
81
  repeated FilterOp filters = 4; // repeated filters
82
82
 
83
83
  /// Fields selector
84
- repeated FieldFilter field = 5;
84
+ repeated FieldFilter fields = 5;
85
85
 
86
86
  /** Check the query parameters of HTTP request.
87
87
  * If query parameter `locales` is given,
@@ -93,19 +93,19 @@ message ReadRequest {
93
93
  repeated string locales_limiter = 7;
94
94
 
95
95
  repeated string custom_queries = 8;
96
- google.protobuf.Any custom_arguments = 9;
96
+ optional google.protobuf.Any custom_arguments = 9;
97
97
  io.restorecommerce.auth.Subject subject = 10;
98
- Search search = 11;
98
+ optional Search search = 11;
99
99
  }
100
100
 
101
101
  message DeleteRequest {
102
102
  /// Request to purge the whole collection
103
- bool collection = 1;
103
+ optional bool collection = 1;
104
104
  /// Delete specified documents
105
105
  repeated string ids = 2;
106
106
  io.restorecommerce.auth.Subject subject = 3;
107
- repeated string view = 4; // list of views to be dropped
108
- repeated string analyzer = 5; // list of analyzers to be deleted
107
+ repeated string views = 4; // list of views to be dropped
108
+ repeated string analyzers = 5; // list of analyzers to be deleted
109
109
  }
110
110
 
111
111
  message DeleteResponse {
@@ -116,7 +116,7 @@ message DeleteResponse {
116
116
  /// List of resources
117
117
  message ResourceList {
118
118
  repeated Resource items = 1;
119
- uint32 total_count = 2;
119
+ optional uint32 total_count = 2;
120
120
  io.restorecommerce.auth.Subject subject = 3;
121
121
  }
122
122
 
@@ -135,6 +135,6 @@ message ResourceResponse {
135
135
 
136
136
  /// Example resource
137
137
  message Resource {
138
- string id = 1;
139
- io.restorecommerce.meta.Meta meta = 2;
138
+ optional string id = 1;
139
+ optional io.restorecommerce.meta.Meta meta = 2;
140
140
  }
@@ -8,9 +8,7 @@ import "io/restorecommerce/auth.proto";
8
8
  import "io/restorecommerce/status.proto";
9
9
  import "io/restorecommerce/options.proto";
10
10
 
11
- service Service {
12
- option (io.restorecommerce.options.service_name) = "role";
13
-
11
+ service RoleService {
14
12
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (RoleListResponse) {
15
13
  option (io.restorecommerce.options.is_query) = true;
16
14
  };
@@ -21,16 +19,16 @@ service Service {
21
19
  }
22
20
 
23
21
  message Role {
24
- string id = 1;
25
- io.restorecommerce.meta.Meta meta = 2;
26
- string name = 3; // specifies the role of the user
27
- string description = 4;
22
+ optional string id = 1;
23
+ optional io.restorecommerce.meta.Meta meta = 2;
24
+ optional string name = 3; // specifies the role of the user
25
+ optional string description = 4;
28
26
  repeated string assignable_by_roles = 5; // role id who can assign this role
29
27
  }
30
28
 
31
29
  message RoleList {
32
30
  repeated Role items = 1;
33
- uint32 total_count = 2;
31
+ optional uint32 total_count = 2;
34
32
  io.restorecommerce.auth.Subject subject = 3;
35
33
  }
36
34
 
@@ -14,9 +14,9 @@ import "io/restorecommerce/options.proto";
14
14
  * Target specified by a Rule or a Request.
15
15
  */
16
16
  message Target {
17
- repeated io.restorecommerce.attribute.Attribute subject = 1;
17
+ repeated io.restorecommerce.attribute.Attribute subjects = 1;
18
18
  repeated io.restorecommerce.attribute.Attribute resources = 2;
19
- repeated io.restorecommerce.attribute.Attribute action = 3;
19
+ repeated io.restorecommerce.attribute.Attribute actions = 3;
20
20
  }
21
21
 
22
22
  /**
@@ -28,29 +28,29 @@ enum Effect {
28
28
  }
29
29
 
30
30
  message Rule {
31
- string id = 1;
32
- io.restorecommerce.meta.Meta meta = 2;
33
- string name = 3;
34
- string description = 4;
35
- Target target = 5;
36
- ContextQuery context_query = 6;
37
- string condition = 7; // JS code
38
- Effect effect = 8;
39
- bool evaluation_cacheable = 9;
31
+ optional string id = 1;
32
+ optional io.restorecommerce.meta.Meta meta = 2;
33
+ optional string name = 3;
34
+ optional string description = 4;
35
+ optional Target target = 5;
36
+ optional ContextQuery context_query = 6;
37
+ optional string condition = 7; // JS code
38
+ optional Effect effect = 8;
39
+ optional bool evaluation_cacheable = 9;
40
40
  }
41
41
 
42
42
  message RuleRQ { // used for `whatIsAllowed` / reverse queries
43
- string id = 1;
44
- Target target = 2;
45
- Effect effect = 3;
46
- string condition = 4;
47
- ContextQuery context_query = 5;
48
- bool evaluation_cacheable = 6;
43
+ optional string id = 1;
44
+ optional Target target = 2;
45
+ optional Effect effect = 3;
46
+ optional string condition = 4;
47
+ optional ContextQuery context_query = 5;
48
+ optional bool evaluation_cacheable = 6;
49
49
  }
50
50
 
51
51
  message RuleList {
52
52
  repeated Rule items = 1;
53
- uint32 total_count = 2;
53
+ optional uint32 total_count = 2;
54
54
  io.restorecommerce.auth.Subject subject = 3;
55
55
  }
56
56
 
@@ -70,12 +70,10 @@ message RuleResponse {
70
70
  // The retrieved data can then be passed onto the request's context
71
71
  message ContextQuery {
72
72
  repeated io.restorecommerce.filter.FilterOp filters = 1;
73
- string query = 2;
73
+ optional string query = 2;
74
74
  }
75
75
 
76
- service Service {
77
- option (io.restorecommerce.options.service_name) = "rule";
78
-
76
+ service RuleService {
79
77
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (RuleListResponse) {
80
78
  option (io.restorecommerce.options.is_query) = true;
81
79
  };
@@ -6,16 +6,14 @@ import "io/restorecommerce/auth.proto";
6
6
  import "io/restorecommerce/options.proto";
7
7
 
8
8
  // Service provides the CRUD operations
9
- service Service {
10
- option (io.restorecommerce.options.service_name) = "search";
11
-
9
+ service SearchService {
12
10
  rpc Search (SearchRequest) returns (SearchResponse);
13
11
  }
14
12
 
15
13
  message SearchRequest {
16
- string collection = 1;
17
- string text = 2;
18
- repeated string acl = 3;
14
+ optional string collection = 1;
15
+ optional string text = 2;
16
+ repeated string acls = 3;
19
17
  io.restorecommerce.auth.Subject subject = 4;
20
18
  }
21
19
 
@@ -3,24 +3,29 @@ syntax = "proto3";
3
3
  package io.restorecommerce.status;
4
4
 
5
5
  message Status {
6
- string id = 1;
7
- uint32 code = 2;
8
- string message = 3;
6
+ optional string id = 1;
7
+ optional uint32 code = 2;
8
+ optional string message = 3;
9
9
  }
10
10
 
11
11
  message StatusArray {
12
- repeated Status status = 1;
12
+ repeated Status status = 1;
13
13
  }
14
14
 
15
15
  message StatusObj {
16
- Status status = 1;
16
+ optional Status status = 1;
17
17
  }
18
18
 
19
19
  message OperationStatusObj {
20
- OperationStatus operation_status = 1;
20
+ optional OperationStatus operation_status = 1;
21
21
  }
22
22
 
23
23
  message OperationStatus {
24
- uint32 code = 1;
25
- string message = 2;
24
+ optional uint32 code = 1;
25
+ optional string message = 2;
26
+ }
27
+
28
+ message StatusListResponse {
29
+ repeated Status status = 1;
30
+ optional OperationStatus operation_status = 2;
26
31
  }
@@ -15,9 +15,7 @@ import "io/restorecommerce/tax_type.proto";
15
15
  /*
16
16
  * Microservice definition.
17
17
  */
18
- service Service {
19
- option (io.restorecommerce.options.service_name) = "tax";
20
-
18
+ service TaxService {
21
19
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (TaxListResponse) {
22
20
  option (io.restorecommerce.options.is_query) = true;
23
21
  };
@@ -33,7 +31,7 @@ message Deleted {
33
31
 
34
32
  message TaxList {
35
33
  repeated Tax items = 1;
36
- uint32 total_count = 2;
34
+ optional uint32 total_count = 2;
37
35
  io.restorecommerce.auth.Subject subject = 3;
38
36
  }
39
37
 
@@ -49,9 +47,9 @@ message TaxResponse {
49
47
  }
50
48
 
51
49
  message Tax {
52
- string id = 1;
53
- io.restorecommerce.meta.Meta meta = 2;
54
- string country_id = 3 [
50
+ optional string id = 1;
51
+ optional io.restorecommerce.meta.Meta meta = 2;
52
+ optional string country_id = 3 [
55
53
  (io.restorecommerce.options.resolver) = {
56
54
  target_type: ".io.restorecommerce.country.Country",
57
55
  target_service: "resource",
@@ -60,9 +58,9 @@ message Tax {
60
58
  field_name: "country",
61
59
  }
62
60
  ];
63
- double rate = 4;
64
- string variant = 5;
65
- string type_id = 6 [
61
+ optional double rate = 4;
62
+ optional string variant = 5;
63
+ optional string type_id = 6 [
66
64
  (io.restorecommerce.options.resolver) = {
67
65
  target_type: ".io.restorecommerce.tax_type.TaxType",
68
66
  target_service: "resource",
@@ -72,3 +70,8 @@ message Tax {
72
70
  }
73
71
  ];
74
72
  }
73
+
74
+ message VAT {
75
+ optional string tax_id = 1;
76
+ optional double vat = 2;
77
+ }