@mamindom/contracts 1.0.168 → 1.0.170
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/dist/gen/calculation.d.ts +1 -0
- package/dist/gen/cart.d.ts +1 -0
- package/dist/proto/account.proto +35 -41
- package/dist/proto/attribute.proto +37 -48
- package/dist/proto/audit.proto +33 -33
- package/dist/proto/auth.proto +9 -15
- package/dist/proto/banner.proto +17 -27
- package/dist/proto/bonus_settings.proto +11 -16
- package/dist/proto/brand.proto +16 -24
- package/dist/proto/bundle.proto +46 -58
- package/dist/proto/calculation.proto +30 -34
- package/dist/proto/cart.proto +85 -90
- package/dist/proto/category.proto +21 -30
- package/dist/proto/common.proto +6 -7
- package/dist/proto/common_post.proto +4 -4
- package/dist/proto/coupon.proto +43 -56
- package/dist/proto/crm_calculation.proto +47 -57
- package/dist/proto/delivery.proto +67 -69
- package/dist/proto/delivery_settings.proto +27 -36
- package/dist/proto/faq.proto +30 -43
- package/dist/proto/manager.proto +44 -32
- package/dist/proto/media.proto +9 -19
- package/dist/proto/notification.proto +76 -111
- package/dist/proto/order.proto +142 -151
- package/dist/proto/size_chart.proto +17 -19
- package/dist/proto/warehouse.proto +4 -5
- package/gen/calculation.ts +1 -0
- package/gen/cart.ts +1 -0
- package/package.json +1 -1
- package/proto/account.proto +35 -41
- package/proto/attribute.proto +37 -48
- package/proto/audit.proto +33 -33
- package/proto/auth.proto +9 -15
- package/proto/banner.proto +17 -27
- package/proto/bonus_settings.proto +11 -16
- package/proto/brand.proto +16 -24
- package/proto/bundle.proto +46 -58
- package/proto/calculation.proto +30 -34
- package/proto/cart.proto +85 -90
- package/proto/category.proto +21 -30
- package/proto/common.proto +6 -7
- package/proto/common_post.proto +4 -4
- package/proto/coupon.proto +43 -56
- package/proto/crm_calculation.proto +47 -57
- package/proto/delivery.proto +67 -69
- package/proto/delivery_settings.proto +27 -36
- package/proto/faq.proto +30 -43
- package/proto/manager.proto +44 -32
- package/proto/media.proto +9 -19
- package/proto/notification.proto +76 -111
- package/proto/order.proto +142 -151
- package/proto/size_chart.proto +17 -19
- package/proto/warehouse.proto +4 -5
package/proto/cart.proto
CHANGED
|
@@ -15,7 +15,6 @@ service CartService {
|
|
|
15
15
|
rpc ApplyPromo(ApplyPromoRequest) returns (CartResponse);
|
|
16
16
|
rpc RemovePromo(RemovePromoRequest) returns (CartResponse);
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
rpc ApplyCertificate(ApplyCertificateRequest) returns (CartResponse);
|
|
20
19
|
rpc RemoveCertificate(RemoveCertificateRequest) returns (CartResponse);
|
|
21
20
|
|
|
@@ -26,12 +25,11 @@ service CartService {
|
|
|
26
25
|
rpc SetDeliveryDraft(SetDeliveryDraftRequest) returns (CartResponse);
|
|
27
26
|
rpc SetPaymentDraft(SetPaymentDraftRequest) returns (CartResponse);
|
|
28
27
|
rpc SetComment(SetCommentRequest) returns (CartResponse);
|
|
29
|
-
|
|
28
|
+
|
|
30
29
|
rpc SetCheckoutDraft(SetCheckoutDraftRequest) returns (CartResponse);
|
|
31
30
|
|
|
32
31
|
rpc Recalculate(RecalculateRequest) returns (CartResponse);
|
|
33
32
|
|
|
34
|
-
|
|
35
33
|
rpc CalculateCrm(CalculateCrmRequest) returns (crm.v1.CalculateCartResponse);
|
|
36
34
|
|
|
37
35
|
rpc MergeGuestToUser(MergeGuestToUserRequest) returns (CartResponse);
|
|
@@ -41,73 +39,72 @@ service CartService {
|
|
|
41
39
|
rpc GetWishlist(WishlistOwnerRequest) returns (WishlistResponse);
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
|
|
45
42
|
message CartItem {
|
|
46
|
-
string product_id
|
|
47
|
-
string variant_id
|
|
48
|
-
string color_id
|
|
49
|
-
string sku
|
|
50
|
-
string name
|
|
51
|
-
string image_url
|
|
52
|
-
string slug
|
|
53
|
-
string category_id
|
|
54
|
-
string brand_id
|
|
55
|
-
int32
|
|
56
|
-
double price
|
|
57
|
-
double price_old
|
|
43
|
+
string product_id = 1;
|
|
44
|
+
string variant_id = 2;
|
|
45
|
+
string color_id = 3;
|
|
46
|
+
string sku = 4;
|
|
47
|
+
string name = 5;
|
|
48
|
+
string image_url = 6;
|
|
49
|
+
string slug = 7;
|
|
50
|
+
string category_id = 8;
|
|
51
|
+
string brand_id = 9;
|
|
52
|
+
int32 quantity = 10;
|
|
53
|
+
double price = 11;
|
|
54
|
+
double price_old = 12;
|
|
58
55
|
double line_subtotal = 13;
|
|
59
56
|
double line_discount = 14;
|
|
60
|
-
double line_total
|
|
61
|
-
string size
|
|
57
|
+
double line_total = 15;
|
|
58
|
+
string size = 16;
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
message AppliedPromotion {
|
|
65
|
-
string promotion_id
|
|
66
|
-
string promotion_name
|
|
62
|
+
string promotion_id = 1;
|
|
63
|
+
string promotion_name = 2;
|
|
67
64
|
double discount_amount = 3;
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
message AppliedCoupon {
|
|
71
|
-
string coupon_id
|
|
72
|
-
string code
|
|
73
|
-
string promotion_id
|
|
68
|
+
string coupon_id = 1;
|
|
69
|
+
string code = 2;
|
|
70
|
+
string promotion_id = 3;
|
|
74
71
|
double discount_amount = 4;
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
message AppliedCertificate {
|
|
78
|
-
string code
|
|
79
|
-
double nominal
|
|
80
|
-
double balance
|
|
81
|
-
double applied
|
|
82
|
-
bool
|
|
83
|
-
string error
|
|
75
|
+
string code = 1;
|
|
76
|
+
double nominal = 2;
|
|
77
|
+
double balance = 3;
|
|
78
|
+
double applied = 4;
|
|
79
|
+
bool verified = 5;
|
|
80
|
+
string error = 6;
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
message AppliedBonuses {
|
|
87
84
|
double available = 1;
|
|
88
|
-
double applied
|
|
85
|
+
double applied = 2;
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
message Recipient {
|
|
92
|
-
bool
|
|
89
|
+
bool is_different_from_customer = 1;
|
|
93
90
|
string first_name = 2;
|
|
94
|
-
string last_name
|
|
95
|
-
string phone
|
|
96
|
-
string email
|
|
91
|
+
string last_name = 3;
|
|
92
|
+
string phone = 4;
|
|
93
|
+
string email = 5;
|
|
97
94
|
}
|
|
98
95
|
|
|
99
96
|
message DeliveryDraft {
|
|
100
|
-
string method
|
|
101
|
-
string city_ref
|
|
102
|
-
string city_name
|
|
97
|
+
string method = 1;
|
|
98
|
+
string city_ref = 2;
|
|
99
|
+
string city_name = 3;
|
|
103
100
|
string warehouse_ref = 4;
|
|
104
101
|
string warehouse_name = 5;
|
|
105
|
-
string address
|
|
102
|
+
string address = 6;
|
|
106
103
|
string pickup_point_id = 7;
|
|
107
|
-
double cost
|
|
108
|
-
bool
|
|
109
|
-
|
|
110
|
-
string region
|
|
104
|
+
double cost = 8;
|
|
105
|
+
bool free_shipping = 9;
|
|
106
|
+
|
|
107
|
+
string region = 10;
|
|
111
108
|
}
|
|
112
109
|
|
|
113
110
|
message PaymentDraft {
|
|
@@ -115,23 +112,23 @@ message PaymentDraft {
|
|
|
115
112
|
}
|
|
116
113
|
|
|
117
114
|
message CartTotals {
|
|
118
|
-
double items_subtotal
|
|
119
|
-
double promo_discount
|
|
120
|
-
double coupon_discount
|
|
121
|
-
double certificate_applied
|
|
122
|
-
double bonuses_applied
|
|
123
|
-
double shipping_cost
|
|
124
|
-
double grand_total
|
|
125
|
-
double bonuses_to_earn
|
|
115
|
+
double items_subtotal = 1;
|
|
116
|
+
double promo_discount = 2;
|
|
117
|
+
double coupon_discount = 3;
|
|
118
|
+
double certificate_applied = 4;
|
|
119
|
+
double bonuses_applied = 5;
|
|
120
|
+
double shipping_cost = 6;
|
|
121
|
+
double grand_total = 7;
|
|
122
|
+
double bonuses_to_earn = 8;
|
|
126
123
|
}
|
|
127
124
|
|
|
128
125
|
message Cart {
|
|
129
|
-
string cart_id
|
|
130
|
-
string user_id
|
|
131
|
-
string guest_id
|
|
126
|
+
string cart_id = 1;
|
|
127
|
+
string user_id = 2;
|
|
128
|
+
string guest_id = 3;
|
|
132
129
|
repeated CartItem items = 4;
|
|
133
130
|
repeated AppliedPromotion applied_promotions = 5;
|
|
134
|
-
repeated AppliedCoupon
|
|
131
|
+
repeated AppliedCoupon applied_coupons = 6;
|
|
135
132
|
repeated string promo_codes = 7;
|
|
136
133
|
AppliedCertificate certificate = 8;
|
|
137
134
|
AppliedBonuses bonuses = 9;
|
|
@@ -139,32 +136,31 @@ message Cart {
|
|
|
139
136
|
DeliveryDraft delivery = 11;
|
|
140
137
|
PaymentDraft payment = 12;
|
|
141
138
|
string comment = 13;
|
|
142
|
-
bool
|
|
139
|
+
bool do_not_call = 14;
|
|
143
140
|
CartTotals totals = 15;
|
|
144
|
-
int64
|
|
145
|
-
int64
|
|
141
|
+
int64 updated_at = 16;
|
|
142
|
+
int64 expires_at = 17;
|
|
143
|
+
optional string coupon_error = 18;
|
|
146
144
|
}
|
|
147
145
|
|
|
148
|
-
|
|
149
146
|
message WishlistItem {
|
|
150
|
-
string product_id
|
|
151
|
-
string variant_id
|
|
152
|
-
string sku
|
|
153
|
-
string name
|
|
154
|
-
string image_url
|
|
155
|
-
string slug
|
|
156
|
-
double price
|
|
157
|
-
bool
|
|
158
|
-
int64
|
|
147
|
+
string product_id = 1;
|
|
148
|
+
string variant_id = 2;
|
|
149
|
+
string sku = 3;
|
|
150
|
+
string name = 4;
|
|
151
|
+
string image_url = 5;
|
|
152
|
+
string slug = 6;
|
|
153
|
+
double price = 7;
|
|
154
|
+
bool in_stock = 8;
|
|
155
|
+
int64 added_at = 9;
|
|
159
156
|
}
|
|
160
157
|
|
|
161
158
|
message WishlistResponse {
|
|
162
159
|
repeated WishlistItem items = 1;
|
|
163
160
|
}
|
|
164
161
|
|
|
165
|
-
|
|
166
162
|
message CartOwner {
|
|
167
|
-
string user_id
|
|
163
|
+
string user_id = 1;
|
|
168
164
|
string guest_id = 2;
|
|
169
165
|
}
|
|
170
166
|
|
|
@@ -183,36 +179,36 @@ message ClearCartRequest {
|
|
|
183
179
|
}
|
|
184
180
|
|
|
185
181
|
message AddItemRequest {
|
|
186
|
-
CartOwner owner
|
|
187
|
-
string product_id
|
|
188
|
-
string variant_id
|
|
189
|
-
int32
|
|
182
|
+
CartOwner owner = 1;
|
|
183
|
+
string product_id = 2;
|
|
184
|
+
string variant_id = 3;
|
|
185
|
+
int32 quantity = 4;
|
|
190
186
|
}
|
|
191
187
|
|
|
192
188
|
message UpdateItemQtyRequest {
|
|
193
|
-
CartOwner owner
|
|
189
|
+
CartOwner owner = 1;
|
|
194
190
|
string variant_id = 2;
|
|
195
|
-
int32
|
|
191
|
+
int32 quantity = 3;
|
|
196
192
|
}
|
|
197
193
|
|
|
198
194
|
message RemoveItemRequest {
|
|
199
|
-
CartOwner owner
|
|
195
|
+
CartOwner owner = 1;
|
|
200
196
|
string variant_id = 2;
|
|
201
197
|
}
|
|
202
198
|
|
|
203
199
|
message ApplyPromoRequest {
|
|
204
200
|
CartOwner owner = 1;
|
|
205
|
-
string code
|
|
201
|
+
string code = 2;
|
|
206
202
|
}
|
|
207
203
|
|
|
208
204
|
message RemovePromoRequest {
|
|
209
205
|
CartOwner owner = 1;
|
|
210
|
-
string code
|
|
206
|
+
string code = 2;
|
|
211
207
|
}
|
|
212
208
|
|
|
213
209
|
message ApplyCertificateRequest {
|
|
214
210
|
CartOwner owner = 1;
|
|
215
|
-
string code
|
|
211
|
+
string code = 2;
|
|
216
212
|
}
|
|
217
213
|
|
|
218
214
|
message RemoveCertificateRequest {
|
|
@@ -221,7 +217,7 @@ message RemoveCertificateRequest {
|
|
|
221
217
|
|
|
222
218
|
message ApplyBonusesRequest {
|
|
223
219
|
CartOwner owner = 1;
|
|
224
|
-
double amount
|
|
220
|
+
double amount = 2;
|
|
225
221
|
}
|
|
226
222
|
|
|
227
223
|
message RemoveBonusesRequest {
|
|
@@ -246,22 +242,22 @@ message SetPaymentDraftRequest {
|
|
|
246
242
|
message SetCommentRequest {
|
|
247
243
|
CartOwner owner = 1;
|
|
248
244
|
string comment = 2;
|
|
249
|
-
bool
|
|
245
|
+
bool do_not_call = 3;
|
|
250
246
|
}
|
|
251
247
|
|
|
252
248
|
message SetCheckoutDraftRequest {
|
|
253
249
|
CartOwner owner = 1;
|
|
254
|
-
|
|
250
|
+
|
|
255
251
|
Recipient recipient = 2;
|
|
256
252
|
DeliveryDraft delivery = 3;
|
|
257
253
|
PaymentDraft payment = 4;
|
|
258
254
|
string comment = 5;
|
|
259
|
-
bool
|
|
255
|
+
bool do_not_call = 6;
|
|
260
256
|
|
|
261
|
-
bool
|
|
262
|
-
bool
|
|
263
|
-
bool
|
|
264
|
-
bool
|
|
257
|
+
bool has_recipient = 7;
|
|
258
|
+
bool has_delivery = 8;
|
|
259
|
+
bool has_payment = 9;
|
|
260
|
+
bool has_comment = 10;
|
|
265
261
|
}
|
|
266
262
|
|
|
267
263
|
message RecalculateRequest {
|
|
@@ -270,7 +266,7 @@ message RecalculateRequest {
|
|
|
270
266
|
|
|
271
267
|
message MergeGuestToUserRequest {
|
|
272
268
|
string guest_id = 1;
|
|
273
|
-
string user_id
|
|
269
|
+
string user_id = 2;
|
|
274
270
|
}
|
|
275
271
|
|
|
276
272
|
message WishlistOwnerRequest {
|
|
@@ -278,12 +274,11 @@ message WishlistOwnerRequest {
|
|
|
278
274
|
}
|
|
279
275
|
|
|
280
276
|
message WishlistItemRequest {
|
|
281
|
-
string user_id
|
|
277
|
+
string user_id = 1;
|
|
282
278
|
string product_id = 2;
|
|
283
279
|
string variant_id = 3;
|
|
284
280
|
}
|
|
285
281
|
|
|
286
|
-
|
|
287
282
|
message CartResponse {
|
|
288
283
|
bool ok = 1;
|
|
289
284
|
Cart cart = 2;
|
package/proto/category.proto
CHANGED
|
@@ -2,39 +2,30 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package catalog.v1;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
5
|
import "common.proto";
|
|
10
6
|
|
|
11
|
-
|
|
12
7
|
service CategoryAdminService {
|
|
13
|
-
rpc GetCategoryTree
|
|
14
|
-
|
|
15
|
-
rpc GetCategory (GetCategoryRequest) returns (CategoryResponse);
|
|
16
|
-
rpc CreateCategory (CreateCategoryRequest) returns (CategoryResponse);
|
|
17
|
-
rpc UpdateCategory (UpdateCategoryRequest) returns (CategoryResponse);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteResponse);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
rpc UpdateCategoryOrder (UpdateCategoryOrderRequest) returns (SuccessResponse);
|
|
8
|
+
rpc GetCategoryTree(GetCategoryTreeRequest) returns (GetCategoryTreeResponse);
|
|
24
9
|
|
|
25
|
-
rpc
|
|
10
|
+
rpc GetCategory(GetCategoryRequest) returns (CategoryResponse);
|
|
11
|
+
rpc CreateCategory(CreateCategoryRequest) returns (CategoryResponse);
|
|
12
|
+
rpc UpdateCategory(UpdateCategoryRequest) returns (CategoryResponse);
|
|
26
13
|
|
|
27
|
-
rpc
|
|
14
|
+
rpc DeleteCategory(DeleteCategoryRequest) returns (DeleteResponse);
|
|
28
15
|
|
|
16
|
+
rpc UpdateCategoryOrder(UpdateCategoryOrderRequest) returns (SuccessResponse);
|
|
29
17
|
|
|
30
|
-
rpc
|
|
31
|
-
}
|
|
18
|
+
rpc GetAllCategories(GetAllCategoriesRequest) returns (GetAllCategoriesResponse);
|
|
32
19
|
|
|
20
|
+
rpc GetAllCategoriesLight(GetAllCategoriesRequest) returns (GetAllCategoriesLightResponse);
|
|
21
|
+
|
|
22
|
+
rpc UpsertCategories(UpsertCategoriesRequest) returns (UpsertCategoriesResponse);
|
|
23
|
+
}
|
|
33
24
|
|
|
34
25
|
message CategorySyncItem {
|
|
35
26
|
string category_guid = 1;
|
|
36
|
-
optional string parent_guid = 2;
|
|
37
|
-
map<string, string> name = 3;
|
|
27
|
+
optional string parent_guid = 2;
|
|
28
|
+
map<string, string> name = 3;
|
|
38
29
|
}
|
|
39
30
|
|
|
40
31
|
message UpsertCategoriesRequest {
|
|
@@ -44,7 +35,7 @@ message UpsertCategoriesRequest {
|
|
|
44
35
|
|
|
45
36
|
message CategoryUpsertResult {
|
|
46
37
|
string guid = 1;
|
|
47
|
-
string status = 2;
|
|
38
|
+
string status = 2;
|
|
48
39
|
optional string reason = 3;
|
|
49
40
|
optional string id = 4;
|
|
50
41
|
}
|
|
@@ -75,14 +66,14 @@ message GetAllCategoriesLightResponse {
|
|
|
75
66
|
repeated CategoryLight items = 1;
|
|
76
67
|
}
|
|
77
68
|
message GetCategoryTreeRequest {
|
|
78
|
-
string lang = 1;
|
|
69
|
+
string lang = 1;
|
|
79
70
|
}
|
|
80
71
|
|
|
81
72
|
message CategoryTreeNode {
|
|
82
73
|
string id = 1;
|
|
83
74
|
string parent_id = 2;
|
|
84
75
|
string slug = 3;
|
|
85
|
-
string name = 4;
|
|
76
|
+
string name = 4;
|
|
86
77
|
string image = 5;
|
|
87
78
|
repeated CategoryTreeNode children = 6;
|
|
88
79
|
}
|
|
@@ -101,7 +92,7 @@ message CategoryResponse {
|
|
|
101
92
|
|
|
102
93
|
map<string, string> name = 7;
|
|
103
94
|
map<string, string> description = 8;
|
|
104
|
-
|
|
95
|
+
|
|
105
96
|
map<string, string> meta_title = 9;
|
|
106
97
|
map<string, string> meta_description = 10;
|
|
107
98
|
map<string, string> meta_keywords = 11;
|
|
@@ -113,7 +104,7 @@ message CategoryResponse {
|
|
|
113
104
|
|
|
114
105
|
message GetCategoryRequest {
|
|
115
106
|
string id = 1;
|
|
116
|
-
optional string slug = 2;
|
|
107
|
+
optional string slug = 2;
|
|
117
108
|
}
|
|
118
109
|
|
|
119
110
|
message CreateCategoryRequest {
|
|
@@ -125,7 +116,7 @@ message CreateCategoryRequest {
|
|
|
125
116
|
|
|
126
117
|
map<string, string> name = 6;
|
|
127
118
|
map<string, string> description = 7;
|
|
128
|
-
|
|
119
|
+
|
|
129
120
|
map<string, string> meta_title = 8;
|
|
130
121
|
map<string, string> meta_description = 9;
|
|
131
122
|
map<string, string> meta_keywords = 10;
|
|
@@ -145,7 +136,7 @@ message UpdateCategoryRequest {
|
|
|
145
136
|
|
|
146
137
|
map<string, string> name = 7;
|
|
147
138
|
map<string, string> description = 8;
|
|
148
|
-
|
|
139
|
+
|
|
149
140
|
map<string, string> meta_title = 9;
|
|
150
141
|
map<string, string> meta_description = 10;
|
|
151
142
|
map<string, string> meta_keywords = 11;
|
|
@@ -166,4 +157,4 @@ message CategoryOrderItem {
|
|
|
166
157
|
|
|
167
158
|
message UpdateCategoryOrderRequest {
|
|
168
159
|
repeated CategoryOrderItem items = 1;
|
|
169
|
-
}
|
|
160
|
+
}
|
package/proto/common.proto
CHANGED
|
@@ -10,17 +10,16 @@ message DeleteResponse {
|
|
|
10
10
|
bool success = 1;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
message PaginationRequest {
|
|
15
|
-
int32 page = 1;
|
|
16
|
-
int32 limit = 2;
|
|
14
|
+
int32 page = 1;
|
|
15
|
+
int32 limit = 2;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
message PaginationMeta {
|
|
20
|
-
|
|
19
|
+
int32 total_items = 1;
|
|
21
20
|
int32 total_pages = 2;
|
|
22
21
|
int32 current_page = 3;
|
|
23
22
|
int32 per_page = 4;
|
|
24
|
-
optional double price_min = 5;
|
|
25
|
-
optional double price_max = 6;
|
|
26
|
-
}
|
|
23
|
+
optional double price_min = 5;
|
|
24
|
+
optional double price_max = 6;
|
|
25
|
+
}
|
package/proto/common_post.proto
CHANGED
|
@@ -11,13 +11,13 @@ message DeleteResponse {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
message PaginationRequest {
|
|
14
|
-
int32 page
|
|
14
|
+
int32 page = 1;
|
|
15
15
|
int32 limit = 2;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
message PaginationMeta {
|
|
19
|
-
int32 total_items
|
|
20
|
-
int32 total_pages
|
|
19
|
+
int32 total_items = 1;
|
|
20
|
+
int32 total_pages = 2;
|
|
21
21
|
int32 current_page = 3;
|
|
22
|
-
int32 per_page
|
|
22
|
+
int32 per_page = 4;
|
|
23
23
|
}
|
package/proto/coupon.proto
CHANGED
|
@@ -4,118 +4,105 @@ package promo.v1;
|
|
|
4
4
|
|
|
5
5
|
import "common_promo.proto";
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
service CouponService {
|
|
9
|
-
rpc GetCoupons
|
|
10
|
-
rpc GetCoupon
|
|
11
|
-
rpc CreateCoupon
|
|
12
|
-
rpc UpdateCoupon
|
|
13
|
-
rpc DeactivateCoupon
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
rpc GenerateCoupons (GenerateCouponsRequest) returns (GenerateCouponsResponse);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
rpc ExportCoupons (ExportCouponsRequest) returns (ExportCouponsResponse);
|
|
20
|
-
rpc ImportCoupons (ImportCouponsRequest) returns (ImportCouponsResponse);
|
|
21
|
-
}
|
|
8
|
+
rpc GetCoupons(GetCouponsRequest) returns (GetCouponsResponse);
|
|
9
|
+
rpc GetCoupon(GetCouponRequest) returns (CouponResponse);
|
|
10
|
+
rpc CreateCoupon(CreateCouponRequest) returns (CouponResponse);
|
|
11
|
+
rpc UpdateCoupon(UpdateCouponRequest) returns (CouponResponse);
|
|
12
|
+
rpc DeactivateCoupon(DeactivateCouponRequest) returns (SuccessResponse);
|
|
22
13
|
|
|
14
|
+
rpc GenerateCoupons(GenerateCouponsRequest) returns (GenerateCouponsResponse);
|
|
15
|
+
|
|
16
|
+
rpc ExportCoupons(ExportCouponsRequest) returns (ExportCouponsResponse);
|
|
17
|
+
rpc ImportCoupons(ImportCouponsRequest) returns (ImportCouponsResponse);
|
|
18
|
+
}
|
|
23
19
|
|
|
24
20
|
message CouponResponse {
|
|
25
|
-
string id
|
|
21
|
+
string id = 1;
|
|
26
22
|
string promotion_id = 2;
|
|
27
|
-
string code
|
|
23
|
+
string code = 3;
|
|
28
24
|
|
|
29
|
-
optional int32 usage_limit_total
|
|
25
|
+
optional int32 usage_limit_total = 4;
|
|
30
26
|
optional int32 usage_limit_per_user = 5;
|
|
31
|
-
int32
|
|
27
|
+
int32 usage_count = 6;
|
|
32
28
|
|
|
33
|
-
bool
|
|
34
|
-
optional string expires_at = 8;
|
|
29
|
+
bool is_active = 7;
|
|
30
|
+
optional string expires_at = 8;
|
|
35
31
|
|
|
36
32
|
string created_at = 9;
|
|
37
33
|
}
|
|
38
34
|
|
|
39
|
-
|
|
40
35
|
message GetCouponsRequest {
|
|
41
|
-
PaginationRequest pagination
|
|
42
|
-
optional string
|
|
43
|
-
optional bool
|
|
44
|
-
optional string
|
|
36
|
+
PaginationRequest pagination = 1;
|
|
37
|
+
optional string promotion_id = 2;
|
|
38
|
+
optional bool is_active = 3;
|
|
39
|
+
optional string search = 4;
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
message GetCouponsResponse {
|
|
48
43
|
repeated CouponResponse items = 1;
|
|
49
|
-
PaginationMeta
|
|
44
|
+
PaginationMeta meta = 2;
|
|
50
45
|
}
|
|
51
46
|
|
|
52
|
-
|
|
53
47
|
message GetCouponRequest {
|
|
54
48
|
string id = 1;
|
|
55
|
-
optional string code = 2;
|
|
49
|
+
optional string code = 2;
|
|
56
50
|
}
|
|
57
51
|
|
|
58
|
-
|
|
59
52
|
message CreateCouponRequest {
|
|
60
53
|
string promotion_id = 1;
|
|
61
|
-
string code
|
|
54
|
+
string code = 2;
|
|
62
55
|
|
|
63
|
-
optional int32
|
|
64
|
-
optional int32
|
|
65
|
-
optional string expires_at
|
|
66
|
-
bool
|
|
56
|
+
optional int32 usage_limit_total = 3;
|
|
57
|
+
optional int32 usage_limit_per_user = 4;
|
|
58
|
+
optional string expires_at = 5;
|
|
59
|
+
bool is_active = 6;
|
|
67
60
|
}
|
|
68
61
|
|
|
69
|
-
|
|
70
62
|
message UpdateCouponRequest {
|
|
71
63
|
string id = 1;
|
|
72
64
|
|
|
73
|
-
optional int32
|
|
74
|
-
optional int32
|
|
75
|
-
optional string expires_at
|
|
76
|
-
optional bool
|
|
65
|
+
optional int32 usage_limit_total = 2;
|
|
66
|
+
optional int32 usage_limit_per_user = 3;
|
|
67
|
+
optional string expires_at = 4;
|
|
68
|
+
optional bool is_active = 5;
|
|
77
69
|
}
|
|
78
70
|
|
|
79
|
-
|
|
80
71
|
message DeactivateCouponRequest {
|
|
81
72
|
string id = 1;
|
|
82
73
|
}
|
|
83
74
|
|
|
84
|
-
|
|
85
75
|
message GenerateCouponsRequest {
|
|
86
76
|
string promotion_id = 1;
|
|
87
|
-
int32
|
|
77
|
+
int32 count = 2;
|
|
88
78
|
|
|
89
|
-
|
|
90
|
-
optional
|
|
91
|
-
optional int32 random_length = 4;
|
|
79
|
+
optional string prefix = 3;
|
|
80
|
+
optional int32 random_length = 4;
|
|
92
81
|
|
|
93
|
-
optional int32
|
|
94
|
-
optional string expires_at
|
|
82
|
+
optional int32 usage_limit_per_user = 5;
|
|
83
|
+
optional string expires_at = 6;
|
|
95
84
|
}
|
|
96
85
|
|
|
97
86
|
message GenerateCouponsResponse {
|
|
98
|
-
int32 generated = 1;
|
|
87
|
+
int32 generated = 1;
|
|
99
88
|
}
|
|
100
89
|
|
|
101
|
-
|
|
102
90
|
message ExportCouponsRequest {
|
|
103
91
|
string promotion_id = 1;
|
|
104
|
-
optional bool active_only = 2;
|
|
92
|
+
optional bool active_only = 2;
|
|
105
93
|
}
|
|
106
94
|
|
|
107
95
|
message ExportCouponsResponse {
|
|
108
|
-
string csv_content = 1;
|
|
96
|
+
string csv_content = 1;
|
|
109
97
|
}
|
|
110
98
|
|
|
111
|
-
|
|
112
99
|
message ImportCouponsRequest {
|
|
113
100
|
string promotion_id = 1;
|
|
114
|
-
string csv_content
|
|
101
|
+
string csv_content = 2;
|
|
115
102
|
}
|
|
116
103
|
|
|
117
104
|
message ImportCouponsResponse {
|
|
118
|
-
int32 imported = 1;
|
|
119
|
-
int32 skipped
|
|
120
|
-
repeated string errors = 3;
|
|
105
|
+
int32 imported = 1;
|
|
106
|
+
int32 skipped = 2;
|
|
107
|
+
repeated string errors = 3;
|
|
121
108
|
}
|