@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
@@ -8,55 +8,52 @@ import "io/restorecommerce/auth.proto";
8
8
  import "io/restorecommerce/status.proto";
9
9
  import "io/restorecommerce/options.proto";
10
10
  import "io/restorecommerce/address.proto";
11
+ import "io/restorecommerce/tax.proto";
12
+ import "io/restorecommerce/country.proto";
11
13
  import "io/restorecommerce/fulfillment.proto";
14
+ import "io/restorecommerce/fulfillment_product.proto";
12
15
 
13
16
 
14
- service Service {
15
- option (io.restorecommerce.options.service_name) = "order";
16
-
17
+ service OrderService {
17
18
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (OrderListResponse) {
18
19
  option (io.restorecommerce.options.is_query) = true;
19
20
  };
20
21
  rpc Create (OrderList) returns (OrderListResponse);
21
22
  rpc Update (OrderList) returns (OrderListResponse);
22
23
  rpc Upsert (OrderList) returns (OrderListResponse);
24
+ rpc Evaluate (OrderList) returns (OrderListResponse);
23
25
  rpc Submit (OrderList) returns (OrderListResponse);
24
- rpc Cancel (CancelRequestList) returns (OrderListResponse);
26
+ rpc Withdraw (OrderIdList) returns (OrderListResponse);
27
+ rpc Cancel (OrderIdList) returns (OrderListResponse);
25
28
  rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
26
- rpc TriggerFulfillment (TriggerFulfillmentRequestList) returns (io.restorecommerce.status.Status);
29
+
30
+ // Requires Fulfillment Service
31
+ rpc QueryPackingSolution (FulfillmentRequestList) returns (io.restorecommerce.fulfillment_product.PackingSolutionListResponse);
32
+ // Requires Fulfillment Service
33
+ rpc CreateFulfillment (FulfillmentRequestList) returns (io.restorecommerce.fulfillment.FulfillmentListResponse);
34
+ // Requires Fulfillment Service
35
+ rpc TriggerFulfillment (FulfillmentRequestList) returns (io.restorecommerce.status.StatusListResponse);
27
36
  }
28
37
 
29
- enum State {
30
- Undefined = 0;
31
- Invalid = 1;
32
- Failed = 2;
33
- Cancelled = 3;
34
- Created = 4;
35
- Submitted = 5;
36
- Shipping = 6;
37
- Done = 7;
38
+ enum OrderState {
39
+ Created = 0;
40
+ Submitted = 1;
41
+ Confirmed = 2;
42
+ Invalid = 3;
43
+ Shipping = 4;
44
+ Failed = 5;
45
+ Done = 6;
46
+ Withdrawn = 7;
47
+ Cancelled = 8;
38
48
  }
39
49
 
40
- message Item {
41
- // below identifier is id of product, variant or bundle
42
- string product_variant_bundle_id = 1;
43
- string product_name = 2;
44
- string product_description = 3;
45
- string manufacturer_name = 4;
46
- string manufacturer_description = 5;
47
- string prototype_name = 6;
48
- string prototype_description = 7;
49
- int32 quantity = 8;
50
- int32 vat = 9;
51
- double price = 10;
52
- double quantity_price = 11;
53
- string item_type = 12;
54
- double taric_code = 13;
55
- string stock_keeping_unit = 14;
56
- double weight_in_kg = 15;
57
- int32 length_in_cm = 16;
58
- int32 width_in_cm = 17;
59
- int32 height_in_cm = 18;
50
+ message OrderItem {
51
+ optional string product_id = 1;
52
+ optional string variant_id = 2;
53
+ optional int32 quantity = 3;
54
+ optional double unit_price = 4; //Set by service
55
+ optional double price = 5; //Set by service
56
+ repeated io.restorecommerce.tax.VAT vats = 6; //Set by service
60
57
  }
61
58
 
62
59
  /**
@@ -71,45 +68,28 @@ message Order {
71
68
  deleted: "orderDeleted"
72
69
  };
73
70
 
74
- string id = 1;
75
- io.restorecommerce.meta.Meta meta = 2;
76
- string name = 3;
77
- string description = 4;
78
- State state = 5;
79
- string customer_reference = 6;
80
- repeated Item items = 7;
81
- double total_price = 8;
82
- io.restorecommerce.address.Address shipping_address = 11;
83
- io.restorecommerce.address.Address billing_address = 13;
84
- string billing_email = 14;
85
- io.restorecommerce.address.ContactPerson contact_person = 15;
86
- string notification_email = 16;
87
- repeated string fulfillment_ids = 17;
88
- }
89
-
90
- message ShippingDetails {
91
- string export_type = 1;
92
- string export_description = 2;
93
- string invoice_number = 3;
94
- io.restorecommerce.address.Address sender_address = 5;
95
- io.restorecommerce.address.ContactPerson contact_person = 15;
96
- }
97
-
98
- message TriggerFulfillmentRequest {
99
- Order order = 1;
100
- ShippingDetails shipping_details = 2;
101
- repeated io.restorecommerce.fulfillment.Parcel parcels = 3;
71
+ optional string id = 1;
72
+ optional io.restorecommerce.meta.Meta meta = 2;
73
+ optional OrderState state = 3;
74
+ optional string customer_reference = 4;
75
+ repeated OrderItem items = 5;
76
+ optional double total_price = 6; //Set by service
77
+ optional double total_vat = 7; //Set by service
78
+ optional io.restorecommerce.address.ShippingAddress shipping_address = 8;
79
+ optional io.restorecommerce.address.ShippingAddress billing_address = 9;
80
+ optional string billing_email = 10;
81
+ optional string notification_email = 11;
82
+ optional io.restorecommerce.fulfillment_product.Preferences packing_preferences = 12;
102
83
  }
103
84
 
104
- message TriggerFulfillmentRequestList {
105
- repeated TriggerFulfillmentRequest items = 1;
106
- uint32 total_count = 2;
107
- io.restorecommerce.auth.Subject subject = 3;
85
+ message OrderIdList {
86
+ repeated string ids = 1;
87
+ io.restorecommerce.auth.Subject subject = 2;
108
88
  }
109
89
 
110
90
  message OrderList {
111
91
  repeated Order items = 1;
112
- uint32 total_count = 2;
92
+ optional uint32 total_count = 2;
113
93
  io.restorecommerce.auth.Subject subject = 3;
114
94
  }
115
95
 
@@ -124,11 +104,24 @@ message OrderResponse {
124
104
  io.restorecommerce.status.Status status = 2;
125
105
  }
126
106
 
127
- message CancelRequestList {
128
- repeated string ids = 1;
129
- io.restorecommerce.auth.Subject subject = 2;
130
- }
131
-
132
107
  message Deleted {
133
108
  string id = 1;
109
+ }
110
+
111
+ message ShippingDetails {
112
+ optional string export_type = 1;
113
+ optional string export_description = 2;
114
+ optional string invoice_number = 3;
115
+ optional io.restorecommerce.address.ShippingAddress sender_address = 4;
116
+ }
117
+
118
+ message FulfillmentRequest {
119
+ optional string reference_id = 1;
120
+ optional ShippingDetails shipping_details = 2;
121
+ }
122
+
123
+ message FulfillmentRequestList {
124
+ repeated FulfillmentRequest items = 1;
125
+ optional uint32 total_count = 2;
126
+ io.restorecommerce.auth.Subject subject = 3;
134
127
  }
@@ -13,9 +13,7 @@ import "io/restorecommerce/options.proto";
13
13
  import "io/restorecommerce/address.proto";
14
14
  import "io/restorecommerce/contact_point.proto";
15
15
 
16
- service Service {
17
- option (io.restorecommerce.options.service_name) = "organization";
18
-
16
+ service OrganizationService {
19
17
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (OrganizationListResponse) {
20
18
  option (io.restorecommerce.options.is_query) = true;
21
19
  };
@@ -37,7 +35,7 @@ message DeleteOrgData {
37
35
 
38
36
  message OrganizationList {
39
37
  repeated Organization items = 1;
40
- uint32 total_count = 2;
38
+ optional uint32 total_count = 2;
41
39
  io.restorecommerce.auth.Subject subject = 3;
42
40
  }
43
41
 
@@ -53,9 +51,9 @@ message OrganizationResponse {
53
51
  }
54
52
 
55
53
  message Organization {
56
- string id = 1; /// Organization ID, unique, key
57
- io.restorecommerce.meta.Meta meta = 2;
58
- string address_id = 3 [
54
+ optional string id = 1; /// Organization ID, unique, key
55
+ optional io.restorecommerce.meta.Meta meta = 2;
56
+ optional string address_id = 3 [
59
57
  (io.restorecommerce.options.resolver) = {
60
58
  target_type: ".io.restorecommerce.address.Address",
61
59
  target_service: "resource",
@@ -64,7 +62,7 @@ message Organization {
64
62
  field_name: "address",
65
63
  }
66
64
  ]; /// Address for the organization
67
- string parent_id = 4 [
65
+ optional string parent_id = 4 [
68
66
  (io.restorecommerce.options.resolver) = {
69
67
  target_type: ".io.restorecommerce.organization.Organization",
70
68
  target_service: "resource",
@@ -82,14 +80,14 @@ message Organization {
82
80
  field_name: "contactPoints",
83
81
  }
84
82
  ]; // list of possible legal addresses of different types
85
- string website = 7;
86
- string email = 8;
87
- string logo = 9; // base64; arangoDB does not support blob storage
88
- string vat_id = 10;
89
- string isic_v4 = 11;
90
- string registration = 12;
91
- string registration_court = 13;
92
- string name = 14;
83
+ optional string website = 7;
84
+ optional string email = 8;
85
+ optional string logo = 9; // base64; arangoDB does not support blob storage
86
+ optional string vat_id = 10;
87
+ optional string isic_v4 = 11;
88
+ optional string registration = 12;
89
+ optional string registration_court = 13;
90
+ optional string name = 14;
93
91
  repeated string payment_method_ids = 15;
94
- google.protobuf.Any data = 16; /// additional data
92
+ optional google.protobuf.Any data = 16; /// additional data
95
93
  }
@@ -11,9 +11,7 @@ import "io/restorecommerce/status.proto";
11
11
  import "io/restorecommerce/resource_base.proto";
12
12
  import "io/restorecommerce/options.proto";
13
13
 
14
- service Service {
15
- option (io.restorecommerce.options.service_name) = "object";
16
-
14
+ service ObjectService {
17
15
  rpc Get (GetRequest) returns (stream ObjectResponse) {
18
16
  option (io.restorecommerce.options.is_query) = true;
19
17
  };
@@ -32,7 +30,7 @@ message CopyRequestList {
32
30
  }
33
31
 
34
32
  message CopyResponseList {
35
- repeated copyResponsePayloadWithStatus response = 1;
33
+ repeated copyResponsePayloadWithStatus responses = 1;
36
34
  io.restorecommerce.status.OperationStatus operation_status = 2;
37
35
  }
38
36
 
@@ -45,8 +43,8 @@ message CopyRequestItem {
45
43
  string bucket = 1;
46
44
  string copySource = 2;
47
45
  string key = 3;
48
- io.restorecommerce.meta.Meta meta = 4;
49
- Options options = 5;
46
+ optional io.restorecommerce.meta.Meta meta = 4;
47
+ optional Options options = 5;
50
48
  }
51
49
 
52
50
  message CopyResponseItem {
@@ -58,24 +56,24 @@ message CopyResponseItem {
58
56
  }
59
57
 
60
58
  message Options {
61
- string encoding = 1;
62
- string content_type = 2;
63
- string content_language = 3;
64
- string content_disposition = 4;
65
- int32 length = 5;
66
- string version = 6;
67
- string md5 = 7;
59
+ optional string encoding = 1;
60
+ optional string content_type = 2;
61
+ optional string content_language = 3;
62
+ optional string content_disposition = 4;
63
+ optional int32 length = 5;
64
+ optional string version = 6;
65
+ optional string md5 = 7;
68
66
  repeated io.restorecommerce.attribute.Attribute tags = 8;
69
- google.protobuf.Any data = 9; // optional meta data ex: from and to dates
67
+ optional google.protobuf.Any data = 9; // optional meta data ex: from and to dates
70
68
  }
71
69
 
72
70
  message Object {
73
71
  string key = 1;
74
72
  string bucket = 2;
75
- bytes object = 3;
76
- io.restorecommerce.meta.Meta meta = 4;
77
- string url = 5;
78
- Options options = 6;
73
+ optional bytes object = 3;
74
+ optional io.restorecommerce.meta.Meta meta = 4;
75
+ optional string url = 5;
76
+ optional Options options = 6;
79
77
  io.restorecommerce.auth.Subject subject = 7;
80
78
  }
81
79
 
@@ -101,12 +99,12 @@ message ObjectResponsePayload {
101
99
  message GetRequest {
102
100
  string key = 1;
103
101
  string bucket = 2;
104
- bool download = 3;
102
+ optional bool download = 3;
105
103
  io.restorecommerce.auth.Subject subject = 4;
106
104
  }
107
105
 
108
106
  message ListResponse {
109
- repeated ObjectsDataWithPayloadStatus response = 1;
107
+ repeated ObjectsDataWithPayloadStatus responses = 1;
110
108
  io.restorecommerce.status.OperationStatus operation_status = 2;
111
109
  }
112
110
 
@@ -148,19 +146,19 @@ message Response {
148
146
 
149
147
  message ListRequest {
150
148
  string bucket = 1;
151
- io.restorecommerce.filter.FilterOp filters = 2; /// Filter based on fieldName|operation, value|list
149
+ optional io.restorecommerce.filter.FilterOp filters = 2; /// Filter based on fieldName|operation, value|list
152
150
  io.restorecommerce.auth.Subject subject = 3;
153
- int32 max_keys = 4;
154
- string prefix = 5;
151
+ optional int32 max_keys = 4;
152
+ optional string prefix = 5;
155
153
  }
156
154
 
157
155
  // OstorageMessage is used for emitting
158
156
  // objectUploaded and objectDownloaded events
159
157
  message OstorageMessage {
160
- string key = 1;
161
- string bucket = 2;
162
- google.protobuf.Any metadata = 3;
163
- io.restorecommerce.auth.Subject subject = 4;
158
+ optional string key = 1;
159
+ optional string bucket = 2;
160
+ optional google.protobuf.Any metadata = 3;
161
+ optional io.restorecommerce.auth.Subject subject = 4;
164
162
  }
165
163
 
166
164
  message MoveRequestList {
@@ -169,15 +167,15 @@ message MoveRequestList {
169
167
  }
170
168
 
171
169
  message MoveRequestItem {
172
- string bucket = 1; // destination bucket name
173
- string sourceObject = 2; // source object with bucket name
174
- string key = 3; // destination key name
175
- io.restorecommerce.meta.Meta meta = 4;
176
- Options options = 5;
170
+ optional string bucket = 1; // destination bucket name
171
+ optional string sourceObject = 2; // source object with bucket name
172
+ optional string key = 3; // destination key name
173
+ optional io.restorecommerce.meta.Meta meta = 4;
174
+ optional Options options = 5;
177
175
  }
178
176
 
179
177
  message MoveResponseList {
180
- repeated MoveResponsePayloadWithStatus response = 1;
178
+ repeated MoveResponsePayloadWithStatus responses = 1;
181
179
  io.restorecommerce.status.OperationStatus operation_status = 2;
182
180
  }
183
181
 
@@ -4,9 +4,7 @@ import "io/restorecommerce/auth.proto";
4
4
  import "io/restorecommerce/status.proto";
5
5
  import "io/restorecommerce/options.proto";
6
6
 
7
- service Service {
8
- option (io.restorecommerce.options.service_name) = "payment";
9
-
7
+ service PaymentService {
10
8
  // Wrapper for setup_authorization in ActiveMerchant
11
9
  rpc SetupAuthorization (SetupRequest) returns (SetupResponse);
12
10
 
@@ -25,18 +23,18 @@ service Service {
25
23
 
26
24
  // Request object for setup calls
27
25
  message SetupRequest {
28
- string ip = 1;
26
+ optional string ip = 1;
29
27
  repeated Item items = 2;
30
- int32 subtotal = 3;
31
- int32 shipping = 4;
32
- int32 handling = 5;
33
- int32 tax = 6;
34
- string currency = 7;
35
- string return_url = 8;
36
- string cancel_return_url = 9;
37
- bool allow_guest_checkout = 10;
38
- Provider provider = 11;
39
- io.restorecommerce.auth.Subject subject = 12;
28
+ optional int32 subtotal = 3;
29
+ optional int32 shipping = 4;
30
+ optional int32 handling = 5;
31
+ optional int32 tax = 6;
32
+ optional string currency = 7;
33
+ optional string return_url = 8;
34
+ optional string cancel_return_url = 9;
35
+ optional bool allow_guest_checkout = 10;
36
+ optional Provider provider = 11;
37
+ optional io.restorecommerce.auth.Subject subject = 12;
40
38
  }
41
39
 
42
40
  message SetupPayload {
@@ -58,21 +56,21 @@ message SetupResponse {
58
56
 
59
57
  // Request object for authorization or purchase call for cardless payment.
60
58
  message PaymentRequest {
61
- Provider provider = 1;
62
- int32 payment_sum = 2;
63
- string currency = 3;
64
- string payment_id = 4;
65
- string payer_id = 5;
66
- string token = 6;
59
+ optional Provider provider = 1;
60
+ optional int32 payment_sum = 2;
61
+ optional string currency = 3;
62
+ optional string payment_id = 4;
63
+ optional string payer_id = 5;
64
+ optional string token = 6;
67
65
  io.restorecommerce.auth.Subject subject = 7;
68
66
  }
69
67
 
70
68
  // Request object for capture call for both standard and cardless payments.
71
69
  message CaptureRequest {
72
- Provider provider = 1;
73
- int32 payment_sum = 2;
74
- string currency = 3;
75
- string payment_id = 4;
70
+ optional Provider provider = 1;
71
+ optional int32 payment_sum = 2;
72
+ optional string currency = 3;
73
+ optional string payment_id = 4;
76
74
  io.restorecommerce.auth.Subject subject = 5;
77
75
  }
78
76
 
@@ -95,20 +93,20 @@ message PaymentResponse {
95
93
 
96
94
  // Used for building ActiveMerchant::Billing::CreditCard instance.
97
95
  message PaymentCard {
98
- string primary_number = 1;
99
- string first_name = 2;
100
- string last_name = 3;
101
- string month = 4;
102
- int32 year = 5;
103
- string verification_value = 6;
96
+ optional string primary_number = 1;
97
+ optional string first_name = 2;
98
+ optional string last_name = 3;
99
+ optional string month = 4;
100
+ optional int32 year = 5;
101
+ optional string verification_value = 6;
104
102
  }
105
103
 
106
104
  // Represents purchased item. Not all providers support this.
107
105
  message Item {
108
- string name = 1;
109
- string description = 2;
110
- int32 quantity = 3;
111
- int32 amount = 4;
106
+ optional string name = 1;
107
+ optional string description = 2;
108
+ optional int32 quantity = 3;
109
+ optional int32 amount = 4;
112
110
  }
113
111
 
114
112
  // Possible service providers. Provider names must be exactly as in config.yml.
@@ -11,7 +11,7 @@ import "io/restorecommerce/status.proto";
11
11
  /*
12
12
  * Microservice definition.
13
13
  */
14
- service Service {
14
+ service PaymentMethodService {
15
15
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (PaymentMethodListResponse);
16
16
  rpc Create (PaymentMethodList) returns (PaymentMethodListResponse);
17
17
  rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
@@ -25,7 +25,7 @@ message Deleted {
25
25
 
26
26
  message PaymentMethodList {
27
27
  repeated PaymentMethod items = 1;
28
- uint32 total_count = 2;
28
+ optional uint32 total_count = 2;
29
29
  io.restorecommerce.auth.Subject subject = 3;
30
30
  }
31
31
 
@@ -52,9 +52,9 @@ enum TransferTypeEnum {
52
52
  }
53
53
 
54
54
  message PaymentMethod {
55
- string id = 1;
56
- io.restorecommerce.meta.Meta meta = 2;
57
- PaymentMethodEnum payment_method = 3;
58
- TransferTypeEnum transfer_type = 4;
59
- google.protobuf.Any data = 5;
55
+ optional string id = 1;
56
+ optional io.restorecommerce.meta.Meta meta = 2;
57
+ optional PaymentMethodEnum payment_method = 3;
58
+ optional TransferTypeEnum transfer_type = 4;
59
+ optional google.protobuf.Any data = 5;
60
60
  }
@@ -13,30 +13,30 @@ import "io/restorecommerce/options.proto";
13
13
  * A Policy is defined by a set of Rules.
14
14
  */
15
15
  message Policy {
16
- string id = 1;
17
- io.restorecommerce.meta.Meta meta = 2;
18
- string name = 3;
19
- string description = 4;
16
+ optional string id = 1;
17
+ optional io.restorecommerce.meta.Meta meta = 2;
18
+ optional string name = 3;
19
+ optional string description = 4;
20
20
  repeated string rules = 5; // rule IDs
21
- io.restorecommerce.rule.Target target = 6; // general policy target
22
- io.restorecommerce.rule.Effect effect = 7;
23
- string combining_algorithm = 8;
24
- bool evaluation_cacheable = 9;
21
+ optional io.restorecommerce.rule.Target target = 6; // general policy target
22
+ optional io.restorecommerce.rule.Effect effect = 7;
23
+ optional string combining_algorithm = 8;
24
+ optional bool evaluation_cacheable = 9;
25
25
  }
26
26
 
27
27
  message PolicyRQ {
28
- string id = 1;
29
- io.restorecommerce.rule.Target target = 2;
30
- string combining_algorithm = 3;
28
+ optional string id = 1;
29
+ optional io.restorecommerce.rule.Target target = 2;
30
+ optional string combining_algorithm = 3;
31
31
  repeated io.restorecommerce.rule.RuleRQ rules = 4;
32
- io.restorecommerce.rule.Effect effect = 5;
33
- bool has_rules = 6;
34
- bool evaluation_cacheable = 7;
32
+ optional io.restorecommerce.rule.Effect effect = 5;
33
+ optional bool has_rules = 6;
34
+ optional bool evaluation_cacheable = 7;
35
35
  }
36
36
 
37
37
  message PolicyList {
38
38
  repeated Policy items = 1;
39
- uint32 total_count = 2;
39
+ optional uint32 total_count = 2;
40
40
  io.restorecommerce.auth.Subject subject = 3;
41
41
  }
42
42
 
@@ -51,9 +51,7 @@ message PolicyResponse {
51
51
  io.restorecommerce.status.Status status = 2;
52
52
  }
53
53
 
54
- service Service {
55
- option (io.restorecommerce.options.service_name) = "policy";
56
-
54
+ service PolicyService {
57
55
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (PolicyListResponse) {
58
56
  option (io.restorecommerce.options.is_query) = true;
59
57
  };
@@ -11,18 +11,18 @@ import "io/restorecommerce/status.proto";
11
11
  import "io/restorecommerce/options.proto";
12
12
 
13
13
  message PolicySet {
14
- string id = 1;
15
- io.restorecommerce.meta.Meta meta = 2;
16
- string name = 3;
17
- string description = 4;
18
- io.restorecommerce.rule.Target target = 5;
19
- string combining_algorithm = 6;
14
+ optional string id = 1;
15
+ optional io.restorecommerce.meta.Meta meta = 2;
16
+ optional string name = 3;
17
+ optional string description = 4;
18
+ optional io.restorecommerce.rule.Target target = 5;
19
+ optional string combining_algorithm = 6;
20
20
  repeated string policies = 7; // policy IDs
21
21
  }
22
22
 
23
23
  message PolicySetList {
24
24
  repeated PolicySet items = 1;
25
- uint32 total_count = 2;
25
+ optional uint32 total_count = 2;
26
26
  io.restorecommerce.auth.Subject subject = 3;
27
27
  }
28
28
 
@@ -38,16 +38,14 @@ message PolicySetResponse {
38
38
  }
39
39
 
40
40
  message PolicySetRQ {
41
- string id = 1;
42
- io.restorecommerce.rule.Target target = 2;
43
- string combining_algorithm = 3;
41
+ optional string id = 1;
42
+ optional io.restorecommerce.rule.Target target = 2;
43
+ optional string combining_algorithm = 3;
44
44
  repeated io.restorecommerce.policy.PolicyRQ policies = 4;
45
- io.restorecommerce.rule.Effect effect = 5;
45
+ optional io.restorecommerce.rule.Effect effect = 5;
46
46
  }
47
47
 
48
- service Service {
49
- option (io.restorecommerce.options.service_name) = "policy_set";
50
-
48
+ service PolicySetService {
51
49
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (PolicySetListResponse) {
52
50
  option (io.restorecommerce.options.is_query) = true;
53
51
  };
@@ -10,15 +10,15 @@ import "io/restorecommerce/options.proto";
10
10
 
11
11
  // PriceGroup resource
12
12
  message PriceGroup {
13
- string id = 1;
14
- io.restorecommerce.meta.Meta meta = 2;
15
- string name = 3;
16
- string description = 4;
13
+ optional string id = 1;
14
+ optional io.restorecommerce.meta.Meta meta = 2;
15
+ optional string name = 3;
16
+ optional string description = 4;
17
17
  }
18
18
 
19
19
  message PriceGroupList {
20
20
  repeated PriceGroup items = 1;
21
- uint32 total_count = 2;
21
+ optional uint32 total_count = 2;
22
22
  io.restorecommerce.auth.Subject subject = 3;
23
23
  }
24
24
 
@@ -37,9 +37,7 @@ message Deleted {
37
37
  string id = 1;
38
38
  }
39
39
 
40
- service Service {
41
- option (io.restorecommerce.options.service_name) = "price_group";
42
-
40
+ service PriceGroupService {
43
41
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (PriceGroupListResponse) {
44
42
  option (io.restorecommerce.options.is_query) = true;
45
43
  };