@mamindom/contracts 1.0.102 → 1.0.104
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/bundle.d.ts +50 -0
- package/dist/gen/bundle.js +13 -1
- package/dist/gen/calculation.d.ts +2 -0
- package/dist/gen/promotion.d.ts +14 -0
- package/dist/gen/promotion.js +2 -0
- package/dist/proto/bundle.proto +49 -0
- package/dist/proto/calculation.proto +8 -6
- package/dist/proto/promotion.proto +21 -7
- package/gen/bundle.ts +73 -0
- package/gen/calculation.ts +2 -0
- package/gen/promotion.ts +14 -0
- package/package.json +1 -1
- package/proto/bundle.proto +49 -0
- package/proto/calculation.proto +8 -6
- package/proto/promotion.proto +21 -7
package/dist/gen/bundle.d.ts
CHANGED
|
@@ -39,6 +39,14 @@ export declare enum RuleOperator {
|
|
|
39
39
|
RULE_OPERATOR_ALL = 1,
|
|
40
40
|
UNRECOGNIZED = -1
|
|
41
41
|
}
|
|
42
|
+
export declare enum BundleRelatedType {
|
|
43
|
+
BUNDLE_RELATED_TYPE_UNSPECIFIED = 0,
|
|
44
|
+
BUNDLE_RELATED_TYPE_CROSS_SELL = 1,
|
|
45
|
+
BUNDLE_RELATED_TYPE_UP_SELL = 2,
|
|
46
|
+
BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER = 3,
|
|
47
|
+
BUNDLE_RELATED_TYPE_POPULAR = 4,
|
|
48
|
+
UNRECOGNIZED = -1
|
|
49
|
+
}
|
|
42
50
|
export interface GetBundlesRequest {
|
|
43
51
|
pagination: PaginationRequest | undefined;
|
|
44
52
|
search?: string | undefined;
|
|
@@ -398,6 +406,42 @@ export interface BundleLookupResult {
|
|
|
398
406
|
export interface BulkLookupBundlesResponse {
|
|
399
407
|
results: BundleLookupResult[];
|
|
400
408
|
}
|
|
409
|
+
export interface BundleRelatedItem {
|
|
410
|
+
productId: string;
|
|
411
|
+
sku: string;
|
|
412
|
+
slug: string;
|
|
413
|
+
name: {
|
|
414
|
+
[key: string]: string;
|
|
415
|
+
};
|
|
416
|
+
mainImage: string;
|
|
417
|
+
price: number;
|
|
418
|
+
totalStock: number;
|
|
419
|
+
type: BundleRelatedType;
|
|
420
|
+
}
|
|
421
|
+
export interface BundleRelatedItem_NameEntry {
|
|
422
|
+
key: string;
|
|
423
|
+
value: string;
|
|
424
|
+
}
|
|
425
|
+
export interface GetBundleRelatedProductsRequest {
|
|
426
|
+
bundleId: string;
|
|
427
|
+
type?: BundleRelatedType | undefined;
|
|
428
|
+
}
|
|
429
|
+
export interface GetBundleRelatedProductsResponse {
|
|
430
|
+
crossSell: BundleRelatedItem[];
|
|
431
|
+
upSell: BundleRelatedItem[];
|
|
432
|
+
boughtTogether: BundleRelatedItem[];
|
|
433
|
+
popular: BundleRelatedItem[];
|
|
434
|
+
}
|
|
435
|
+
export interface SetBundleRelatedProductsRequest {
|
|
436
|
+
bundleId: string;
|
|
437
|
+
type: BundleRelatedType;
|
|
438
|
+
relatedProductIds: string[];
|
|
439
|
+
}
|
|
440
|
+
export interface RemoveBundleRelatedProductRequest {
|
|
441
|
+
bundleId: string;
|
|
442
|
+
relatedProductId: string;
|
|
443
|
+
type: BundleRelatedType;
|
|
444
|
+
}
|
|
401
445
|
export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
402
446
|
export interface BundleServiceClient {
|
|
403
447
|
getBundles(request: GetBundlesRequest): Observable<GetBundlesResponse>;
|
|
@@ -421,6 +465,9 @@ export interface BundleServiceClient {
|
|
|
421
465
|
addCrossSellLink(request: AddCrossSellLinkRequest): Observable<SuccessResponse>;
|
|
422
466
|
generateBundleCollage(request: GenerateBundleCollageRequest): Observable<GenerateBundleCollageResponse>;
|
|
423
467
|
bulkLookupBundles(request: BulkLookupBundlesRequest): Observable<BulkLookupBundlesResponse>;
|
|
468
|
+
getBundleRelatedProducts(request: GetBundleRelatedProductsRequest): Observable<GetBundleRelatedProductsResponse>;
|
|
469
|
+
setBundleRelatedProducts(request: SetBundleRelatedProductsRequest): Observable<SuccessResponse>;
|
|
470
|
+
removeBundleRelatedProduct(request: RemoveBundleRelatedProductRequest): Observable<SuccessResponse>;
|
|
424
471
|
}
|
|
425
472
|
export interface BundleServiceController {
|
|
426
473
|
getBundles(request: GetBundlesRequest): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
|
|
@@ -444,6 +491,9 @@ export interface BundleServiceController {
|
|
|
444
491
|
addCrossSellLink(request: AddCrossSellLinkRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
445
492
|
generateBundleCollage(request: GenerateBundleCollageRequest): Promise<GenerateBundleCollageResponse> | Observable<GenerateBundleCollageResponse> | GenerateBundleCollageResponse;
|
|
446
493
|
bulkLookupBundles(request: BulkLookupBundlesRequest): Promise<BulkLookupBundlesResponse> | Observable<BulkLookupBundlesResponse> | BulkLookupBundlesResponse;
|
|
494
|
+
getBundleRelatedProducts(request: GetBundleRelatedProductsRequest): Promise<GetBundleRelatedProductsResponse> | Observable<GetBundleRelatedProductsResponse> | GetBundleRelatedProductsResponse;
|
|
495
|
+
setBundleRelatedProducts(request: SetBundleRelatedProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
496
|
+
removeBundleRelatedProduct(request: RemoveBundleRelatedProductRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
447
497
|
}
|
|
448
498
|
export declare function BundleServiceControllerMethods(): (constructor: Function) => void;
|
|
449
499
|
export declare const BUNDLE_SERVICE_NAME = "BundleService";
|
package/dist/gen/bundle.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: bundle.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.BUNDLE_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.RuleOperator = exports.BundleType = exports.PriceMode = exports.DisplayPlacement = exports.DiscountType = exports.BundleStatus = exports.protobufPackage = void 0;
|
|
8
|
+
exports.BUNDLE_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.BundleRelatedType = exports.RuleOperator = exports.BundleType = exports.PriceMode = exports.DisplayPlacement = exports.DiscountType = exports.BundleStatus = exports.protobufPackage = void 0;
|
|
9
9
|
exports.BundleServiceControllerMethods = BundleServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
@@ -54,6 +54,15 @@ var RuleOperator;
|
|
|
54
54
|
RuleOperator[RuleOperator["RULE_OPERATOR_ALL"] = 1] = "RULE_OPERATOR_ALL";
|
|
55
55
|
RuleOperator[RuleOperator["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
56
56
|
})(RuleOperator || (exports.RuleOperator = RuleOperator = {}));
|
|
57
|
+
var BundleRelatedType;
|
|
58
|
+
(function (BundleRelatedType) {
|
|
59
|
+
BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_UNSPECIFIED"] = 0] = "BUNDLE_RELATED_TYPE_UNSPECIFIED";
|
|
60
|
+
BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_CROSS_SELL"] = 1] = "BUNDLE_RELATED_TYPE_CROSS_SELL";
|
|
61
|
+
BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_UP_SELL"] = 2] = "BUNDLE_RELATED_TYPE_UP_SELL";
|
|
62
|
+
BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER"] = 3] = "BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER";
|
|
63
|
+
BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_POPULAR"] = 4] = "BUNDLE_RELATED_TYPE_POPULAR";
|
|
64
|
+
BundleRelatedType[BundleRelatedType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
65
|
+
})(BundleRelatedType || (exports.BundleRelatedType = BundleRelatedType = {}));
|
|
57
66
|
exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
58
67
|
function BundleServiceControllerMethods() {
|
|
59
68
|
return function (constructor) {
|
|
@@ -79,6 +88,9 @@ function BundleServiceControllerMethods() {
|
|
|
79
88
|
"addCrossSellLink",
|
|
80
89
|
"generateBundleCollage",
|
|
81
90
|
"bulkLookupBundles",
|
|
91
|
+
"getBundleRelatedProducts",
|
|
92
|
+
"setBundleRelatedProducts",
|
|
93
|
+
"removeBundleRelatedProduct",
|
|
82
94
|
];
|
|
83
95
|
for (const method of grpcMethods) {
|
|
84
96
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/dist/gen/promotion.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare enum PromotionType {
|
|
|
14
14
|
PROMOTION_TYPE_CASCADE_BUNDLE = 9,
|
|
15
15
|
PROMOTION_TYPE_BUNDLE_FIXED_PRICE = 10,
|
|
16
16
|
PROMOTION_TYPE_N_ITEMS_FIXED = 11,
|
|
17
|
+
PROMOTION_TYPE_COMBO_SET = 12,
|
|
18
|
+
PROMOTION_TYPE_POSITIONAL = 13,
|
|
17
19
|
UNRECOGNIZED = -1
|
|
18
20
|
}
|
|
19
21
|
export declare enum DiscountType {
|
|
@@ -116,6 +118,10 @@ export interface PromotionResponse {
|
|
|
116
118
|
categoryIds: string[];
|
|
117
119
|
brandIds: string[];
|
|
118
120
|
daysUntilExpiry?: number | undefined;
|
|
121
|
+
positionSteps?: string | undefined;
|
|
122
|
+
cascadeSteps?: string | undefined;
|
|
123
|
+
bundlePrice?: number | undefined;
|
|
124
|
+
bundleSize?: number | undefined;
|
|
119
125
|
}
|
|
120
126
|
export interface PromotionResponse_NameEntry {
|
|
121
127
|
key: string;
|
|
@@ -208,6 +214,10 @@ export interface CreatePromotionRequest {
|
|
|
208
214
|
imageUrl?: string | undefined;
|
|
209
215
|
imageId?: string | undefined;
|
|
210
216
|
priority?: number | undefined;
|
|
217
|
+
positionSteps?: string | undefined;
|
|
218
|
+
cascadeSteps?: string | undefined;
|
|
219
|
+
bundlePrice?: number | undefined;
|
|
220
|
+
bundleSize?: number | undefined;
|
|
211
221
|
}
|
|
212
222
|
export interface CreatePromotionRequest_NameEntry {
|
|
213
223
|
key: string;
|
|
@@ -257,6 +267,10 @@ export interface UpdatePromotionRequest {
|
|
|
257
267
|
imageUrl?: string | undefined;
|
|
258
268
|
imageId?: string | undefined;
|
|
259
269
|
priority?: number | undefined;
|
|
270
|
+
positionSteps?: string | undefined;
|
|
271
|
+
cascadeSteps?: string | undefined;
|
|
272
|
+
bundlePrice?: number | undefined;
|
|
273
|
+
bundleSize?: number | undefined;
|
|
260
274
|
}
|
|
261
275
|
export interface UpdatePromotionRequest_NameEntry {
|
|
262
276
|
key: string;
|
package/dist/gen/promotion.js
CHANGED
|
@@ -24,6 +24,8 @@ var PromotionType;
|
|
|
24
24
|
PromotionType[PromotionType["PROMOTION_TYPE_CASCADE_BUNDLE"] = 9] = "PROMOTION_TYPE_CASCADE_BUNDLE";
|
|
25
25
|
PromotionType[PromotionType["PROMOTION_TYPE_BUNDLE_FIXED_PRICE"] = 10] = "PROMOTION_TYPE_BUNDLE_FIXED_PRICE";
|
|
26
26
|
PromotionType[PromotionType["PROMOTION_TYPE_N_ITEMS_FIXED"] = 11] = "PROMOTION_TYPE_N_ITEMS_FIXED";
|
|
27
|
+
PromotionType[PromotionType["PROMOTION_TYPE_COMBO_SET"] = 12] = "PROMOTION_TYPE_COMBO_SET";
|
|
28
|
+
PromotionType[PromotionType["PROMOTION_TYPE_POSITIONAL"] = 13] = "PROMOTION_TYPE_POSITIONAL";
|
|
27
29
|
PromotionType[PromotionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
28
30
|
})(PromotionType || (exports.PromotionType = PromotionType = {}));
|
|
29
31
|
var DiscountType;
|
package/dist/proto/bundle.proto
CHANGED
|
@@ -35,6 +35,10 @@ service BundleService {
|
|
|
35
35
|
rpc GenerateBundleCollage (GenerateBundleCollageRequest) returns (GenerateBundleCollageResponse);
|
|
36
36
|
|
|
37
37
|
rpc BulkLookupBundles (BulkLookupBundlesRequest) returns (BulkLookupBundlesResponse);
|
|
38
|
+
|
|
39
|
+
rpc GetBundleRelatedProducts (GetBundleRelatedProductsRequest) returns (GetBundleRelatedProductsResponse);
|
|
40
|
+
rpc SetBundleRelatedProducts (SetBundleRelatedProductsRequest) returns (SuccessResponse);
|
|
41
|
+
rpc RemoveBundleRelatedProduct (RemoveBundleRelatedProductRequest) returns (SuccessResponse);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
|
|
@@ -390,3 +394,48 @@ message BundleLookupResult {
|
|
|
390
394
|
message BulkLookupBundlesResponse {
|
|
391
395
|
repeated BundleLookupResult results = 1;
|
|
392
396
|
}
|
|
397
|
+
|
|
398
|
+
// ── Bundle Related Products ──────────────────────────────────────────────────
|
|
399
|
+
|
|
400
|
+
enum BundleRelatedType {
|
|
401
|
+
BUNDLE_RELATED_TYPE_UNSPECIFIED = 0;
|
|
402
|
+
BUNDLE_RELATED_TYPE_CROSS_SELL = 1;
|
|
403
|
+
BUNDLE_RELATED_TYPE_UP_SELL = 2;
|
|
404
|
+
BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER = 3;
|
|
405
|
+
BUNDLE_RELATED_TYPE_POPULAR = 4;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
message BundleRelatedItem {
|
|
409
|
+
string product_id = 1;
|
|
410
|
+
string sku = 2;
|
|
411
|
+
string slug = 3;
|
|
412
|
+
map<string, string> name = 4;
|
|
413
|
+
string main_image = 5;
|
|
414
|
+
double price = 6;
|
|
415
|
+
int32 total_stock = 7;
|
|
416
|
+
BundleRelatedType type = 8;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
message GetBundleRelatedProductsRequest {
|
|
420
|
+
string bundle_id = 1;
|
|
421
|
+
optional BundleRelatedType type = 2;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
message GetBundleRelatedProductsResponse {
|
|
425
|
+
repeated BundleRelatedItem cross_sell = 1;
|
|
426
|
+
repeated BundleRelatedItem up_sell = 2;
|
|
427
|
+
repeated BundleRelatedItem bought_together = 3;
|
|
428
|
+
repeated BundleRelatedItem popular = 4;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
message SetBundleRelatedProductsRequest {
|
|
432
|
+
string bundle_id = 1;
|
|
433
|
+
BundleRelatedType type = 2;
|
|
434
|
+
repeated string related_product_ids = 3;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
message RemoveBundleRelatedProductRequest {
|
|
438
|
+
string bundle_id = 1;
|
|
439
|
+
string related_product_id = 2;
|
|
440
|
+
BundleRelatedType type = 3;
|
|
441
|
+
}
|
|
@@ -24,12 +24,14 @@ message CartItem {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
message ValidateAndCalculateRequest {
|
|
27
|
-
string user_id
|
|
28
|
-
repeated CartItem items
|
|
29
|
-
double order_total
|
|
30
|
-
optional string coupon_code
|
|
31
|
-
bool is_first_order = 5;
|
|
32
|
-
int32 order_count
|
|
27
|
+
string user_id = 1;
|
|
28
|
+
repeated CartItem items = 2;
|
|
29
|
+
double order_total = 3;
|
|
30
|
+
optional string coupon_code = 4;
|
|
31
|
+
bool is_first_order = 5;
|
|
32
|
+
int32 order_count = 6;
|
|
33
|
+
repeated string user_groups = 7;
|
|
34
|
+
repeated string coupon_codes = 8;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
message ValidateAndCalculateResponse {
|
|
@@ -53,6 +53,8 @@ enum PromotionType {
|
|
|
53
53
|
PROMOTION_TYPE_CASCADE_BUNDLE = 9;
|
|
54
54
|
PROMOTION_TYPE_BUNDLE_FIXED_PRICE = 10;
|
|
55
55
|
PROMOTION_TYPE_N_ITEMS_FIXED = 11;
|
|
56
|
+
PROMOTION_TYPE_COMBO_SET = 12;
|
|
57
|
+
PROMOTION_TYPE_POSITIONAL = 13;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
enum DiscountType {
|
|
@@ -166,7 +168,11 @@ message PromotionResponse {
|
|
|
166
168
|
int32 product_count = 29;
|
|
167
169
|
repeated string category_ids = 30;
|
|
168
170
|
repeated string brand_ids = 31;
|
|
169
|
-
optional int32 days_until_expiry
|
|
171
|
+
optional int32 days_until_expiry = 32;
|
|
172
|
+
optional string position_steps = 33;
|
|
173
|
+
optional string cascade_steps = 34;
|
|
174
|
+
optional double bundle_price = 35;
|
|
175
|
+
optional int32 bundle_size = 36;
|
|
170
176
|
}
|
|
171
177
|
|
|
172
178
|
|
|
@@ -244,9 +250,13 @@ message CreatePromotionRequest {
|
|
|
244
250
|
repeated PromotionConditionPayload conditions = 19;
|
|
245
251
|
repeated PromotionExclusionPayload exclusions = 20;
|
|
246
252
|
|
|
247
|
-
optional string image_url
|
|
248
|
-
optional string image_id
|
|
249
|
-
optional int32 priority
|
|
253
|
+
optional string image_url = 21;
|
|
254
|
+
optional string image_id = 22;
|
|
255
|
+
optional int32 priority = 23;
|
|
256
|
+
optional string position_steps = 24;
|
|
257
|
+
optional string cascade_steps = 25;
|
|
258
|
+
optional double bundle_price = 26;
|
|
259
|
+
optional int32 bundle_size = 27;
|
|
250
260
|
}
|
|
251
261
|
|
|
252
262
|
message UpdatePromotionRequest {
|
|
@@ -279,9 +289,13 @@ message UpdatePromotionRequest {
|
|
|
279
289
|
repeated PromotionConditionPayload conditions = 19;
|
|
280
290
|
repeated PromotionExclusionPayload exclusions = 20;
|
|
281
291
|
|
|
282
|
-
optional string image_url
|
|
283
|
-
optional string image_id
|
|
284
|
-
optional int32 priority
|
|
292
|
+
optional string image_url = 21;
|
|
293
|
+
optional string image_id = 22;
|
|
294
|
+
optional int32 priority = 23;
|
|
295
|
+
optional string position_steps = 24;
|
|
296
|
+
optional string cascade_steps = 25;
|
|
297
|
+
optional double bundle_price = 26;
|
|
298
|
+
optional int32 bundle_size = 27;
|
|
285
299
|
}
|
|
286
300
|
|
|
287
301
|
message DeletePromotionRequest {
|
package/gen/bundle.ts
CHANGED
|
@@ -55,6 +55,15 @@ export enum RuleOperator {
|
|
|
55
55
|
UNRECOGNIZED = -1,
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
export enum BundleRelatedType {
|
|
59
|
+
BUNDLE_RELATED_TYPE_UNSPECIFIED = 0,
|
|
60
|
+
BUNDLE_RELATED_TYPE_CROSS_SELL = 1,
|
|
61
|
+
BUNDLE_RELATED_TYPE_UP_SELL = 2,
|
|
62
|
+
BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER = 3,
|
|
63
|
+
BUNDLE_RELATED_TYPE_POPULAR = 4,
|
|
64
|
+
UNRECOGNIZED = -1,
|
|
65
|
+
}
|
|
66
|
+
|
|
58
67
|
export interface GetBundlesRequest {
|
|
59
68
|
pagination: PaginationRequest | undefined;
|
|
60
69
|
search?: string | undefined;
|
|
@@ -431,6 +440,46 @@ export interface BulkLookupBundlesResponse {
|
|
|
431
440
|
results: BundleLookupResult[];
|
|
432
441
|
}
|
|
433
442
|
|
|
443
|
+
export interface BundleRelatedItem {
|
|
444
|
+
productId: string;
|
|
445
|
+
sku: string;
|
|
446
|
+
slug: string;
|
|
447
|
+
name: { [key: string]: string };
|
|
448
|
+
mainImage: string;
|
|
449
|
+
price: number;
|
|
450
|
+
totalStock: number;
|
|
451
|
+
type: BundleRelatedType;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export interface BundleRelatedItem_NameEntry {
|
|
455
|
+
key: string;
|
|
456
|
+
value: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export interface GetBundleRelatedProductsRequest {
|
|
460
|
+
bundleId: string;
|
|
461
|
+
type?: BundleRelatedType | undefined;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export interface GetBundleRelatedProductsResponse {
|
|
465
|
+
crossSell: BundleRelatedItem[];
|
|
466
|
+
upSell: BundleRelatedItem[];
|
|
467
|
+
boughtTogether: BundleRelatedItem[];
|
|
468
|
+
popular: BundleRelatedItem[];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export interface SetBundleRelatedProductsRequest {
|
|
472
|
+
bundleId: string;
|
|
473
|
+
type: BundleRelatedType;
|
|
474
|
+
relatedProductIds: string[];
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export interface RemoveBundleRelatedProductRequest {
|
|
478
|
+
bundleId: string;
|
|
479
|
+
relatedProductId: string;
|
|
480
|
+
type: BundleRelatedType;
|
|
481
|
+
}
|
|
482
|
+
|
|
434
483
|
export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
435
484
|
|
|
436
485
|
export interface BundleServiceClient {
|
|
@@ -475,6 +524,12 @@ export interface BundleServiceClient {
|
|
|
475
524
|
generateBundleCollage(request: GenerateBundleCollageRequest): Observable<GenerateBundleCollageResponse>;
|
|
476
525
|
|
|
477
526
|
bulkLookupBundles(request: BulkLookupBundlesRequest): Observable<BulkLookupBundlesResponse>;
|
|
527
|
+
|
|
528
|
+
getBundleRelatedProducts(request: GetBundleRelatedProductsRequest): Observable<GetBundleRelatedProductsResponse>;
|
|
529
|
+
|
|
530
|
+
setBundleRelatedProducts(request: SetBundleRelatedProductsRequest): Observable<SuccessResponse>;
|
|
531
|
+
|
|
532
|
+
removeBundleRelatedProduct(request: RemoveBundleRelatedProductRequest): Observable<SuccessResponse>;
|
|
478
533
|
}
|
|
479
534
|
|
|
480
535
|
export interface BundleServiceController {
|
|
@@ -559,6 +614,21 @@ export interface BundleServiceController {
|
|
|
559
614
|
bulkLookupBundles(
|
|
560
615
|
request: BulkLookupBundlesRequest,
|
|
561
616
|
): Promise<BulkLookupBundlesResponse> | Observable<BulkLookupBundlesResponse> | BulkLookupBundlesResponse;
|
|
617
|
+
|
|
618
|
+
getBundleRelatedProducts(
|
|
619
|
+
request: GetBundleRelatedProductsRequest,
|
|
620
|
+
):
|
|
621
|
+
| Promise<GetBundleRelatedProductsResponse>
|
|
622
|
+
| Observable<GetBundleRelatedProductsResponse>
|
|
623
|
+
| GetBundleRelatedProductsResponse;
|
|
624
|
+
|
|
625
|
+
setBundleRelatedProducts(
|
|
626
|
+
request: SetBundleRelatedProductsRequest,
|
|
627
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
628
|
+
|
|
629
|
+
removeBundleRelatedProduct(
|
|
630
|
+
request: RemoveBundleRelatedProductRequest,
|
|
631
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
562
632
|
}
|
|
563
633
|
|
|
564
634
|
export function BundleServiceControllerMethods() {
|
|
@@ -585,6 +655,9 @@ export function BundleServiceControllerMethods() {
|
|
|
585
655
|
"addCrossSellLink",
|
|
586
656
|
"generateBundleCollage",
|
|
587
657
|
"bulkLookupBundles",
|
|
658
|
+
"getBundleRelatedProducts",
|
|
659
|
+
"setBundleRelatedProducts",
|
|
660
|
+
"removeBundleRelatedProduct",
|
|
588
661
|
];
|
|
589
662
|
for (const method of grpcMethods) {
|
|
590
663
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/gen/calculation.ts
CHANGED
package/gen/promotion.ts
CHANGED
|
@@ -24,6 +24,8 @@ export enum PromotionType {
|
|
|
24
24
|
PROMOTION_TYPE_CASCADE_BUNDLE = 9,
|
|
25
25
|
PROMOTION_TYPE_BUNDLE_FIXED_PRICE = 10,
|
|
26
26
|
PROMOTION_TYPE_N_ITEMS_FIXED = 11,
|
|
27
|
+
PROMOTION_TYPE_COMBO_SET = 12,
|
|
28
|
+
PROMOTION_TYPE_POSITIONAL = 13,
|
|
27
29
|
UNRECOGNIZED = -1,
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -128,6 +130,10 @@ export interface PromotionResponse {
|
|
|
128
130
|
categoryIds: string[];
|
|
129
131
|
brandIds: string[];
|
|
130
132
|
daysUntilExpiry?: number | undefined;
|
|
133
|
+
positionSteps?: string | undefined;
|
|
134
|
+
cascadeSteps?: string | undefined;
|
|
135
|
+
bundlePrice?: number | undefined;
|
|
136
|
+
bundleSize?: number | undefined;
|
|
131
137
|
}
|
|
132
138
|
|
|
133
139
|
export interface PromotionResponse_NameEntry {
|
|
@@ -224,6 +230,10 @@ export interface CreatePromotionRequest {
|
|
|
224
230
|
imageUrl?: string | undefined;
|
|
225
231
|
imageId?: string | undefined;
|
|
226
232
|
priority?: number | undefined;
|
|
233
|
+
positionSteps?: string | undefined;
|
|
234
|
+
cascadeSteps?: string | undefined;
|
|
235
|
+
bundlePrice?: number | undefined;
|
|
236
|
+
bundleSize?: number | undefined;
|
|
227
237
|
}
|
|
228
238
|
|
|
229
239
|
export interface CreatePromotionRequest_NameEntry {
|
|
@@ -270,6 +280,10 @@ export interface UpdatePromotionRequest {
|
|
|
270
280
|
imageUrl?: string | undefined;
|
|
271
281
|
imageId?: string | undefined;
|
|
272
282
|
priority?: number | undefined;
|
|
283
|
+
positionSteps?: string | undefined;
|
|
284
|
+
cascadeSteps?: string | undefined;
|
|
285
|
+
bundlePrice?: number | undefined;
|
|
286
|
+
bundleSize?: number | undefined;
|
|
273
287
|
}
|
|
274
288
|
|
|
275
289
|
export interface UpdatePromotionRequest_NameEntry {
|
package/package.json
CHANGED
package/proto/bundle.proto
CHANGED
|
@@ -35,6 +35,10 @@ service BundleService {
|
|
|
35
35
|
rpc GenerateBundleCollage (GenerateBundleCollageRequest) returns (GenerateBundleCollageResponse);
|
|
36
36
|
|
|
37
37
|
rpc BulkLookupBundles (BulkLookupBundlesRequest) returns (BulkLookupBundlesResponse);
|
|
38
|
+
|
|
39
|
+
rpc GetBundleRelatedProducts (GetBundleRelatedProductsRequest) returns (GetBundleRelatedProductsResponse);
|
|
40
|
+
rpc SetBundleRelatedProducts (SetBundleRelatedProductsRequest) returns (SuccessResponse);
|
|
41
|
+
rpc RemoveBundleRelatedProduct (RemoveBundleRelatedProductRequest) returns (SuccessResponse);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
|
|
@@ -390,3 +394,48 @@ message BundleLookupResult {
|
|
|
390
394
|
message BulkLookupBundlesResponse {
|
|
391
395
|
repeated BundleLookupResult results = 1;
|
|
392
396
|
}
|
|
397
|
+
|
|
398
|
+
// ── Bundle Related Products ──────────────────────────────────────────────────
|
|
399
|
+
|
|
400
|
+
enum BundleRelatedType {
|
|
401
|
+
BUNDLE_RELATED_TYPE_UNSPECIFIED = 0;
|
|
402
|
+
BUNDLE_RELATED_TYPE_CROSS_SELL = 1;
|
|
403
|
+
BUNDLE_RELATED_TYPE_UP_SELL = 2;
|
|
404
|
+
BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER = 3;
|
|
405
|
+
BUNDLE_RELATED_TYPE_POPULAR = 4;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
message BundleRelatedItem {
|
|
409
|
+
string product_id = 1;
|
|
410
|
+
string sku = 2;
|
|
411
|
+
string slug = 3;
|
|
412
|
+
map<string, string> name = 4;
|
|
413
|
+
string main_image = 5;
|
|
414
|
+
double price = 6;
|
|
415
|
+
int32 total_stock = 7;
|
|
416
|
+
BundleRelatedType type = 8;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
message GetBundleRelatedProductsRequest {
|
|
420
|
+
string bundle_id = 1;
|
|
421
|
+
optional BundleRelatedType type = 2;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
message GetBundleRelatedProductsResponse {
|
|
425
|
+
repeated BundleRelatedItem cross_sell = 1;
|
|
426
|
+
repeated BundleRelatedItem up_sell = 2;
|
|
427
|
+
repeated BundleRelatedItem bought_together = 3;
|
|
428
|
+
repeated BundleRelatedItem popular = 4;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
message SetBundleRelatedProductsRequest {
|
|
432
|
+
string bundle_id = 1;
|
|
433
|
+
BundleRelatedType type = 2;
|
|
434
|
+
repeated string related_product_ids = 3;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
message RemoveBundleRelatedProductRequest {
|
|
438
|
+
string bundle_id = 1;
|
|
439
|
+
string related_product_id = 2;
|
|
440
|
+
BundleRelatedType type = 3;
|
|
441
|
+
}
|
package/proto/calculation.proto
CHANGED
|
@@ -24,12 +24,14 @@ message CartItem {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
message ValidateAndCalculateRequest {
|
|
27
|
-
string user_id
|
|
28
|
-
repeated CartItem items
|
|
29
|
-
double order_total
|
|
30
|
-
optional string coupon_code
|
|
31
|
-
bool is_first_order = 5;
|
|
32
|
-
int32 order_count
|
|
27
|
+
string user_id = 1;
|
|
28
|
+
repeated CartItem items = 2;
|
|
29
|
+
double order_total = 3;
|
|
30
|
+
optional string coupon_code = 4;
|
|
31
|
+
bool is_first_order = 5;
|
|
32
|
+
int32 order_count = 6;
|
|
33
|
+
repeated string user_groups = 7;
|
|
34
|
+
repeated string coupon_codes = 8;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
message ValidateAndCalculateResponse {
|
package/proto/promotion.proto
CHANGED
|
@@ -53,6 +53,8 @@ enum PromotionType {
|
|
|
53
53
|
PROMOTION_TYPE_CASCADE_BUNDLE = 9;
|
|
54
54
|
PROMOTION_TYPE_BUNDLE_FIXED_PRICE = 10;
|
|
55
55
|
PROMOTION_TYPE_N_ITEMS_FIXED = 11;
|
|
56
|
+
PROMOTION_TYPE_COMBO_SET = 12;
|
|
57
|
+
PROMOTION_TYPE_POSITIONAL = 13;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
enum DiscountType {
|
|
@@ -166,7 +168,11 @@ message PromotionResponse {
|
|
|
166
168
|
int32 product_count = 29;
|
|
167
169
|
repeated string category_ids = 30;
|
|
168
170
|
repeated string brand_ids = 31;
|
|
169
|
-
optional int32 days_until_expiry
|
|
171
|
+
optional int32 days_until_expiry = 32;
|
|
172
|
+
optional string position_steps = 33;
|
|
173
|
+
optional string cascade_steps = 34;
|
|
174
|
+
optional double bundle_price = 35;
|
|
175
|
+
optional int32 bundle_size = 36;
|
|
170
176
|
}
|
|
171
177
|
|
|
172
178
|
|
|
@@ -244,9 +250,13 @@ message CreatePromotionRequest {
|
|
|
244
250
|
repeated PromotionConditionPayload conditions = 19;
|
|
245
251
|
repeated PromotionExclusionPayload exclusions = 20;
|
|
246
252
|
|
|
247
|
-
optional string image_url
|
|
248
|
-
optional string image_id
|
|
249
|
-
optional int32 priority
|
|
253
|
+
optional string image_url = 21;
|
|
254
|
+
optional string image_id = 22;
|
|
255
|
+
optional int32 priority = 23;
|
|
256
|
+
optional string position_steps = 24;
|
|
257
|
+
optional string cascade_steps = 25;
|
|
258
|
+
optional double bundle_price = 26;
|
|
259
|
+
optional int32 bundle_size = 27;
|
|
250
260
|
}
|
|
251
261
|
|
|
252
262
|
message UpdatePromotionRequest {
|
|
@@ -279,9 +289,13 @@ message UpdatePromotionRequest {
|
|
|
279
289
|
repeated PromotionConditionPayload conditions = 19;
|
|
280
290
|
repeated PromotionExclusionPayload exclusions = 20;
|
|
281
291
|
|
|
282
|
-
optional string image_url
|
|
283
|
-
optional string image_id
|
|
284
|
-
optional int32 priority
|
|
292
|
+
optional string image_url = 21;
|
|
293
|
+
optional string image_id = 22;
|
|
294
|
+
optional int32 priority = 23;
|
|
295
|
+
optional string position_steps = 24;
|
|
296
|
+
optional string cascade_steps = 25;
|
|
297
|
+
optional double bundle_price = 26;
|
|
298
|
+
optional int32 bundle_size = 27;
|
|
285
299
|
}
|
|
286
300
|
|
|
287
301
|
message DeletePromotionRequest {
|