@restorecommerce/protos 2.0.1 → 3.0.0

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 (53) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/google/protobuf/timestamp.proto +147 -0
  3. package/io/restorecommerce/access_control.proto +1 -3
  4. package/io/restorecommerce/address.proto +38 -37
  5. package/io/restorecommerce/attribute.proto +3 -3
  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 +4 -3
  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/fulfillment.proto +87 -104
  17. package/io/restorecommerce/fulfillment_courier.proto +15 -17
  18. package/io/restorecommerce/fulfillment_product.proto +44 -47
  19. package/io/restorecommerce/geometry.proto +23 -0
  20. package/io/restorecommerce/graph.proto +10 -10
  21. package/io/restorecommerce/image.proto +13 -12
  22. package/io/restorecommerce/invoice.proto +47 -49
  23. package/io/restorecommerce/job.proto +43 -45
  24. package/io/restorecommerce/locale.proto +6 -8
  25. package/io/restorecommerce/location.proto +11 -13
  26. package/io/restorecommerce/manufacturer.proto +6 -8
  27. package/io/restorecommerce/meta.proto +3 -3
  28. package/io/restorecommerce/notification.proto +8 -10
  29. package/io/restorecommerce/notification_channel.proto +6 -6
  30. package/io/restorecommerce/notification_req.proto +16 -16
  31. package/io/restorecommerce/oauth.proto +1 -1
  32. package/io/restorecommerce/order.proto +65 -72
  33. package/io/restorecommerce/organization.proto +15 -17
  34. package/io/restorecommerce/ostorage.proto +28 -30
  35. package/io/restorecommerce/payment.proto +32 -34
  36. package/io/restorecommerce/payment_method.proto +7 -7
  37. package/io/restorecommerce/policy.proto +16 -18
  38. package/io/restorecommerce/policy_set.proto +12 -14
  39. package/io/restorecommerce/price_group.proto +6 -8
  40. package/io/restorecommerce/product.proto +146 -48
  41. package/io/restorecommerce/product_category.proto +10 -12
  42. package/io/restorecommerce/product_prototype.proto +8 -10
  43. package/io/restorecommerce/resource_base.proto +15 -15
  44. package/io/restorecommerce/role.proto +6 -8
  45. package/io/restorecommerce/rule.proto +18 -20
  46. package/io/restorecommerce/search.proto +3 -5
  47. package/io/restorecommerce/status.proto +13 -8
  48. package/io/restorecommerce/tax.proto +13 -10
  49. package/io/restorecommerce/tax_type.proto +13 -9
  50. package/io/restorecommerce/timezone.proto +5 -7
  51. package/io/restorecommerce/token.proto +11 -13
  52. package/io/restorecommerce/user.proto +45 -48
  53. package/package.json +2 -2
@@ -13,15 +13,13 @@ import "io/restorecommerce/options.proto";
13
13
  Microservice defination
14
14
  */
15
15
 
16
- service Service {
17
- option (io.restorecommerce.options.service_name) = "fulfillment_courier";
18
-
19
- rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentCourierResponseList) {
16
+ service FulfillmentCourierService {
17
+ rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentCourierListResponse) {
20
18
  option (io.restorecommerce.options.is_query) = true;
21
19
  };
22
- rpc Create (FulfillmentCourierList) returns (FulfillmentCourierResponseList);
23
- rpc Update (FulfillmentCourierList) returns (FulfillmentCourierResponseList);
24
- rpc Upsert (FulfillmentCourierList) returns (FulfillmentCourierResponseList);
20
+ rpc Create (FulfillmentCourierList) returns (FulfillmentCourierListResponse);
21
+ rpc Update (FulfillmentCourierList) returns (FulfillmentCourierListResponse);
22
+ rpc Upsert (FulfillmentCourierList) returns (FulfillmentCourierListResponse);
25
23
  rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
26
24
  }
27
25
 
@@ -34,19 +32,19 @@ message FulfillmentCourier {
34
32
  deleted: "fulfillmentCourierDeleted"
35
33
  };
36
34
 
37
- string id = 1;
38
- string name = 4;
39
- string description = 5;
40
- string logo = 6;
41
- string website = 7;
42
- string stub_type = 8;
43
- google.protobuf.Any configuration = 10;
44
- io.restorecommerce.meta.Meta meta = 11;
35
+ optional string id = 1;
36
+ optional string name = 4;
37
+ optional string description = 5;
38
+ optional string logo = 6;
39
+ optional string website = 7;
40
+ optional string stub_type = 8;
41
+ optional google.protobuf.Any configuration = 10;
42
+ optional io.restorecommerce.meta.Meta meta = 11;
45
43
  }
46
44
 
47
45
  message FulfillmentCourierList {
48
46
  repeated FulfillmentCourier items = 1;
49
- uint32 total_count = 2;
47
+ optional uint32 total_count = 2;
50
48
  io.restorecommerce.auth.Subject subject = 3;
51
49
  }
52
50
 
@@ -55,7 +53,7 @@ message FulfillmentCourierResponse {
55
53
  io.restorecommerce.status.Status status = 2;
56
54
  }
57
55
 
58
- message FulfillmentCourierResponseList {
56
+ message FulfillmentCourierListResponse {
59
57
  repeated FulfillmentCourierResponse items = 1;
60
58
  uint32 total_count = 2;
61
59
  io.restorecommerce.status.OperationStatus operation_status = 3;
@@ -7,6 +7,9 @@ import "io/restorecommerce/meta.proto";
7
7
  import "io/restorecommerce/auth.proto";
8
8
  import "io/restorecommerce/status.proto";
9
9
  import "io/restorecommerce/attribute.proto";
10
+ import "io/restorecommerce/address.proto";
11
+ import "io/restorecommerce/tax.proto";
12
+ import "io/restorecommerce/geometry.proto";
10
13
  import "io/restorecommerce/fulfillment_courier.proto";
11
14
  import "io/restorecommerce/fulfillment.proto";
12
15
  import "io/restorecommerce/options.proto";
@@ -15,55 +18,51 @@ import "io/restorecommerce/options.proto";
15
18
  Microservice defination
16
19
  */
17
20
 
18
- service Service {
19
- option (io.restorecommerce.options.service_name) = "fulfillment_product";
20
-
21
- rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentProductResponseList) {
21
+ service FulfillmentProductService {
22
+ rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentProductListResponse) {
22
23
  option (io.restorecommerce.options.is_query) = true;
23
24
  };
24
- rpc Find (QueryList) returns (PackingSolutionResponseList) {
25
+ rpc Find (ProductQueryList) returns (PackingSolutionListResponse) {
25
26
  option (io.restorecommerce.options.is_query) = true;
26
27
  };
27
- rpc Create (FulfillmentProductList) returns (FulfillmentProductResponseList);
28
- rpc Update (FulfillmentProductList) returns (FulfillmentProductResponseList);
29
- rpc Upsert (FulfillmentProductList) returns (FulfillmentProductResponseList);
28
+ rpc Create (FulfillmentProductList) returns (FulfillmentProductListResponse);
29
+ rpc Update (FulfillmentProductList) returns (FulfillmentProductListResponse);
30
+ rpc Upsert (FulfillmentProductList) returns (FulfillmentProductListResponse);
30
31
  rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
31
32
  }
32
33
 
33
34
  message Preferences {
34
35
  repeated io.restorecommerce.attribute.Attribute couriers = 1; //ID, name or type
35
- float pricing = 2;
36
- float compactness = 3;
37
- float homogeneity = 4;
36
+ repeated io.restorecommerce.attribute.Attribute options = 2;
38
37
  }
39
38
 
40
- message Query {
41
- // io.restorecommerce.fulfillment.Address sender = 1;
42
- // io.restorecommerce.fulfillment.Address receiver = 2;
43
- repeated io.restorecommerce.fulfillment.Item goods = 3;
44
- Preferences preferences = 4;
45
- string reference_id = 5;
39
+ message ProductQuery {
40
+ optional io.restorecommerce.address.ShippingAddress sender = 1;
41
+ optional io.restorecommerce.address.ShippingAddress receiver = 2;
42
+ repeated io.restorecommerce.fulfillment.FulfillmentItem items = 3;
43
+ optional Preferences preferences = 4;
44
+ optional string reference_id = 5;
46
45
  }
47
46
 
48
- message QueryList {
49
- repeated Query items = 1;
50
- uint32 total_count = 2;
47
+ message ProductQueryList {
48
+ repeated ProductQuery items = 1;
49
+ optional uint32 total_count = 2;
51
50
  io.restorecommerce.auth.Subject subject = 3;
52
51
  }
53
52
 
54
53
  message FulfillmentProduct {
55
54
  option (restorecommerce.options.kafka_subscriber) = {
56
- plural: "fulfillmentProduct"
55
+ plural: "fulfillment_products"
57
56
  topic: "io.restorecommerce.fulfillment_product.resource"
58
57
  created: "fulfillmentProductCreated"
59
58
  updated: "fulfillmentProductUpdated"
60
59
  deleted: "fulfillmentProductDeleted"
61
60
  };
62
61
 
63
- string id = 1;
64
- string name = 2;
65
- string description = 3;
66
- string courier_id = 4 [
62
+ optional string id = 1;
63
+ optional string name = 2;
64
+ optional string description = 3;
65
+ optional string courier_id = 4 [
67
66
  (io.restorecommerce.options.resolver) = {
68
67
  target_type: ".io.restorecommerce.fulfillment_courier.FulfillmentCourier",
69
68
  target_service: "resource",
@@ -77,24 +76,21 @@ message FulfillmentProduct {
77
76
  repeated string tax_ids = 9;
78
77
  repeated io.restorecommerce.attribute.Attribute attributes = 10;
79
78
  repeated Variant variants = 11;
80
- io.restorecommerce.meta.Meta meta = 12;
79
+ optional io.restorecommerce.meta.Meta meta = 12;
81
80
  }
82
81
 
83
82
  message Variant {
84
- string id = 1;
85
- string name = 2;
86
- string description = 3;
87
- double price = 4;
88
- double max_weight = 5;
89
- double max_width = 6;
90
- double max_height = 7;
91
- double max_length = 8;
92
- double max_volume = 9;
83
+ optional string id = 1;
84
+ optional string name = 2;
85
+ optional string description = 3;
86
+ optional double price = 4;
87
+ optional io.restorecommerce.geometry.BoundingBox3D max_size = 6;
88
+ optional double max_weight = 7;
93
89
  }
94
90
 
95
91
  message FulfillmentProductList {
96
92
  repeated FulfillmentProduct items = 1;
97
- uint32 total_count = 2;
93
+ optional uint32 total_count = 2;
98
94
  io.restorecommerce.auth.Subject subject = 3;
99
95
  }
100
96
 
@@ -103,29 +99,30 @@ message FulfillmentProductResponse {
103
99
  io.restorecommerce.status.Status status = 2;
104
100
  }
105
101
 
106
- message FulfillmentProductResponseList {
102
+ message FulfillmentProductListResponse {
107
103
  repeated FulfillmentProductResponse items = 1;
108
104
  uint32 total_count = 2;
109
105
  io.restorecommerce.status.OperationStatus operation_status = 3;
110
106
  }
111
107
 
112
108
  message PackingSolution {
113
- string reference_id = 1;
114
- float price = 2;
115
- float compactness = 3;
116
- float homogeneity = 4;
117
- float score = 5;
118
- repeated io.restorecommerce.fulfillment.Parcel parcels = 6;
109
+ optional double price = 1;
110
+ optional double compactness = 2;
111
+ optional double homogeneity = 3;
112
+ optional double score = 4;
113
+ repeated io.restorecommerce.fulfillment.Parcel parcels = 5;
114
+ repeated io.restorecommerce.tax.VAT vats = 6;
119
115
  }
120
116
 
121
117
  message PackingSolutionResponse {
122
- repeated PackingSolution solutions = 1;
123
- io.restorecommerce.status.Status status = 2;
118
+ optional string reference_id = 1;
119
+ repeated PackingSolution solutions = 2;
120
+ optional io.restorecommerce.status.Status status = 3;
124
121
  }
125
122
 
126
- message PackingSolutionResponseList {
123
+ message PackingSolutionListResponse {
127
124
  repeated PackingSolutionResponse items = 1;
128
- uint32 total_count = 2;
125
+ optional uint32 total_count = 2;
129
126
  io.restorecommerce.status.OperationStatus operation_status = 3;
130
127
  }
131
128
 
@@ -0,0 +1,23 @@
1
+ syntax = "proto3";
2
+
3
+ package io.restorecommerce.geometry;
4
+
5
+ import "io/restorecommerce/options.proto";
6
+
7
+
8
+ message Vector3D {
9
+ optional double x = 1;
10
+ optional double y = 2;
11
+ optional double z = 3;
12
+ }
13
+
14
+ message BoundingBox3D {
15
+ optional double width = 1;
16
+ optional double height = 2;
17
+ optional double length = 3;
18
+ }
19
+
20
+ message OriginBoundingBox {
21
+ optional Vector3D origin = 1;
22
+ optional BoundingBox3D bbox = 2;
23
+ }
@@ -7,7 +7,7 @@ import "io/restorecommerce/status.proto";
7
7
  import "io/restorecommerce/resource_base.proto";
8
8
 
9
9
  // Service provides the CRUD operations
10
- service Service {
10
+ service GraphService {
11
11
  rpc Traversal (TraversalRequest) returns (stream TraversalResponse);
12
12
  }
13
13
 
@@ -17,8 +17,8 @@ message TraversalRequest {
17
17
  Vertices vertices = 1;
18
18
  Collection collection = 2;
19
19
  }
20
- Options opts = 3;
21
- bool path = 4;
20
+ optional Options opts = 3;
21
+ optional bool path = 4;
22
22
  io.restorecommerce.auth.Subject subject = 5;
23
23
  repeated Filters filters = 6;
24
24
  }
@@ -49,18 +49,18 @@ message Options {
49
49
 
50
50
 
51
51
  message Filters {
52
- string entity = 1; // entity on which the filters are applied
53
- string edge = 2; // if edge is specified depending on the direction filter are applied only for those entities
52
+ optional string entity = 1; // entity on which the filters are applied
53
+ optional string edge = 2; // if edge is specified depending on the direction filter are applied only for those entities
54
54
  repeated Filter filter = 3;
55
55
  enum Operator {
56
56
  and = 0;
57
57
  or = 1;
58
58
  }
59
- Operator operator = 4;
59
+ optional Operator operator = 4;
60
60
  }
61
61
 
62
62
  message Filter {
63
- string field = 1;
63
+ optional string field = 1;
64
64
  enum Operation {
65
65
  eq = 0;
66
66
  lt = 1;
@@ -72,8 +72,8 @@ message Filter {
72
72
  in = 7;
73
73
  neq = 8;
74
74
  }
75
- Operation operation = 2;
76
- string value = 3;
75
+ optional Operation operation = 2;
76
+ optional string value = 3;
77
77
  enum ValueType {
78
78
  STRING = 0; // default value type if not specified
79
79
  NUMBER = 1;
@@ -81,7 +81,7 @@ message Filter {
81
81
  DATE = 3;
82
82
  ARRAY = 4;
83
83
  }
84
- ValueType type = 4;
84
+ optional ValueType type = 4;
85
85
  repeated Filters filters = 5;
86
86
  }
87
87
 
@@ -2,23 +2,24 @@ syntax = "proto3";
2
2
 
3
3
  package io.restorecommerce.image;
4
4
 
5
- // ProductCategory resource
6
5
  message Image {
7
- string id = 1;
8
- string caption = 2;
9
- string filename = 3;
10
- string content_type = 4;
11
- string url = 5;
12
- double width = 6;
13
- double height = 7;
14
- double length = 8;
6
+ optional string id = 1;
7
+ optional string caption = 2;
8
+ optional string filename = 3;
9
+ optional string content_type = 4;
10
+ optional string url = 5;
11
+ optional double width = 6;
12
+ optional double height = 7;
13
+ optional double length = 8;
14
+ repeated string tags = 9;
15
+ optional int64 index = 10;
15
16
  }
16
17
 
17
18
  message ImageList {
18
- repeated Image items = 1;
19
- uint32 total_count = 2;
19
+ repeated Image items = 1;
20
+ optional uint32 total_count = 2;
20
21
  }
21
22
 
22
23
  message Deleted {
23
- string id = 1;
24
+ string id = 1;
24
25
  }
@@ -16,9 +16,7 @@ import "io/restorecommerce/customer.proto";
16
16
  /*
17
17
  * Microservice definition.
18
18
  */
19
- service Service {
20
- option (io.restorecommerce.options.service_name) = "invoice";
21
-
19
+ service InvoiceService {
22
20
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (InvoiceListResponse) {
23
21
  option (io.restorecommerce.options.is_query) = true;
24
22
  };
@@ -47,7 +45,7 @@ message Deleted {
47
45
  */
48
46
  message InvoiceList {
49
47
  repeated Invoice items = 1;
50
- uint32 total_count = 2;
48
+ optional uint32 total_count = 2;
51
49
  io.restorecommerce.auth.Subject subject = 3;
52
50
  }
53
51
 
@@ -66,10 +64,10 @@ message InvoiceResponse {
66
64
  * A simple invoice.
67
65
  */
68
66
  message Invoice {
69
- string id = 1;
70
- io.restorecommerce.meta.Meta meta = 2;
71
- string timestamp = 4;
72
- string customer_id = 5 [
67
+ optional string id = 1;
68
+ optional io.restorecommerce.meta.Meta meta = 2;
69
+ optional string timestamp = 4;
70
+ optional string customer_id = 5 [
73
71
  (io.restorecommerce.options.resolver) = {
74
72
  target_type: ".io.restorecommerce.customer.Customer",
75
73
  target_service: "resource",
@@ -78,13 +76,13 @@ message Invoice {
78
76
  field_name: "customer",
79
77
  }
80
78
  ];
81
- string payment_status = 6;
82
- double total_amount = 7;
83
- double net_amount = 8;
84
- double vat_amount = 9; // difference between net and total
85
- string document = 10;
86
- string invoice_number = 11;
87
- string customer_remark = 12;
79
+ optional string payment_status = 6;
80
+ optional double total_amount = 7;
81
+ optional double net_amount = 8;
82
+ optional double vat_amount = 9; // difference between net and total
83
+ optional string document = 10;
84
+ optional string invoice_number = 11;
85
+ optional string customer_remark = 12;
88
86
  }
89
87
 
90
88
  /**
@@ -95,57 +93,57 @@ message InvoicesPositionsData {
95
93
  }
96
94
 
97
95
  message InvoicePositions {
98
- string id = 1; // contract or customer identifier
96
+ optional string id = 1; // contract or customer identifier
99
97
  repeated InvoicePosition invoice_positions = 2;
100
- RecipientCustomer recipient_customer = 3;
101
- BillingAddress recipient_billing_address = 4;
102
- BillingAddress sender_billing_address = 5;
103
- io.restorecommerce.organization.Organization recipient_organization = 6;
104
- io.restorecommerce.organization.Organization sender_organization = 7;
105
- google.protobuf.Any payment_method_details = 8;
106
- string invoice_no = 9; // optional invoice number if not it will be generated by service
107
- double from_date = 10; // value performance from date
108
- double to_date = 11; // value performance to date
98
+ optional RecipientCustomer recipient_customer = 3;
99
+ optional BillingAddress recipient_billing_address = 4;
100
+ optional BillingAddress sender_billing_address = 5;
101
+ optional io.restorecommerce.organization.Organization recipient_organization = 6;
102
+ optional io.restorecommerce.organization.Organization sender_organization = 7;
103
+ optional google.protobuf.Any payment_method_details = 8;
104
+ optional string invoice_no = 9; // optional invoice number if not it will be generated by service
105
+ optional double from_date = 10; // value performance from date
106
+ optional double to_date = 11; // value performance to date
109
107
  }
110
108
 
111
109
  message RecipientCustomer {
112
- string id = 1; // customer id - used to store the resource in DB
113
- string customer_number = 2; // displayed in invoice
110
+ optional string id = 1; // customer id - used to store the resource in DB
111
+ optional string customer_number = 2; // displayed in invoice
114
112
  }
115
113
 
116
114
  message BillingAddress {
117
- string email = 1;
118
- string website = 2;
119
- string street = 3;
120
- string building_number = 4;
121
- string postcode = 5;
122
- string region = 6;
123
- string country_name = 7;
124
- string telephone = 9;
125
- string timezone = 10;
126
- string economic_area = 11;
127
- string locality = 12;
128
- string organization_name = 13;
115
+ optional string email = 1;
116
+ optional string website = 2;
117
+ optional string street = 3;
118
+ optional string building_number = 4;
119
+ optional string postcode = 5;
120
+ optional string region = 6;
121
+ optional string country_name = 7;
122
+ optional string telephone = 9;
123
+ optional string timezone = 10;
124
+ optional string economic_area = 11;
125
+ optional string locality = 12;
126
+ optional string organization_name = 13;
129
127
  }
130
128
 
131
129
  message InvoicePosition {
132
- string currency = 1;
130
+ optional string currency = 1;
133
131
  repeated InvoiceRow tableList = 2;
134
- InvoicePrice totalPrice = 3;
132
+ optional InvoicePrice totalPrice = 3;
135
133
  }
136
134
 
137
135
  message InvoiceRow {
138
- string product = 1;
139
- double pricePerUnit = 2;
140
- uint32 quantity = 3;
141
- string vat = 4;
142
- double amount = 5;
143
- double contract_start_date = 6; // if there is any contract associated with product
136
+ optional string product = 1;
137
+ optional double pricePerUnit = 2;
138
+ optional uint32 quantity = 3;
139
+ optional string vat = 4;
140
+ optional double amount = 5;
141
+ optional double contract_start_date = 6; // if there is any contract associated with product
144
142
  }
145
143
 
146
144
  message InvoicePrice {
147
- double gross = 1;
148
- double net = 2;
145
+ optional double gross = 1;
146
+ optional double net = 2;
149
147
  }
150
148
 
151
149
  message TriggerInvoices {
@@ -13,9 +13,7 @@ import "io/restorecommerce/options.proto";
13
13
  * The microservice for scheduling jobs.
14
14
  * Provides CRUD operations.
15
15
  */
16
- service Service {
17
- option (io.restorecommerce.options.service_name) = "job";
18
-
16
+ service JobService {
19
17
  rpc Read (JobReadRequest) returns (JobListResponse) {
20
18
  option (io.restorecommerce.options.is_query) = true;
21
19
  };
@@ -38,7 +36,7 @@ message Deleted {
38
36
  */
39
37
  message JobList {
40
38
  repeated Job items = 1;
41
- uint32 total_count = 2;
39
+ optional uint32 total_count = 2;
42
40
  io.restorecommerce.auth.Subject subject = 3;
43
41
  }
44
42
 
@@ -57,14 +55,14 @@ message JobResponse {
57
55
  * A Job resource
58
56
  */
59
57
  message Job {
60
- string id = 1; // Job ID
58
+ optional string id = 1; // Job ID
61
59
 
62
- string type = 11; // Job type
63
- Data data = 12; // Job-specific data with variable payload
60
+ optional string type = 11; // Job type
61
+ optional Data data = 12; // Job-specific data with variable payload
64
62
 
65
- string when = 21; // Used to specify the time at which the job is run
63
+ optional string when = 21; // Used to specify the time at which the job is run
66
64
 
67
- JobOptions options = 30; // The job options
65
+ optional JobOptions options = 30; // The job options
68
66
  }
69
67
 
70
68
  /**
@@ -79,31 +77,31 @@ message JobOptions {
79
77
  CRITICAL = -15;
80
78
  }
81
79
 
82
- Priority priority = 13; // Job priority
83
- uint32 attempts = 14; // Amount of possible failing runs until job fails
84
- Backoff backoff = 15; // Delay settings between failed job runs
85
- uint32 timeout = 16; // The number of milliseconds after which the job should be fail with a timeout error
80
+ optional Priority priority = 13; // Job priority
81
+ optional uint32 attempts = 14; // Amount of possible failing runs until job fails
82
+ optional Backoff backoff = 15; // Delay settings between failed job runs
83
+ optional uint32 timeout = 16; // The number of milliseconds after which the job should be fail with a timeout error
86
84
 
87
- Repeat repeat = 20; // Used for periodic jobs
88
- string jobId = 21; // To override the job ID - by default, the job ID is a unique generated by bull
89
- bool removeOnComplete = 22; // If true, removes the job when it successfully completes
85
+ optional Repeat repeat = 20; // Used for periodic jobs
86
+ optional string jobId = 21; // To override the job ID - by default, the job ID is a unique generated by bull
87
+ optional bool removeOnComplete = 22; // If true, removes the job when it successfully completes
90
88
  }
91
89
 
92
90
  message Repeat {
93
- uint32 every = 1;
94
- string cron = 2;
95
- string startDate = 3;
96
- string endDate = 4;
97
- uint32 count = 5;
98
- string jobId = 6; // To override the job ID - by default, the job ID is a unique generated by bull
99
- string tz = 7; // time zone
91
+ optional uint32 every = 1;
92
+ optional string cron = 2;
93
+ optional string startDate = 3;
94
+ optional string endDate = 4;
95
+ optional uint32 count = 5;
96
+ optional string jobId = 6; // To override the job ID - by default, the job ID is a unique generated by bull
97
+ optional string tz = 7; // time zone
100
98
  }
101
99
 
102
100
  // Data which is stored within a job instance
103
101
  message Data {
104
- google.protobuf.Any payload = 2; // optional variable payload
105
- io.restorecommerce.meta.Meta meta = 3;
106
- string subject_id = 4; // id of job creator
102
+ optional google.protobuf.Any payload = 2; // optional variable payload
103
+ optional io.restorecommerce.meta.Meta meta = 3;
104
+ optional string subject_id = 4; // id of job creator
107
105
  }
108
106
 
109
107
  /**
@@ -111,10 +109,10 @@ message Data {
111
109
  * Emitted to Kafka by the scheduling service with event name 'queuedJob' and retreived by a service which processes this job.
112
110
  */
113
111
  message ScheduledJob {
114
- string id = 1; // Job instance ID
115
- string type = 2;
116
- Data data = 3; // Job-specific data with variable payload
117
- string schedule_type = 4; // Type of schedule (ONCE, RECURR, etc)
112
+ optional string id = 1; // Job instance ID
113
+ optional string type = 2;
114
+ optional Data data = 3; // Job-specific data with variable payload
115
+ optional string schedule_type = 4; // Type of schedule (ONCE, RECURR, etc)
118
116
  }
119
117
 
120
118
  /**
@@ -122,11 +120,11 @@ message ScheduledJob {
122
120
  * Emitted to Kafka by the service which processed the job with event name 'done' and retrieved by the scheduling service.
123
121
  */
124
122
  message JobDone {
125
- string id = 1; // Job instance ID
126
- string schedule_type = 2; // Type of schedule (ONCE, RECURR, etc)
127
- bool delete_scheduled = 3; // Whether to delete scheduled job
128
- string type = 4; // Job type
129
- google.protobuf.Any result = 5;
123
+ optional string id = 1; // Job instance ID
124
+ optional string schedule_type = 2; // Type of schedule (ONCE, RECURR, etc)
125
+ optional bool delete_scheduled = 3; // Whether to delete scheduled job
126
+ optional string type = 4; // Job type
127
+ optional google.protobuf.Any result = 5;
130
128
  }
131
129
 
132
130
  /**
@@ -134,10 +132,10 @@ message JobDone {
134
132
  * Emitted to Kafka by the service which processed the Job and retrieved by the scheduling service.
135
133
  */
136
134
  message JobFailed {
137
- string id = 1; // Job instance ID
138
- string error = 2; // Error message
139
- string schedule_type = 3; // Type of job ex: ONCE, RECURR etc.
140
- string type = 4; // Job type
135
+ optional string id = 1; // Job instance ID
136
+ optional string error = 2; // Error message
137
+ optional string schedule_type = 3; // Type of job ex: ONCE, RECURR etc.
138
+ optional string type = 4; // Job type
141
139
  }
142
140
 
143
141
  /**
@@ -148,23 +146,23 @@ message Backoff {
148
146
  FIXED = 0; // Retry with the same delay
149
147
  EXPONENTIAL = 1; // Exponential delay increase between retries
150
148
  }
151
- double delay = 1; // Time until retry in milliseconds
152
- Type type = 2; // Calculation of the delay
149
+ optional double delay = 1; // Time until retry in milliseconds
150
+ optional Type type = 2; // Calculation of the delay
153
151
  }
154
152
 
155
153
  // Job-specific read request
156
154
  message JobReadRequest {
157
- uint32 limit = 1;
155
+ optional uint32 limit = 1;
158
156
  // only possible to sort jobs by creation date
159
157
  enum SortOrder {
160
158
  UNSORTED = 0;
161
159
  ASCENDING = 1;
162
160
  DESCENDING = 2;
163
161
  }
164
- SortOrder sort = 2;
162
+ optional SortOrder sort = 2;
165
163
 
166
164
  // Filter based on fieldName|operation, value|list
167
- JobFilter filter = 4;
165
+ optional JobFilter filter = 4;
168
166
 
169
167
  // Fields selector
170
168
  repeated io.restorecommerce.resourcebase.FieldFilter field = 3;
@@ -174,5 +172,5 @@ message JobReadRequest {
174
172
  // filter
175
173
  message JobFilter {
176
174
  repeated string job_ids = 1;
177
- string type = 2;
175
+ optional string type = 2;
178
176
  }