@mamindom/contracts 1.0.193 → 1.0.201
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/events/auth/user-authenticated.interface.d.ts +2 -0
- package/dist/events/orders/index.d.ts +1 -0
- package/dist/events/orders/index.js +1 -0
- package/dist/events/orders/order-side-effects.interface.d.ts +67 -0
- package/dist/events/orders/order-side-effects.interface.js +2 -0
- package/dist/gen/banner.d.ts +18 -27
- package/dist/gen/calculation.d.ts +21 -10
- package/dist/gen/calculation.js +1 -1
- package/dist/gen/cart.d.ts +31 -0
- package/dist/gen/cart.js +1 -0
- package/dist/gen/category.d.ts +1 -0
- package/dist/gen/coupon.d.ts +1 -0
- package/dist/gen/delivery_settings.d.ts +0 -3
- package/dist/gen/notification.d.ts +75 -2
- package/dist/gen/notification.js +34 -1
- package/dist/gen/order.d.ts +29 -1
- package/dist/gen/order.js +1 -0
- package/dist/gen/payment.d.ts +30 -4
- package/dist/gen/payment.js +3 -0
- package/dist/gen/post.d.ts +3 -0
- package/dist/gen/post_comment.d.ts +1 -0
- package/dist/gen/product.d.ts +21 -13
- package/dist/gen/promotion.d.ts +2 -0
- package/dist/gen/shop_filters.d.ts +0 -1
- package/dist/gen/site_settings.d.ts +2 -0
- package/dist/proto/banner.proto +8 -29
- package/dist/proto/calculation.proto +39 -8
- package/dist/proto/cart.proto +47 -0
- package/dist/proto/category.proto +1 -0
- package/dist/proto/coupon.proto +3 -0
- package/dist/proto/delivery_settings.proto +3 -3
- package/dist/proto/notification.proto +84 -2
- package/dist/proto/order.proto +43 -1
- package/dist/proto/payment.proto +49 -2
- package/dist/proto/post.proto +5 -0
- package/dist/proto/post_comment.proto +5 -2
- package/dist/proto/product.proto +12 -11
- package/dist/proto/promotion.proto +4 -0
- package/dist/proto/shop_filters.proto +1 -1
- package/dist/proto/site_settings.proto +4 -0
- package/events/auth/otp-requested.interface.ts +3 -4
- package/events/auth/user-authenticated.interface.ts +3 -0
- package/events/orders/index.ts +1 -0
- package/events/orders/order-side-effects.interface.ts +82 -0
- package/gen/banner.ts +16 -29
- package/gen/calculation.ts +26 -14
- package/gen/cart.ts +38 -0
- package/gen/category.ts +1 -0
- package/gen/coupon.ts +1 -0
- package/gen/delivery_settings.ts +0 -3
- package/gen/notification.ts +136 -2
- package/gen/order.ts +38 -1
- package/gen/payment.ts +49 -4
- package/gen/post.ts +3 -0
- package/gen/post_comment.ts +1 -0
- package/gen/product.ts +19 -16
- package/gen/promotion.ts +2 -0
- package/gen/shop_filters.ts +1 -4
- package/gen/site_settings.ts +2 -0
- package/package.json +1 -1
- package/proto/banner.proto +8 -29
- package/proto/calculation.proto +39 -8
- package/proto/cart.proto +47 -0
- package/proto/category.proto +1 -0
- package/proto/coupon.proto +3 -0
- package/proto/delivery_settings.proto +3 -3
- package/proto/notification.proto +84 -2
- package/proto/order.proto +43 -1
- package/proto/payment.proto +49 -2
- package/proto/post.proto +5 -0
- package/proto/post_comment.proto +5 -2
- package/proto/product.proto +12 -11
- package/proto/promotion.proto +4 -0
- package/proto/shop_filters.proto +1 -1
- package/proto/site_settings.proto +4 -0
package/dist/proto/order.proto
CHANGED
|
@@ -23,6 +23,7 @@ service OrderService {
|
|
|
23
23
|
rpc RemoveTag(RemoveTagRequest) returns (OrderResponse);
|
|
24
24
|
|
|
25
25
|
rpc EditItems(EditItemsRequest) returns (OrderResponse);
|
|
26
|
+
rpc PreviewRecalculation(PreviewRecalculationRequest) returns (PreviewRecalculationResponse);
|
|
26
27
|
rpc SetTrackingNumber(SetTrackingNumberRequest) returns (OrderResponse);
|
|
27
28
|
|
|
28
29
|
rpc ApplyRecalculation(ApplyRecalculationRequest) returns (OrderResponse);
|
|
@@ -248,7 +249,10 @@ message Order {
|
|
|
248
249
|
OrderPayment payment = 10;
|
|
249
250
|
OrderTotals totals = 11;
|
|
250
251
|
|
|
251
|
-
|
|
252
|
+
|
|
253
|
+
reserved 12;
|
|
254
|
+
repeated string promo_codes = 27;
|
|
255
|
+
|
|
252
256
|
string certificate_code = 13;
|
|
253
257
|
bool do_not_call = 14;
|
|
254
258
|
string comment = 15;
|
|
@@ -418,6 +422,33 @@ message EditItemsRequest {
|
|
|
418
422
|
string id = 1;
|
|
419
423
|
repeated OrderItemInput items = 2;
|
|
420
424
|
string actor_id = 3;
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
bool accept_discount_change = 4;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
message PreviewRecalculationRequest {
|
|
432
|
+
string id = 1;
|
|
433
|
+
repeated OrderItemInput items = 2;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
message DiscountChange {
|
|
437
|
+
|
|
438
|
+
string kind = 1;
|
|
439
|
+
string name = 2;
|
|
440
|
+
double before = 3;
|
|
441
|
+
double after = 4;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
message PreviewRecalculationResponse {
|
|
445
|
+
bool ok = 1;
|
|
446
|
+
string error_message = 2;
|
|
447
|
+
OrderTotals before = 3;
|
|
448
|
+
OrderTotals after = 4;
|
|
449
|
+
repeated DiscountChange discount_changes = 5;
|
|
450
|
+
|
|
451
|
+
bool discounts_decreased = 6;
|
|
421
452
|
}
|
|
422
453
|
|
|
423
454
|
message ApplyRecalculationRequest {
|
|
@@ -429,8 +460,11 @@ message ApplyRecalculationRequest {
|
|
|
429
460
|
double coupon_discount = 6;
|
|
430
461
|
double certificate_applied = 7;
|
|
431
462
|
double bonuses_used = 8;
|
|
463
|
+
|
|
432
464
|
double shipping_cost = 9;
|
|
433
465
|
double grand_total = 10;
|
|
466
|
+
|
|
467
|
+
string idempotency_key = 11;
|
|
434
468
|
}
|
|
435
469
|
|
|
436
470
|
message SetTrackingNumberRequest {
|
|
@@ -445,12 +479,20 @@ message ReorderOrderRequest {
|
|
|
445
479
|
string user_id = 2;
|
|
446
480
|
}
|
|
447
481
|
|
|
482
|
+
message ReorderSkippedItem {
|
|
483
|
+
string product_id = 1;
|
|
484
|
+
string variant_id = 2;
|
|
485
|
+
|
|
486
|
+
string reason = 3;
|
|
487
|
+
}
|
|
488
|
+
|
|
448
489
|
message ReorderResponse {
|
|
449
490
|
bool ok = 1;
|
|
450
491
|
string cart_id = 2;
|
|
451
492
|
int32 added = 3;
|
|
452
493
|
int32 skipped = 4;
|
|
453
494
|
string error = 5;
|
|
495
|
+
repeated ReorderSkippedItem skipped_items = 6;
|
|
454
496
|
}
|
|
455
497
|
|
|
456
498
|
message ListHistoryRequest {
|
package/dist/proto/payment.proto
CHANGED
|
@@ -12,6 +12,9 @@ service PaymentService {
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
rpc Capture(CaptureRequest) returns (PaymentResponse);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
rpc MarkPaidOffline(MarkPaidOfflineRequest) returns (PaymentResponse);
|
|
15
18
|
|
|
16
19
|
rpc Cancel(CancelRequest) returns (PaymentResponse);
|
|
17
20
|
|
|
@@ -30,6 +33,10 @@ service PaymentService {
|
|
|
30
33
|
rpc GetProviderConfig(GetProviderConfigRequest) returns (ProviderConfigResponse);
|
|
31
34
|
|
|
32
35
|
rpc UpdateProviderConfig(UpdateProviderConfigRequest) returns (ProviderConfigResponse);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
rpc GetPaymentsMode(GetPaymentsModeRequest) returns (PaymentsModeResponse);
|
|
39
|
+
rpc SetPaymentsMode(SetPaymentsModeRequest) returns (PaymentsModeResponse);
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
|
|
@@ -52,6 +59,10 @@ message Payment {
|
|
|
52
59
|
int64 captured_at = 16;
|
|
53
60
|
int64 cancelled_at = 17;
|
|
54
61
|
int64 refunded_at = 18;
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
string capture_source = 19;
|
|
65
|
+
string capture_note = 20;
|
|
55
66
|
}
|
|
56
67
|
|
|
57
68
|
message PaymentProviderInfo {
|
|
@@ -62,9 +73,14 @@ message PaymentProviderInfo {
|
|
|
62
73
|
string description = 5;
|
|
63
74
|
|
|
64
75
|
bool configured = 6;
|
|
65
|
-
|
|
66
|
-
// 0 для звичайних провайдерів. Фронт показує «до N платежів» без env-синхронізації.
|
|
76
|
+
|
|
67
77
|
int32 installment_max_parts = 7;
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
string environment = 8;
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
bool blocked_by_mode = 9;
|
|
68
84
|
}
|
|
69
85
|
|
|
70
86
|
|
|
@@ -119,6 +135,15 @@ message CaptureRequest {
|
|
|
119
135
|
string actor_id = 3;
|
|
120
136
|
}
|
|
121
137
|
|
|
138
|
+
message MarkPaidOfflineRequest {
|
|
139
|
+
string id = 1;
|
|
140
|
+
|
|
141
|
+
double amount = 2;
|
|
142
|
+
|
|
143
|
+
string note = 3;
|
|
144
|
+
string actor_id = 4;
|
|
145
|
+
}
|
|
146
|
+
|
|
122
147
|
message CancelRequest {
|
|
123
148
|
string id = 1;
|
|
124
149
|
string reason = 2;
|
|
@@ -201,3 +226,25 @@ message UpdateProviderConfigRequest {
|
|
|
201
226
|
repeated ProviderConfigPatch fields = 2;
|
|
202
227
|
string actor_id = 3;
|
|
203
228
|
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
message GetPaymentsModeRequest {}
|
|
232
|
+
|
|
233
|
+
message SetPaymentsModeRequest {
|
|
234
|
+
|
|
235
|
+
string mode = 1;
|
|
236
|
+
string actor_id = 2;
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
string confirmation = 3;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
message PaymentsModeResponse {
|
|
243
|
+
bool ok = 1;
|
|
244
|
+
string mode = 2;
|
|
245
|
+
int64 updated_at = 3;
|
|
246
|
+
string updated_by = 4;
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
repeated string blocked_providers = 5;
|
|
250
|
+
}
|
package/dist/proto/post.proto
CHANGED
|
@@ -42,8 +42,11 @@ message CommentResponse {
|
|
|
42
42
|
message GetCommentsRequest {
|
|
43
43
|
PaginationRequest pagination = 1;
|
|
44
44
|
|
|
45
|
-
optional string post_id = 2;
|
|
46
|
-
optional CommentStatus status = 3;
|
|
45
|
+
optional string post_id = 2;
|
|
46
|
+
optional CommentStatus status = 3;
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
bool public_view = 4;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
message GetCommentsResponse {
|
package/dist/proto/product.proto
CHANGED
|
@@ -189,7 +189,7 @@ message ProductListItemResponse {
|
|
|
189
189
|
|
|
190
190
|
string updated_at = 25;
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
|
|
193
193
|
optional string article1c = 26;
|
|
194
194
|
}
|
|
195
195
|
|
|
@@ -248,6 +248,9 @@ message ProductDetailResponse {
|
|
|
248
248
|
|
|
249
249
|
|
|
250
250
|
repeated string barcodes = 42;
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
map<string, string> seo_text = 43;
|
|
251
254
|
}
|
|
252
255
|
|
|
253
256
|
|
|
@@ -414,6 +417,9 @@ message CreateProductRequest {
|
|
|
414
417
|
map<string, string> color_label = 25;
|
|
415
418
|
optional string color_hex = 26;
|
|
416
419
|
optional double weight_kg = 27;
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
map<string, string> seo_text = 28;
|
|
417
423
|
}
|
|
418
424
|
|
|
419
425
|
message UpdateProductRequest {
|
|
@@ -451,18 +457,13 @@ message UpdateProductRequest {
|
|
|
451
457
|
optional double weight_kg = 26;
|
|
452
458
|
optional string guid1c = 27;
|
|
453
459
|
|
|
454
|
-
|
|
455
|
-
//
|
|
456
|
-
// У proto3 `repeated` не відрізняє «не передано» від «передано порожнім»,
|
|
457
|
-
// тож порожній масив сам по собі означає «не чіпати». Раніше цього
|
|
458
|
-
// розрізнення не було: клієнт, який не надіслав `images`, отримував від
|
|
459
|
-
// gateway [] — і всі фото товару видалялися разом із файлами в S3.
|
|
460
|
-
//
|
|
461
|
-
// Той самий підхід уже застосований в UpdateProductVariantRequest.
|
|
460
|
+
|
|
462
461
|
bool clear_images = 28;
|
|
463
462
|
bool clear_categories = 29;
|
|
464
463
|
bool clear_stickers = 30;
|
|
465
464
|
bool clear_attributes = 31;
|
|
465
|
+
|
|
466
|
+
map<string, string> seo_text = 32;
|
|
466
467
|
}
|
|
467
468
|
|
|
468
469
|
message SetManualRatingRequest {
|
|
@@ -618,9 +619,9 @@ message ProductGroupMember {
|
|
|
618
619
|
double price = 7;
|
|
619
620
|
ProductStatus status = 8;
|
|
620
621
|
|
|
621
|
-
|
|
622
|
+
|
|
622
623
|
string slug = 9;
|
|
623
|
-
|
|
624
|
+
|
|
624
625
|
bool in_stock = 10;
|
|
625
626
|
}
|
|
626
627
|
|
|
@@ -302,6 +302,10 @@ message UpdatePromotionRequest {
|
|
|
302
302
|
optional string cascade_steps = 25;
|
|
303
303
|
optional double bundle_price = 26;
|
|
304
304
|
optional int32 bundle_size = 27;
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
optional bool replace_conditions = 28;
|
|
308
|
+
optional bool replace_exclusions = 29;
|
|
305
309
|
}
|
|
306
310
|
|
|
307
311
|
message DeletePromotionRequest {
|
|
@@ -42,6 +42,8 @@ message SiteSettingsResponse {
|
|
|
42
42
|
|
|
43
43
|
optional string working_hours = 7;
|
|
44
44
|
optional string working_hours_note = 8;
|
|
45
|
+
|
|
46
|
+
optional string size_category_slugs = 9;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
|
|
@@ -62,4 +64,6 @@ message UpdateSiteSettingsRequest {
|
|
|
62
64
|
|
|
63
65
|
optional string working_hours = 9;
|
|
64
66
|
optional string working_hours_note = 10;
|
|
67
|
+
|
|
68
|
+
optional string size_category_slugs = 11;
|
|
65
69
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
export interface OtpRequestedEvent {
|
|
2
|
-
// Target: email або phone (визначається за наявності '@').
|
|
3
2
|
target: string
|
|
4
|
-
|
|
3
|
+
|
|
5
4
|
purpose: string
|
|
6
5
|
code: string
|
|
7
|
-
|
|
6
|
+
|
|
8
7
|
expiresAt: number
|
|
9
8
|
userId?: string
|
|
10
|
-
|
|
9
|
+
|
|
11
10
|
identifier?: string
|
|
12
11
|
type?: string
|
|
13
12
|
}
|
package/events/orders/index.ts
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export interface PaymentCaptureRequestedEvent {
|
|
2
|
+
orderId: string
|
|
3
|
+
orderNumber: string
|
|
4
|
+
providerInvoiceId?: string | null
|
|
5
|
+
|
|
6
|
+
amount: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface PaymentCancelRequestedEvent {
|
|
10
|
+
orderId: string
|
|
11
|
+
orderNumber: string
|
|
12
|
+
providerInvoiceId?: string | null
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface PaymentRefundRequestedEvent {
|
|
16
|
+
orderId: string
|
|
17
|
+
orderNumber: string
|
|
18
|
+
providerInvoiceId?: string | null
|
|
19
|
+
|
|
20
|
+
amount?: string
|
|
21
|
+
reason?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface DeliveryShipmentRequestedEvent {
|
|
25
|
+
orderId: string
|
|
26
|
+
orderNumber: string
|
|
27
|
+
method: string
|
|
28
|
+
|
|
29
|
+
cityRef?: string
|
|
30
|
+
warehouseRef?: string
|
|
31
|
+
address?: string
|
|
32
|
+
recipientName: string
|
|
33
|
+
recipientPhone: string
|
|
34
|
+
items: Array<{
|
|
35
|
+
sku: string
|
|
36
|
+
name: string
|
|
37
|
+
quantity: number
|
|
38
|
+
price: string
|
|
39
|
+
|
|
40
|
+
weightKg?: number
|
|
41
|
+
}>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface PromotionApplyRequestedEvent {
|
|
45
|
+
orderId: string
|
|
46
|
+
userId: string
|
|
47
|
+
|
|
48
|
+
couponCodes?: Array<{
|
|
49
|
+
code: string
|
|
50
|
+
discountAmount: string
|
|
51
|
+
}>
|
|
52
|
+
|
|
53
|
+
couponCode?: string
|
|
54
|
+
couponDiscount?: string
|
|
55
|
+
|
|
56
|
+
promotions?: Array<{
|
|
57
|
+
promotionId: string
|
|
58
|
+
discountAmount: string
|
|
59
|
+
}>
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface OrderTotalsRecalculatedEvent {
|
|
63
|
+
orderId: string
|
|
64
|
+
orderNumber: string
|
|
65
|
+
userId?: string
|
|
66
|
+
source: string
|
|
67
|
+
actorId?: string
|
|
68
|
+
|
|
69
|
+
itemsSubtotal: string
|
|
70
|
+
shippingCost: string
|
|
71
|
+
promoDiscount: string
|
|
72
|
+
couponDiscount: string
|
|
73
|
+
|
|
74
|
+
bonusesBefore: string
|
|
75
|
+
bonusesAfter: string
|
|
76
|
+
certificateBefore: string
|
|
77
|
+
certificateAfter: string
|
|
78
|
+
grandTotalBefore: string
|
|
79
|
+
grandTotalAfter: string
|
|
80
|
+
|
|
81
|
+
recalculatedAt: number
|
|
82
|
+
}
|
package/gen/banner.ts
CHANGED
|
@@ -216,6 +216,8 @@ export interface UpdateBannerSlideRequest {
|
|
|
216
216
|
linksLayout?: string | undefined;
|
|
217
217
|
styling?: string | undefined;
|
|
218
218
|
sortOrder?: number | undefined;
|
|
219
|
+
clearButtons: boolean;
|
|
220
|
+
clearLinks: boolean;
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
export interface UpdateBannerSlideRequest_TitleEntry {
|
|
@@ -245,7 +247,6 @@ export interface UpdateSlideOrderRequest {
|
|
|
245
247
|
export interface GetBannersByPlacementRequest {
|
|
246
248
|
placement: BannerPlacement;
|
|
247
249
|
categoryId?: string | undefined;
|
|
248
|
-
lang?: string | undefined;
|
|
249
250
|
}
|
|
250
251
|
|
|
251
252
|
export interface PublicBannerResponse {
|
|
@@ -258,16 +259,26 @@ export interface PublicBannerResponse {
|
|
|
258
259
|
export interface PublicSlideResponse {
|
|
259
260
|
image: string;
|
|
260
261
|
mobileImage?: string | undefined;
|
|
261
|
-
title
|
|
262
|
-
subtitle
|
|
263
|
-
buttons:
|
|
262
|
+
title: { [key: string]: string };
|
|
263
|
+
subtitle: { [key: string]: string };
|
|
264
|
+
buttons: BannerSlideButton[];
|
|
264
265
|
buttonsPosition?: ElementPosition | undefined;
|
|
265
|
-
links:
|
|
266
|
+
links: BannerSlideLink[];
|
|
266
267
|
linksPosition?: ElementPosition | undefined;
|
|
267
268
|
linksLayout?: string | undefined;
|
|
268
269
|
styling: string;
|
|
269
270
|
}
|
|
270
271
|
|
|
272
|
+
export interface PublicSlideResponse_TitleEntry {
|
|
273
|
+
key: string;
|
|
274
|
+
value: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface PublicSlideResponse_SubtitleEntry {
|
|
278
|
+
key: string;
|
|
279
|
+
value: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
271
282
|
export interface GetBannersByPlacementResponse {
|
|
272
283
|
items: PublicBannerResponse[];
|
|
273
284
|
}
|
|
@@ -312,30 +323,6 @@ export interface BannerSlideLink_TextEntry {
|
|
|
312
323
|
value: string;
|
|
313
324
|
}
|
|
314
325
|
|
|
315
|
-
export interface PublicBannerSlideButton {
|
|
316
|
-
text: string;
|
|
317
|
-
href: string;
|
|
318
|
-
variant?: string | undefined;
|
|
319
|
-
backgroundColor?: string | undefined;
|
|
320
|
-
textColor?: string | undefined;
|
|
321
|
-
borderColor?: string | undefined;
|
|
322
|
-
borderRadius?: string | undefined;
|
|
323
|
-
fontSize?: string | undefined;
|
|
324
|
-
paddingX?: string | undefined;
|
|
325
|
-
paddingY?: string | undefined;
|
|
326
|
-
fontSizeMobile?: string | undefined;
|
|
327
|
-
paddingXMobile?: string | undefined;
|
|
328
|
-
paddingYMobile?: string | undefined;
|
|
329
|
-
textAlign?: string | undefined;
|
|
330
|
-
textAlignMobile?: string | undefined;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
export interface PublicBannerSlideLink {
|
|
334
|
-
text: string;
|
|
335
|
-
href: string;
|
|
336
|
-
categoryId?: string | undefined;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
326
|
export const CONTENT_V1_PACKAGE_NAME = "content.v1";
|
|
340
327
|
|
|
341
328
|
export interface BannerServiceClient {
|
package/gen/calculation.ts
CHANGED
|
@@ -7,16 +7,34 @@
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
|
-
import { SuccessResponse } from "./common_promo";
|
|
11
10
|
|
|
12
11
|
export const protobufPackage = "promo.v1";
|
|
13
12
|
|
|
13
|
+
export interface ValidateCouponRequest {
|
|
14
|
+
code: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
items: CartItem[];
|
|
17
|
+
orderTotal: number;
|
|
18
|
+
isFirstOrder: boolean;
|
|
19
|
+
orderCount: number;
|
|
20
|
+
userGroups: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ValidateCouponResponse {
|
|
24
|
+
usable: boolean;
|
|
25
|
+
reason: string;
|
|
26
|
+
permanent: boolean;
|
|
27
|
+
discountAmount: number;
|
|
28
|
+
minOrderAmount: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
14
31
|
export interface CartItem {
|
|
15
32
|
productId: string;
|
|
16
33
|
categoryId: string;
|
|
17
34
|
brandId: string;
|
|
18
35
|
quantity: number;
|
|
19
36
|
price: number;
|
|
37
|
+
categoryIds: string[];
|
|
20
38
|
}
|
|
21
39
|
|
|
22
40
|
export interface ValidateAndCalculateRequest {
|
|
@@ -38,7 +56,9 @@ export interface ValidateAndCalculateResponse {
|
|
|
38
56
|
appliedCoupon?: AppliedCoupon | undefined;
|
|
39
57
|
errorMessage?: string | undefined;
|
|
40
58
|
couponError?: string | undefined;
|
|
59
|
+
couponErrorReason?: string | undefined;
|
|
41
60
|
giftSuggestions: GiftSuggestion[];
|
|
61
|
+
appliedCoupons: AppliedCoupon[];
|
|
42
62
|
}
|
|
43
63
|
|
|
44
64
|
export interface GiftSuggestion {
|
|
@@ -62,20 +82,12 @@ export interface AppliedCoupon {
|
|
|
62
82
|
discountAmount: number;
|
|
63
83
|
}
|
|
64
84
|
|
|
65
|
-
export interface ApplyPromotionRequest {
|
|
66
|
-
userId: string;
|
|
67
|
-
orderId: string;
|
|
68
|
-
discountAmount: number;
|
|
69
|
-
couponCode?: string | undefined;
|
|
70
|
-
promotionIds: string[];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
85
|
export const PROMO_V1_PACKAGE_NAME = "promo.v1";
|
|
74
86
|
|
|
75
87
|
export interface PromoCalculationServiceClient {
|
|
76
88
|
validateAndCalculate(request: ValidateAndCalculateRequest): Observable<ValidateAndCalculateResponse>;
|
|
77
89
|
|
|
78
|
-
|
|
90
|
+
validateCoupon(request: ValidateCouponRequest): Observable<ValidateCouponResponse>;
|
|
79
91
|
}
|
|
80
92
|
|
|
81
93
|
export interface PromoCalculationServiceController {
|
|
@@ -83,14 +95,14 @@ export interface PromoCalculationServiceController {
|
|
|
83
95
|
request: ValidateAndCalculateRequest,
|
|
84
96
|
): Promise<ValidateAndCalculateResponse> | Observable<ValidateAndCalculateResponse> | ValidateAndCalculateResponse;
|
|
85
97
|
|
|
86
|
-
|
|
87
|
-
request:
|
|
88
|
-
): Promise<
|
|
98
|
+
validateCoupon(
|
|
99
|
+
request: ValidateCouponRequest,
|
|
100
|
+
): Promise<ValidateCouponResponse> | Observable<ValidateCouponResponse> | ValidateCouponResponse;
|
|
89
101
|
}
|
|
90
102
|
|
|
91
103
|
export function PromoCalculationServiceControllerMethods() {
|
|
92
104
|
return function (constructor: Function) {
|
|
93
|
-
const grpcMethods: string[] = ["validateAndCalculate", "
|
|
105
|
+
const grpcMethods: string[] = ["validateAndCalculate", "validateCoupon"];
|
|
94
106
|
for (const method of grpcMethods) {
|
|
95
107
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
96
108
|
GrpcMethod("PromoCalculationService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/cart.ts
CHANGED
|
@@ -28,6 +28,8 @@ export interface CartItem {
|
|
|
28
28
|
lineDiscount: number;
|
|
29
29
|
lineTotal: number;
|
|
30
30
|
size: string;
|
|
31
|
+
unavailable: boolean;
|
|
32
|
+
availableStock: number;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export interface AppliedPromotion {
|
|
@@ -55,6 +57,7 @@ export interface AppliedCertificate {
|
|
|
55
57
|
export interface AppliedBonuses {
|
|
56
58
|
available: number;
|
|
57
59
|
applied: number;
|
|
60
|
+
requested: number;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
export interface Recipient {
|
|
@@ -136,6 +139,8 @@ export interface WishlistItem {
|
|
|
136
139
|
|
|
137
140
|
export interface WishlistResponse {
|
|
138
141
|
items: WishlistItem[];
|
|
142
|
+
ok: boolean;
|
|
143
|
+
errorMessage: string;
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
export interface CartOwner {
|
|
@@ -163,6 +168,32 @@ export interface AddItemRequest {
|
|
|
163
168
|
quantity: number;
|
|
164
169
|
}
|
|
165
170
|
|
|
171
|
+
export interface AddItemInput {
|
|
172
|
+
productId: string;
|
|
173
|
+
variantId: string;
|
|
174
|
+
quantity: number;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface AddItemsRequest {
|
|
178
|
+
owner: CartOwner | undefined;
|
|
179
|
+
items: AddItemInput[];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface AddItemResult {
|
|
183
|
+
productId: string;
|
|
184
|
+
variantId: string;
|
|
185
|
+
ok: boolean;
|
|
186
|
+
reason: string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface AddItemsResponse {
|
|
190
|
+
ok: boolean;
|
|
191
|
+
cart: Cart | undefined;
|
|
192
|
+
errorMessage: string;
|
|
193
|
+
results: AddItemResult[];
|
|
194
|
+
errorCode: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
166
197
|
export interface UpdateItemQtyRequest {
|
|
167
198
|
owner: CartOwner | undefined;
|
|
168
199
|
variantId: string;
|
|
@@ -234,6 +265,7 @@ export interface SetCheckoutDraftRequest {
|
|
|
234
265
|
hasDelivery: boolean;
|
|
235
266
|
hasPayment: boolean;
|
|
236
267
|
hasComment: boolean;
|
|
268
|
+
hasDoNotCall: boolean;
|
|
237
269
|
}
|
|
238
270
|
|
|
239
271
|
export interface RecalculateRequest {
|
|
@@ -259,6 +291,7 @@ export interface CartResponse {
|
|
|
259
291
|
ok: boolean;
|
|
260
292
|
cart: Cart | undefined;
|
|
261
293
|
errorMessage: string;
|
|
294
|
+
errorCode: string;
|
|
262
295
|
}
|
|
263
296
|
|
|
264
297
|
export interface SuccessResponse {
|
|
@@ -272,6 +305,8 @@ export interface CartServiceClient {
|
|
|
272
305
|
|
|
273
306
|
addItem(request: AddItemRequest): Observable<CartResponse>;
|
|
274
307
|
|
|
308
|
+
addItems(request: AddItemsRequest): Observable<AddItemsResponse>;
|
|
309
|
+
|
|
275
310
|
updateItemQty(request: UpdateItemQtyRequest): Observable<CartResponse>;
|
|
276
311
|
|
|
277
312
|
removeItem(request: RemoveItemRequest): Observable<CartResponse>;
|
|
@@ -318,6 +353,8 @@ export interface CartServiceController {
|
|
|
318
353
|
|
|
319
354
|
addItem(request: AddItemRequest): Promise<CartResponse> | Observable<CartResponse> | CartResponse;
|
|
320
355
|
|
|
356
|
+
addItems(request: AddItemsRequest): Promise<AddItemsResponse> | Observable<AddItemsResponse> | AddItemsResponse;
|
|
357
|
+
|
|
321
358
|
updateItemQty(request: UpdateItemQtyRequest): Promise<CartResponse> | Observable<CartResponse> | CartResponse;
|
|
322
359
|
|
|
323
360
|
removeItem(request: RemoveItemRequest): Promise<CartResponse> | Observable<CartResponse> | CartResponse;
|
|
@@ -372,6 +409,7 @@ export function CartServiceControllerMethods() {
|
|
|
372
409
|
const grpcMethods: string[] = [
|
|
373
410
|
"getCart",
|
|
374
411
|
"addItem",
|
|
412
|
+
"addItems",
|
|
375
413
|
"updateItemQty",
|
|
376
414
|
"removeItem",
|
|
377
415
|
"clearCart",
|
package/gen/category.ts
CHANGED
|
@@ -196,6 +196,7 @@ export interface UpdateCategoryRequest {
|
|
|
196
196
|
metaKeywords: { [key: string]: string };
|
|
197
197
|
metaH1: { [key: string]: string };
|
|
198
198
|
imageId?: string | undefined;
|
|
199
|
+
guid1c?: string | undefined;
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
export interface UpdateCategoryRequest_NameEntry {
|
package/gen/coupon.ts
CHANGED