@restorecommerce/protos 1.0.0 → 2.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,39 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.0.0](https://github.com/restorecommerce/libs/compare/@restorecommerce/protos@1.1.0...@restorecommerce/protos@2.0.0) (2022-10-12)
7
+
8
+
9
+ ### Code Refactoring
10
+
11
+ * **protos:** refactor protos for fulfillment-srv, ordering-srv, ready for migration tests ([bf8bfd3](https://github.com/restorecommerce/libs/commit/bf8bfd3a00e614857f6f4be35fb00224634ed066))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * **protos:** Address has new fields. Compatiblity must be checked.
17
+
18
+
19
+
20
+
21
+
22
+ # [1.1.0](https://github.com/restorecommerce/libs/compare/@restorecommerce/protos@1.0.0...@restorecommerce/protos@1.1.0) (2022-10-04)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **protos:** added timezone on Job cron repeat options. ([d25a5c0](https://github.com/restorecommerce/libs/commit/d25a5c0740d8f04102691a5eb3b4c5745fbb75ad))
28
+ * **protos:** restore subject id for auth subject ([150e663](https://github.com/restorecommerce/libs/commit/150e663c0c090721da9b7ce028714d5df7994972))
29
+
30
+
31
+ ### Features
32
+
33
+ * **facade:** add subscriptions ([d9006e9](https://github.com/restorecommerce/libs/commit/d9006e9ebcd1522a67373f8ca8bfa751c551b36f))
34
+
35
+
36
+
37
+
38
+
6
39
  # [1.0.0](https://github.com/restorecommerce/libs/compare/@restorecommerce/protos@0.7.2...@restorecommerce/protos@1.0.0) (2022-08-25)
7
40
 
8
41
 
@@ -47,12 +47,43 @@ message AddressResponse {
47
47
  io.restorecommerce.status.Status status = 2;
48
48
  }
49
49
 
50
- message Address {
51
- message GeoPoint {
52
- double latitude = 1;
53
- double longitude = 2;
54
- }
50
+ message GeoPoint {
51
+ double latitude = 1;
52
+ double longitude = 2;
53
+ }
54
+
55
+ message AddressAddition {
56
+ string field1 = 1;
57
+ string field2 = 2;
58
+ }
59
+
60
+ message BusinessAddress {
61
+ string name = 1;
62
+ }
63
+
64
+ message ResidentialAddress {
65
+ string title = 1;
66
+ string given_name = 2;
67
+ string mid_name = 3;
68
+ string family_name = 4;
69
+ }
55
70
 
71
+ message PackStation {
72
+ string provider = 1;
73
+ string station_number = 2;
74
+ string post_number = 3;
75
+ }
76
+
77
+ /**
78
+ Uses by Order-Srv and Fulfillment-Srv
79
+ **/
80
+ message ContactPerson {
81
+ string name = 1;
82
+ string email = 2;
83
+ string phone = 3;
84
+ }
85
+
86
+ message Address {
56
87
  string id = 1;
57
88
  io.restorecommerce.meta.Meta meta = 2;
58
89
  string postcode = 3;
@@ -65,17 +96,16 @@ message Address {
65
96
  field_name: "country",
66
97
  }
67
98
  ];
68
- string locality = 5;
69
- string street = 6;
70
- string region = 7;
71
-
72
- GeoPoint geo_coordinates = 8;
73
- double altitude = 9;
74
- string building_number = 10;
75
- AddressAddition address_addition = 11;
76
- }
77
-
78
- message AddressAddition {
79
- string field1 = 1;
80
- string field2 = 2;
81
- }
99
+ string locality = 6;
100
+ string street = 7;
101
+ string region = 8;
102
+ GeoPoint geo_coordinates = 9;
103
+ double altitude = 10;
104
+ string building_number = 11;
105
+ AddressAddition address_addition = 12;
106
+ oneof type {
107
+ BusinessAddress business_address = 13;
108
+ ResidentialAddress residential_address = 14;
109
+ PackStation pack_station = 15;
110
+ }
111
+ }
@@ -8,11 +8,9 @@ import "io/restorecommerce/attribute.proto";
8
8
  */
9
9
  message Subject {
10
10
  string id = 1; // user id
11
- string scope = 2; // target scope
12
- repeated RoleAssociation role_associations = 3; // role_associations of user creating the user
13
- repeated HierarchicalScope hierarchical_scopes = 4; // HR scope of user creating the User
14
- bool unauthenticated = 5; // for unauthenticated context
15
- string token = 6;
11
+ string scope = 2; // target scope (ID of the target scoping entity)
12
+ bool unauthenticated = 3; // for unauthenticated context
13
+ string token = 4;
16
14
  }
17
15
 
18
16
  message Tokens {
@@ -59,9 +59,9 @@ message ContactPoint {
59
59
  field_name: "physicalAddress",
60
60
  }
61
61
  ];
62
- string website = 4;
63
- string email = 5;
64
- string contact_point_type_id = 6 [
62
+ string website = 5;
63
+ string email = 6;
64
+ string contact_point_type_id = 7 [
65
65
  (io.restorecommerce.options.resolver) = {
66
66
  target_type: ".io.restorecommerce.contact_point_type.ContactPointType",
67
67
  target_service: "resource",
@@ -8,7 +8,6 @@ import "io/restorecommerce/auth.proto";
8
8
  import "io/restorecommerce/status.proto";
9
9
  import "io/restorecommerce/meta.proto";
10
10
  import "io/restorecommerce/address.proto";
11
- import "io/restorecommerce/country.proto";
12
11
  import "io/restorecommerce/options.proto";
13
12
 
14
13
  /**
@@ -25,9 +24,24 @@ service Service {
25
24
  };
26
25
 
27
26
  /**
28
- Creates and executes fulfillment orders
27
+ Creates fulfillment orders
29
28
  */
30
- rpc Create (FulfillmentRequestList) returns (FulfillmentResponseList);
29
+ rpc Create (FulfillmentList) returns (FulfillmentResponseList);
30
+
31
+ /**
32
+ Updates fulfillment orders unless Status is beyond Ordered
33
+ */
34
+ rpc Update (FulfillmentList) returns (FulfillmentResponseList);
35
+
36
+ /**
37
+ Creates or Updates fulfillment orders unless Status is beyond Ordered
38
+ */
39
+ rpc Upsert (FulfillmentList) returns (FulfillmentResponseList);
40
+
41
+ /**
42
+ Creates, Executes and Updates fulfillment orders against API
43
+ */
44
+ rpc Submit (FulfillmentList) returns (FulfillmentResponseList);
31
45
 
32
46
  /**
33
47
  Track a batch of fulfillment orders
@@ -50,50 +64,38 @@ service Service {
50
64
  enum State {
51
65
  Undefined = 0;
52
66
  Invalid = 1;
53
- Ordered = 2;
54
- Shipping = 3;
55
- Done= 4;
56
- Cancelled = 5;
57
- Failed = 6;
58
- }
59
-
60
- message Contact {
61
- string name = 1;
62
- string email = 2;
63
- string phone = 3;
64
- }
65
-
66
- message Branch {
67
- string provider = 1;
68
- string branch_number = 2;
69
- string post_number = 3;
67
+ Failed = 2;
68
+ Cancelled = 3;
69
+ Created = 4;
70
+ Submitted = 5;
71
+ Shipping = 6;
72
+ Done = 7;
70
73
  }
71
74
 
72
- message Packstation {
73
- string provider = 1;
74
- string station_number = 2;
75
- string post_number = 3;
75
+ message ShippingAddress {
76
+ io.restorecommerce.address.Address address = 1;
77
+ io.restorecommerce.address.ContactPerson contact_person = 2;
76
78
  }
77
79
 
78
- message Address {
79
- string title = 1;
80
- repeated string name = 2;
81
- oneof type {
82
- io.restorecommerce.address.Address address = 3;
83
- Packstation packstation = 4;
84
- Branch branch = 5;
85
- };
86
- io.restorecommerce.country.Country country = 6;
87
- Contact contact = 7;
80
+ message Item {
81
+ //Catalog item!
82
+ string item_id = 1;
83
+ string name = 2;
84
+ string description = 3;
85
+ string taric_code = 4;
86
+ int32 quantity = 5;
88
87
  }
89
88
 
90
89
  message Parcel {
91
- message Item {
92
- string item_id = 1;
93
- int32 quantity = 2;
94
- }
95
-
96
- string product_id = 1;
90
+ string product_id = 1 [
91
+ (io.restorecommerce.options.resolver) = {
92
+ target_type: ".io.restorecommerce.fulfillment_product.FulfillmentProduct",
93
+ target_service: "resource",
94
+ target_sub_service: "fulfillment_product",
95
+ target_method: "Read",
96
+ field_name: "product",
97
+ }
98
+ ];
97
99
  string product_variant_id = 2;
98
100
  repeated Item items = 3;
99
101
  float weight_in_kg = 4;
@@ -102,14 +104,6 @@ message Parcel {
102
104
  float length_in_cm = 7;
103
105
  }
104
106
 
105
- message Order {
106
- string reference_id = 1;
107
- repeated Parcel parcels = 2;
108
- Address sender = 3;
109
- Address receiver = 4;
110
- string notify = 5;
111
- }
112
-
113
107
  message Label {
114
108
  oneof type {
115
109
  string url = 1;
@@ -121,27 +115,37 @@ message Label {
121
115
  io.restorecommerce.status.Status status = 6; //API status
122
116
  }
123
117
 
124
- message FulfillmentRequest {
125
- string id = 1;
126
- Order order = 2;
127
- io.restorecommerce.meta.Meta meta = 3;
128
- }
129
-
130
- message FulfillmentRequestList {
131
- repeated FulfillmentRequest items = 1;
132
- uint32 total_count = 2;
133
- io.restorecommerce.auth.Subject subject = 3;
118
+ message Order {
119
+ string reference_id = 1;
120
+ repeated Parcel parcels = 2;
121
+ ShippingAddress sender = 3;
122
+ ShippingAddress receiver = 4;
123
+ string notify = 5;
134
124
  }
135
125
 
136
126
  /**
137
127
  This is the message how it get stored to the database
138
128
  */
139
129
  message Fulfillment {
130
+ option (restorecommerce.options.kafka_subscriber) = {
131
+ plural: "fulfillment"
132
+ topic: "io.restorecommerce.fulfillment.resource"
133
+ created: "fulfillmentCreated"
134
+ updated: "fulfillmentUpdated"
135
+ deleted: "fulfillmentDeleted"
136
+ };
137
+
140
138
  string id = 1;
141
139
  Order order = 2;
142
140
  io.restorecommerce.meta.Meta meta = 3;
143
141
  repeated Label labels = 4; //filled by service
144
- bool fulfilled = 5;
142
+ State state = 5;
143
+ }
144
+
145
+ message FulfillmentList {
146
+ repeated Fulfillment items = 1;
147
+ uint32 total_count = 2;
148
+ io.restorecommerce.auth.Subject subject = 3;
145
149
  }
146
150
 
147
151
  message FulfillmentResponse {
@@ -181,7 +185,15 @@ message Tracking {
181
185
  }
182
186
 
183
187
  message TrackingResult {
184
- Fulfillment fulfillment = 1;
188
+ Fulfillment fulfillment = 1 [
189
+ (io.restorecommerce.options.resolver) = {
190
+ target_type: ".io.restorecommerce.fulfillment.Fulfillment",
191
+ target_service: "resource",
192
+ target_sub_service: "fulfillment",
193
+ target_method: "Read",
194
+ field_name: "fulfillment",
195
+ }
196
+ ];
185
197
  repeated Tracking tracks = 2;
186
198
  io.restorecommerce.status.Status status = 3;
187
199
  }
@@ -26,6 +26,14 @@ service Service {
26
26
  }
27
27
 
28
28
  message FulfillmentCourier {
29
+ option (restorecommerce.options.kafka_subscriber) = {
30
+ plural: "fulfillmentCouriers"
31
+ topic: "io.restorecommerce.fulfillment_courier.resource"
32
+ created: "fulfillmentCourierCreated"
33
+ updated: "fulfillmentCourierUpdated"
34
+ deleted: "fulfillmentCourierDeleted"
35
+ };
36
+
29
37
  string id = 1;
30
38
  string name = 4;
31
39
  string description = 5;
@@ -7,17 +7,22 @@ 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/order.proto";
10
+ import "io/restorecommerce/fulfillment_courier.proto";
11
11
  import "io/restorecommerce/fulfillment.proto";
12
12
 
13
-
14
13
  /**
15
14
  Microservice defination
16
15
  */
17
16
 
18
17
  service Service {
19
- rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentProductResponseList);
20
- rpc Find (QueryList) returns (PackingSolutionResponseList);
18
+ option (io.restorecommerce.options.service_name) = "fulfillment_product";
19
+
20
+ rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentProductResponseList) {
21
+ option (io.restorecommerce.options.is_query) = true;
22
+ };
23
+ rpc Find (QueryList) returns (PackingSolutionResponseList) {
24
+ option (io.restorecommerce.options.is_query) = true;
25
+ };
21
26
  rpc Create (FulfillmentProductList) returns (FulfillmentProductResponseList);
22
27
  rpc Update (FulfillmentProductList) returns (FulfillmentProductResponseList);
23
28
  rpc Upsert (FulfillmentProductList) returns (FulfillmentProductResponseList);
@@ -34,7 +39,7 @@ message Preferences {
34
39
  message Query {
35
40
  io.restorecommerce.fulfillment.Address sender = 1;
36
41
  io.restorecommerce.fulfillment.Address receiver = 2;
37
- repeated io.restorecommerce.order.Item goods = 3;
42
+ repeated io.restorecommerce.fulfillment.Item goods = 3;
38
43
  Preferences preferences = 4;
39
44
  string reference_id = 5;
40
45
  }
@@ -46,13 +51,27 @@ message QueryList {
46
51
  }
47
52
 
48
53
  message FulfillmentProduct {
54
+ option (restorecommerce.options.kafka_subscriber) = {
55
+ plural: "fulfillmentProduct"
56
+ topic: "io.restorecommerce.fulfillment_product.resource"
57
+ created: "fulfillmentProductCreated"
58
+ updated: "fulfillmentProductUpdated"
59
+ deleted: "fulfillmentProductDeleted"
60
+ };
61
+
49
62
  string id = 1;
50
63
  string name = 2;
51
64
  string description = 3;
52
- string courier_id = 4;
53
- //repeated io.restorecommerce.country.Country start_country = 5;
65
+ string courier_id = 4 [
66
+ (io.restorecommerce.options.resolver) = {
67
+ target_type: ".io.restorecommerce.fulfillment_courier.FulfillmentCourier",
68
+ target_service: "resource",
69
+ target_sub_service: "fulfillment_courier",
70
+ target_method: "Read",
71
+ field_name: "courier",
72
+ }
73
+ ];
54
74
  repeated string start_zones = 6;
55
- //repeated io.restorecommerce.country.Country destination_country = 7;
56
75
  repeated string destination_zones = 8;
57
76
  repeated string tax_ids = 9;
58
77
  repeated io.restorecommerce.attribute.Attribute attributes = 10;
@@ -96,11 +96,11 @@ message Repeat {
96
96
  string endDate = 4;
97
97
  uint32 count = 5;
98
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
99
100
  }
100
101
 
101
102
  // Data which is stored within a job instance
102
103
  message Data {
103
- string timezone = 1;
104
104
  google.protobuf.Any payload = 2; // optional variable payload
105
105
  io.restorecommerce.meta.Meta meta = 3;
106
106
  string subject_id = 4; // id of job creator
@@ -23,3 +23,15 @@ message Resolver {
23
23
  string target_method = 4;
24
24
  string field_name = 5;
25
25
  }
26
+
27
+ extend google.protobuf.MessageOptions {
28
+ KafkaSubscription kafka_subscriber = 31003;
29
+ }
30
+
31
+ message KafkaSubscription {
32
+ string plural = 1;
33
+ string topic = 2;
34
+ string created = 3;
35
+ string updated = 4;
36
+ string deleted = 5;
37
+ }
@@ -7,9 +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/options.proto";
10
+ import "io/restorecommerce/address.proto";
11
+ import "io/restorecommerce/fulfillment.proto";
10
12
 
11
- // Used by resolvers
12
- import "io/restorecommerce/contact_point.proto";
13
13
 
14
14
  service Service {
15
15
  option (io.restorecommerce.options.service_name) = "order";
@@ -18,65 +18,23 @@ service Service {
18
18
  option (io.restorecommerce.options.is_query) = true;
19
19
  };
20
20
  rpc Create (OrderList) returns (OrderListResponse);
21
- rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
22
21
  rpc Update (OrderList) returns (OrderListResponse);
23
22
  rpc Upsert (OrderList) returns (OrderListResponse);
24
- rpc TriggerFulfillment (OrderDataList) returns (FulfillmentResults);
25
- }
26
-
27
-
28
- message OrderList {
29
- repeated Order items = 1;
30
- uint32 total_count = 2;
31
- io.restorecommerce.auth.Subject subject = 3;
32
- }
33
-
34
- message OrderListResponse {
35
- repeated OrderResponse items = 1;
36
- uint32 total_count = 2;
37
- io.restorecommerce.status.OperationStatus operation_status = 3;
38
- }
39
-
40
- message OrderResponse {
41
- Order payload = 1;
42
- io.restorecommerce.status.Status status = 2;
43
- }
44
-
45
- message Order {
46
- string id = 1;
47
- io.restorecommerce.meta.Meta meta = 2;
48
- string name = 3;
49
- string description = 4;
50
- string status = 5;
51
- string customer_reference = 6;
52
- repeated Items items = 7;
53
- // sum of all the quantity_price will be total_price
54
- double total_price = 8;
55
- // shipping address
56
- string shipping_contact_point_id = 9 [
57
- (io.restorecommerce.options.resolver) = {
58
- target_type: ".io.restorecommerce.contact_point.ContactPoint",
59
- target_service: "resource",
60
- target_sub_service: "contact_point",
61
- target_method: "Read",
62
- field_name: "shippingContactPoint",
63
- }
64
- ];
65
- string billing_contact_point_id = 10 [
66
- (io.restorecommerce.options.resolver) = {
67
- target_type: ".io.restorecommerce.contact_point.ContactPoint",
68
- target_service: "resource",
69
- target_sub_service: "contact_point",
70
- target_method: "Read",
71
- field_name: "billingContactPoint",
72
- }
73
- ];
74
- double total_weight_in_kg = 11;
23
+ rpc Submit (OrderList) returns (OrderListResponse);
24
+ rpc Cancel (CancelRequestList) returns (OrderListResponse);
25
+ rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
26
+ rpc TriggerFulfillment (TriggerFulfillmentRequestList) returns (io.restorecommerce.status.Status);
75
27
  }
76
28
 
77
- message Items {
78
- double quantity_price = 1;
79
- Item item = 2;
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;
80
38
  }
81
39
 
82
40
  message Item {
@@ -91,56 +49,86 @@ message Item {
91
49
  int32 quantity = 8;
92
50
  int32 vat = 9;
93
51
  double price = 10;
94
- string item_type = 11;
95
- double taric_code = 12;
96
- string stock_keeping_unit = 13;
97
- double weight_in_kg = 14;
98
- int32 length_in_cm = 15;
99
- int32 width_in_cm = 16;
100
- int32 height_in_cm = 17;
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;
101
60
  }
102
61
 
103
- message Deleted {
62
+ /**
63
+ Database Entity
64
+ */
65
+ message Order {
66
+ option (restorecommerce.options.kafka_subscriber) = {
67
+ plural: "orders"
68
+ topic: "io.restorecommerce.orders.resource"
69
+ created: "orderCreated"
70
+ updated: "orderUpdated"
71
+ deleted: "orderDeleted"
72
+ };
73
+
104
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;
105
88
  }
106
89
 
107
- message OrderDataList {
108
- repeated OrderData order_data = 1;
109
- io.restorecommerce.meta.Meta meta = 2;
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;
110
96
  }
111
97
 
112
- message OrderData {
113
- string order_id = 1;
114
- repeated Shipments shipments = 2;
98
+ message TriggerFulfillmentRequest {
99
+ Order order = 1;
100
+ ShippingDetails shipping_details = 2;
101
+ repeated io.restorecommerce.fulfillment.Parcel parcels = 3;
115
102
  }
116
103
 
117
- message Shipments {
118
- double total_weight_in_kg = 1;
119
- // below properties are used for international packaging
120
- double individual_weight_in_kg = 2; // each items weight
121
- int32 amount = 3; // number of items
122
- string export_type = 4;
123
- string export_description = 5;
124
- string customs_tariff_number = 6;
125
- string invoice_number = 7;
126
- double customs_value = 8;
104
+ message TriggerFulfillmentRequestList {
105
+ repeated TriggerFulfillmentRequest items = 1;
106
+ uint32 total_count = 2;
107
+ io.restorecommerce.auth.Subject subject = 3;
127
108
  }
128
109
 
129
- message FulfillmentResults {
130
- repeated ResponseDetailsList fulfillmentResults =1;
110
+ message OrderList {
111
+ repeated Order items = 1;
112
+ uint32 total_count = 2;
113
+ io.restorecommerce.auth.Subject subject = 3;
131
114
  }
132
115
 
133
- message ResponseDetailsList {
134
- OrderStatus Status = 1;
135
- ErrorList error = 2;
116
+ message OrderListResponse {
117
+ repeated OrderResponse items = 1;
118
+ uint32 total_count = 2;
119
+ io.restorecommerce.status.OperationStatus operation_status = 3;
136
120
  }
137
121
 
138
- message OrderStatus {
139
- string OrderId = 1;
140
- string OrderStatus =2;
122
+ message OrderResponse {
123
+ Order payload = 1;
124
+ io.restorecommerce.status.Status status = 2;
141
125
  }
142
126
 
143
- message ErrorList {
144
- repeated string code = 1;
145
- repeated string message = 2;
127
+ message CancelRequestList {
128
+ repeated string ids = 1;
129
+ io.restorecommerce.auth.Subject subject = 2;
146
130
  }
131
+
132
+ message Deleted {
133
+ string id = 1;
134
+ }
@@ -66,6 +66,12 @@ message FilterOp {
66
66
  Operator operator = 2;
67
67
  }
68
68
 
69
+ message Search {
70
+ string search = 1; // search string
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
73
+ }
74
+
69
75
  message ReadRequest {
70
76
  uint32 offset = 1;
71
77
  uint32 limit = 2;
@@ -76,7 +82,6 @@ message ReadRequest {
76
82
 
77
83
  /// Fields selector
78
84
  repeated FieldFilter field = 5;
79
- repeated string search = 6;
80
85
 
81
86
  /** Check the query parameters of HTTP request.
82
87
  * If query parameter `locales` is given,
@@ -90,6 +95,7 @@ message ReadRequest {
90
95
  repeated string custom_queries = 8;
91
96
  google.protobuf.Any custom_arguments = 9;
92
97
  io.restorecommerce.auth.Subject subject = 10;
98
+ Search search = 11;
93
99
  }
94
100
 
95
101
  message DeleteRequest {
@@ -98,6 +104,8 @@ message DeleteRequest {
98
104
  /// Delete specified documents
99
105
  repeated string ids = 2;
100
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
101
109
  }
102
110
 
103
111
  message DeleteResponse {
@@ -3,9 +3,12 @@ package io.restorecommerce.search;
3
3
 
4
4
  import "google/protobuf/any.proto";
5
5
  import "io/restorecommerce/auth.proto";
6
+ import "io/restorecommerce/options.proto";
6
7
 
7
8
  // Service provides the CRUD operations
8
9
  service Service {
10
+ option (io.restorecommerce.options.service_name) = "search";
11
+
9
12
  rpc Search (SearchRequest) returns (SearchResponse);
10
13
  }
11
14
 
@@ -258,6 +258,14 @@ message FindByRoleRequest {
258
258
  * A User resource.
259
259
  */
260
260
  message User {
261
+ option (restorecommerce.options.kafka_subscriber) = {
262
+ plural: "users"
263
+ topic: "io.restorecommerce.users.resource"
264
+ created: "userCreated"
265
+ updated: "userUpdated"
266
+ deleted: "userDeleted"
267
+ };
268
+
261
269
  string id = 1; /// User ID, unique, key
262
270
  io.restorecommerce.meta.Meta meta = 2;
263
271
  string name = 3; // The name of the user, can be used for login
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restorecommerce/protos",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Protobuf descriptors for Restorecommerce services",
5
5
  "author": "n-fuse GmbH",
6
6
  "repository": {
@@ -15,5 +15,5 @@
15
15
  "protobufs"
16
16
  ],
17
17
  "scripts": {},
18
- "gitHead": "2b25803ec9494c298f4f008a55485bc201c83bb8"
18
+ "gitHead": "120df12bc8544a9803f155daf6b2241733a31cc1"
19
19
  }