@sagebox-be/proto-contracts 1.0.14 → 1.0.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sagebox-be/proto-contracts",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Sagebox gRPC Protocol Buffer contracts and TypeScript definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,6 +9,7 @@ service ProductService {
9
9
  rpc GetProductsByCategoryId(GetProductsByCategoryIdRequest) returns (GetProductsResponse);
10
10
  rpc GetProductById(GetProductByIdRequest) returns (ProductResponse);
11
11
  rpc CreateProduct(CreateProductRequest) returns (ProductResponse);
12
+ rpc UpdateSku(UpdateSkuRequest) returns (SkuResponse);
12
13
  }
13
14
 
14
15
  // ============================================
@@ -20,6 +21,17 @@ service AddressService {
20
21
  rpc GetWards(GetWardsRequest) returns (GetWardsResponse);
21
22
  }
22
23
 
24
+ // ============================================
25
+ // Outbox Service
26
+ // ============================================
27
+ service ProductOutboxService {
28
+ rpc PublishProductOutbox(PublishOutboxRequest) returns (PublishOutboxResponse);
29
+ rpc RetryProductOutbox(RetryOutboxRequest) returns (RetryOutboxResponse);
30
+ rpc PublishInventoryOutbox(PublishOutboxRequest) returns (PublishOutboxResponse);
31
+ rpc RetryInventoryOutbox(RetryOutboxRequest) returns (RetryOutboxResponse);
32
+ rpc RetryElasticsearchSync(RetryEsRequest) returns (RetryEsResponse);
33
+ }
34
+
23
35
  // ============================================
24
36
  // Product Request Messages
25
37
  // ============================================
@@ -33,15 +45,25 @@ message GetProductByIdRequest {
33
45
 
34
46
  message CreateProductRequest {
35
47
  string name = 1;
36
- string title = 2;
48
+ optional string brandId = 2;
37
49
  string description = 3;
38
50
  string categoryId = 4;
39
- string storeId = 5;
40
51
  string status = 6;
41
52
  repeated string mediaKeys = 7;
42
53
  repeated ProductSkuInput skus = 8;
43
54
  }
44
55
 
56
+ message UpdateSkuRequest {
57
+ string id = 1;
58
+ optional int32 price = 2;
59
+ optional int32 width = 3;
60
+ optional int32 height = 4;
61
+ optional int32 length = 5;
62
+ optional int32 weight = 6;
63
+ repeated string mediaKeys = 7;
64
+ repeated AttributeValueInput attributeValues = 8;
65
+ }
66
+
45
67
  // ============================================
46
68
  // Product Response Messages
47
69
  // ============================================
@@ -54,6 +76,11 @@ message ProductResponse {
54
76
  string error = 2;
55
77
  }
56
78
 
79
+ message SkuResponse {
80
+ Sku sku = 1;
81
+ string error = 2;
82
+ }
83
+
57
84
  // ============================================
58
85
  // Address Request Messages
59
86
  // ============================================
@@ -89,11 +116,10 @@ message GetWardsResponse {
89
116
  message Product {
90
117
  string id = 1;
91
118
  string name = 2;
92
- string title = 3;
119
+ optional string brandId = 3;
93
120
  string description = 4;
94
121
  string keywords = 5;
95
122
  string categoryId = 6;
96
- string storeId = 7;
97
123
  int32 viewedCount = 8;
98
124
  string status = 9;
99
125
  string url = 10;
@@ -102,6 +128,21 @@ message Product {
102
128
  string updatedAt = 13;
103
129
  }
104
130
 
131
+ message Sku {
132
+ string id = 1;
133
+ string skuNo = 2;
134
+ string productId = 3;
135
+ int64 price = 4;
136
+ int32 width = 5;
137
+ int32 height = 6;
138
+ int32 length = 7;
139
+ int32 weight = 8;
140
+ repeated Media media = 9;
141
+ bool inactive = 10;
142
+ string createdAt = 11;
143
+ string updatedAt = 12;
144
+ }
145
+
105
146
  message Media {
106
147
  string id = 1;
107
148
  string key = 2;
@@ -114,9 +155,13 @@ message Media {
114
155
  message ProductSkuInput {
115
156
  int32 price = 1;
116
157
  int32 quantity = 2;
117
- optional string brand = 3;
118
- repeated string mediaKeys = 4;
119
- repeated AttributeValueInput attributeValues = 5;
158
+ int32 width = 3;
159
+ int32 height = 4;
160
+ int32 length = 5;
161
+ string warehouseId = 6;
162
+ int32 weight = 7;
163
+ repeated string mediaKeys = 8;
164
+ repeated AttributeValueInput attributeValues = 9;
120
165
  }
121
166
 
122
167
  message AttributeValueInput {
@@ -132,3 +177,30 @@ message AddressUnit {
132
177
  string code = 1;
133
178
  string name = 2;
134
179
  }
180
+
181
+ // ============================================
182
+ // Outbox Request Messages
183
+ // ============================================
184
+ message PublishOutboxRequest {}
185
+
186
+ message RetryOutboxRequest {}
187
+
188
+ message RetryEsRequest {}
189
+
190
+ // ============================================
191
+ // Outbox Response Messages
192
+ // ============================================
193
+ message PublishOutboxResponse {
194
+ bool success = 1;
195
+ string error = 2;
196
+ }
197
+
198
+ message RetryOutboxResponse {
199
+ bool success = 1;
200
+ string error = 2;
201
+ }
202
+
203
+ message RetryEsResponse {
204
+ bool success = 1;
205
+ string error = 2;
206
+ }