@mamindom/contracts 1.0.79 → 1.0.81
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 +96 -0
- package/dist/gen/bundle.js +30 -1
- package/dist/proto/bundle.proto +110 -10
- package/gen/bundle.ts +139 -0
- package/package.json +1 -1
- package/proto/bundle.proto +110 -10
package/dist/gen/bundle.d.ts
CHANGED
|
@@ -14,11 +14,32 @@ export declare enum DiscountType {
|
|
|
14
14
|
DISCOUNT_TYPE_FIXED_AMOUNT = 2,
|
|
15
15
|
UNRECOGNIZED = -1
|
|
16
16
|
}
|
|
17
|
+
export declare enum DisplayPlacement {
|
|
18
|
+
DISPLAY_PLACEMENT_UNSPECIFIED = 0,
|
|
19
|
+
DISPLAY_PLACEMENT_CART = 1,
|
|
20
|
+
DISPLAY_PLACEMENT_PRODUCT_PAGE = 2,
|
|
21
|
+
DISPLAY_PLACEMENT_POST_PURCHASE = 3,
|
|
22
|
+
UNRECOGNIZED = -1
|
|
23
|
+
}
|
|
24
|
+
export declare enum PriceMode {
|
|
25
|
+
PRICE_MODE_UNSPECIFIED = 0,
|
|
26
|
+
PRICE_MODE_FIXED_TOTAL = 1,
|
|
27
|
+
PRICE_MODE_PER_ITEM_DISCOUNT = 2,
|
|
28
|
+
UNRECOGNIZED = -1
|
|
29
|
+
}
|
|
30
|
+
export declare enum BundleType {
|
|
31
|
+
BUNDLE_TYPE_UNSPECIFIED = 0,
|
|
32
|
+
BUNDLE_TYPE_STANDARD = 1,
|
|
33
|
+
BUNDLE_TYPE_CROSS_SELL = 2,
|
|
34
|
+
BUNDLE_TYPE_UPSELL = 3,
|
|
35
|
+
UNRECOGNIZED = -1
|
|
36
|
+
}
|
|
17
37
|
export interface GetBundlesRequest {
|
|
18
38
|
pagination: PaginationRequest | undefined;
|
|
19
39
|
search?: string | undefined;
|
|
20
40
|
status?: BundleStatus | undefined;
|
|
21
41
|
productId?: string | undefined;
|
|
42
|
+
bundleType?: BundleType | undefined;
|
|
22
43
|
}
|
|
23
44
|
export interface GetBundleRequest {
|
|
24
45
|
id: string;
|
|
@@ -51,6 +72,12 @@ export interface CreateBundleRequest {
|
|
|
51
72
|
};
|
|
52
73
|
items: BundleItemPayload[];
|
|
53
74
|
createdById: string;
|
|
75
|
+
/** NEW */
|
|
76
|
+
displayPlacements: DisplayPlacement[];
|
|
77
|
+
priceMode: PriceMode;
|
|
78
|
+
requireAllInStock: boolean;
|
|
79
|
+
bundleType: BundleType;
|
|
80
|
+
anchorProductId?: string | undefined;
|
|
54
81
|
}
|
|
55
82
|
export interface CreateBundleRequest_NameEntry {
|
|
56
83
|
key: string;
|
|
@@ -99,6 +126,12 @@ export interface UpdateBundleRequest {
|
|
|
99
126
|
[key: string]: string;
|
|
100
127
|
};
|
|
101
128
|
items: BundleItemPayload[];
|
|
129
|
+
/** NEW */
|
|
130
|
+
displayPlacements: DisplayPlacement[];
|
|
131
|
+
priceMode?: PriceMode | undefined;
|
|
132
|
+
requireAllInStock?: boolean | undefined;
|
|
133
|
+
bundleType?: BundleType | undefined;
|
|
134
|
+
anchorProductId?: string | undefined;
|
|
102
135
|
}
|
|
103
136
|
export interface UpdateBundleRequest_NameEntry {
|
|
104
137
|
key: string;
|
|
@@ -147,6 +180,10 @@ export interface UpdateBundleItemRequest {
|
|
|
147
180
|
itemDiscountValue?: number | undefined;
|
|
148
181
|
sortOrder?: number | undefined;
|
|
149
182
|
}
|
|
183
|
+
export interface BulkAddBundleItemsRequest {
|
|
184
|
+
bundleId: string;
|
|
185
|
+
items: BundleItemPayload[];
|
|
186
|
+
}
|
|
150
187
|
export interface AddBundleRuleRequest {
|
|
151
188
|
bundleId: string;
|
|
152
189
|
ruleType: string;
|
|
@@ -157,6 +194,9 @@ export interface RemoveBundleRuleRequest {
|
|
|
157
194
|
bundleId: string;
|
|
158
195
|
ruleId: string;
|
|
159
196
|
}
|
|
197
|
+
export interface ApplyBundleRulesRequest {
|
|
198
|
+
bundleId: string;
|
|
199
|
+
}
|
|
160
200
|
export interface GetBundlesByProductRequest {
|
|
161
201
|
productId: string;
|
|
162
202
|
status?: BundleStatus | undefined;
|
|
@@ -171,6 +211,19 @@ export interface BulkDeleteBundlesRequest {
|
|
|
171
211
|
export interface CheckBundleAvailabilityRequest {
|
|
172
212
|
bundleId: string;
|
|
173
213
|
}
|
|
214
|
+
export interface CloneBundleRequest {
|
|
215
|
+
bundleId: string;
|
|
216
|
+
}
|
|
217
|
+
export interface ExportBundlesRequest {
|
|
218
|
+
status?: BundleStatus | undefined;
|
|
219
|
+
bundleType?: BundleType | undefined;
|
|
220
|
+
/** "json" | "csv" */
|
|
221
|
+
format: string;
|
|
222
|
+
}
|
|
223
|
+
export interface AddCrossSellLinkRequest {
|
|
224
|
+
bundleId: string;
|
|
225
|
+
anchorProductId: string;
|
|
226
|
+
}
|
|
174
227
|
export interface GetBundlesResponse {
|
|
175
228
|
items: BundleListItemResponse[];
|
|
176
229
|
meta: PaginationMeta | undefined;
|
|
@@ -192,6 +245,9 @@ export interface BundleListItemResponse {
|
|
|
192
245
|
originalPrice: number;
|
|
193
246
|
finalPrice: number;
|
|
194
247
|
inStock: boolean;
|
|
248
|
+
/** NEW */
|
|
249
|
+
bundleType: BundleType;
|
|
250
|
+
displayPlacements: DisplayPlacement[];
|
|
195
251
|
}
|
|
196
252
|
export interface BundleListItemResponse_NameEntry {
|
|
197
253
|
key: string;
|
|
@@ -228,6 +284,12 @@ export interface BundleDetailResponse {
|
|
|
228
284
|
originalPrice: number;
|
|
229
285
|
finalPrice: number;
|
|
230
286
|
inStock: boolean;
|
|
287
|
+
/** NEW */
|
|
288
|
+
displayPlacements: DisplayPlacement[];
|
|
289
|
+
priceMode: PriceMode;
|
|
290
|
+
requireAllInStock: boolean;
|
|
291
|
+
bundleType: BundleType;
|
|
292
|
+
anchorProductId?: string | undefined;
|
|
231
293
|
}
|
|
232
294
|
export interface BundleDetailResponse_NameEntry {
|
|
233
295
|
key: string;
|
|
@@ -294,6 +356,28 @@ export interface BundleItemAvailability {
|
|
|
294
356
|
availableQuantity: number;
|
|
295
357
|
inStock: boolean;
|
|
296
358
|
}
|
|
359
|
+
export interface ExportBundlesResponse {
|
|
360
|
+
/** JSON string or CSV string */
|
|
361
|
+
content: string;
|
|
362
|
+
format: string;
|
|
363
|
+
count: number;
|
|
364
|
+
}
|
|
365
|
+
export interface GenerateBundleCollageRequest {
|
|
366
|
+
bundleId: string;
|
|
367
|
+
/** Optional: override cell pixel size (default 400) */
|
|
368
|
+
cellSize?: number | undefined;
|
|
369
|
+
}
|
|
370
|
+
export interface GenerateBundleCollageResponse {
|
|
371
|
+
/** Public CDN/S3 URL of the collage JPEG */
|
|
372
|
+
url: string;
|
|
373
|
+
/** S3 object key */
|
|
374
|
+
key: string;
|
|
375
|
+
/** Final image width in pixels */
|
|
376
|
+
width: number;
|
|
377
|
+
/** Final image height in pixels */
|
|
378
|
+
height: number;
|
|
379
|
+
bundleId: string;
|
|
380
|
+
}
|
|
297
381
|
export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
298
382
|
export interface BundleServiceClient {
|
|
299
383
|
getBundles(request: GetBundlesRequest): Observable<GetBundlesResponse>;
|
|
@@ -304,12 +388,18 @@ export interface BundleServiceClient {
|
|
|
304
388
|
addBundleItem(request: AddBundleItemRequest): Observable<BundleDetailResponse>;
|
|
305
389
|
removeBundleItem(request: RemoveBundleItemRequest): Observable<BundleDetailResponse>;
|
|
306
390
|
updateBundleItem(request: UpdateBundleItemRequest): Observable<BundleDetailResponse>;
|
|
391
|
+
bulkAddBundleItems(request: BulkAddBundleItemsRequest): Observable<BundleDetailResponse>;
|
|
307
392
|
addBundleRule(request: AddBundleRuleRequest): Observable<SuccessResponse>;
|
|
308
393
|
removeBundleRule(request: RemoveBundleRuleRequest): Observable<SuccessResponse>;
|
|
394
|
+
applyBundleRules(request: ApplyBundleRulesRequest): Observable<BundleDetailResponse>;
|
|
309
395
|
getBundlesByProduct(request: GetBundlesByProductRequest): Observable<GetBundlesResponse>;
|
|
310
396
|
bulkUpdateBundleStatus(request: BulkUpdateBundleStatusRequest): Observable<SuccessResponse>;
|
|
311
397
|
bulkDeleteBundles(request: BulkDeleteBundlesRequest): Observable<SuccessResponse>;
|
|
312
398
|
checkBundleAvailability(request: CheckBundleAvailabilityRequest): Observable<BundleAvailabilityResponse>;
|
|
399
|
+
cloneBundle(request: CloneBundleRequest): Observable<BundleDetailResponse>;
|
|
400
|
+
exportBundles(request: ExportBundlesRequest): Observable<ExportBundlesResponse>;
|
|
401
|
+
addCrossSellLink(request: AddCrossSellLinkRequest): Observable<SuccessResponse>;
|
|
402
|
+
generateBundleCollage(request: GenerateBundleCollageRequest): Observable<GenerateBundleCollageResponse>;
|
|
313
403
|
}
|
|
314
404
|
export interface BundleServiceController {
|
|
315
405
|
getBundles(request: GetBundlesRequest): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
|
|
@@ -320,12 +410,18 @@ export interface BundleServiceController {
|
|
|
320
410
|
addBundleItem(request: AddBundleItemRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
321
411
|
removeBundleItem(request: RemoveBundleItemRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
322
412
|
updateBundleItem(request: UpdateBundleItemRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
413
|
+
bulkAddBundleItems(request: BulkAddBundleItemsRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
323
414
|
addBundleRule(request: AddBundleRuleRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
324
415
|
removeBundleRule(request: RemoveBundleRuleRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
416
|
+
applyBundleRules(request: ApplyBundleRulesRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
325
417
|
getBundlesByProduct(request: GetBundlesByProductRequest): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
|
|
326
418
|
bulkUpdateBundleStatus(request: BulkUpdateBundleStatusRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
327
419
|
bulkDeleteBundles(request: BulkDeleteBundlesRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
328
420
|
checkBundleAvailability(request: CheckBundleAvailabilityRequest): Promise<BundleAvailabilityResponse> | Observable<BundleAvailabilityResponse> | BundleAvailabilityResponse;
|
|
421
|
+
cloneBundle(request: CloneBundleRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
422
|
+
exportBundles(request: ExportBundlesRequest): Promise<ExportBundlesResponse> | Observable<ExportBundlesResponse> | ExportBundlesResponse;
|
|
423
|
+
addCrossSellLink(request: AddCrossSellLinkRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
424
|
+
generateBundleCollage(request: GenerateBundleCollageRequest): Promise<GenerateBundleCollageResponse> | Observable<GenerateBundleCollageResponse> | GenerateBundleCollageResponse;
|
|
329
425
|
}
|
|
330
426
|
export declare function BundleServiceControllerMethods(): (constructor: Function) => void;
|
|
331
427
|
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.DiscountType = exports.BundleStatus = exports.protobufPackage = void 0;
|
|
8
|
+
exports.BUNDLE_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = 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");
|
|
@@ -25,6 +25,29 @@ var DiscountType;
|
|
|
25
25
|
DiscountType[DiscountType["DISCOUNT_TYPE_FIXED_AMOUNT"] = 2] = "DISCOUNT_TYPE_FIXED_AMOUNT";
|
|
26
26
|
DiscountType[DiscountType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
27
27
|
})(DiscountType || (exports.DiscountType = DiscountType = {}));
|
|
28
|
+
var DisplayPlacement;
|
|
29
|
+
(function (DisplayPlacement) {
|
|
30
|
+
DisplayPlacement[DisplayPlacement["DISPLAY_PLACEMENT_UNSPECIFIED"] = 0] = "DISPLAY_PLACEMENT_UNSPECIFIED";
|
|
31
|
+
DisplayPlacement[DisplayPlacement["DISPLAY_PLACEMENT_CART"] = 1] = "DISPLAY_PLACEMENT_CART";
|
|
32
|
+
DisplayPlacement[DisplayPlacement["DISPLAY_PLACEMENT_PRODUCT_PAGE"] = 2] = "DISPLAY_PLACEMENT_PRODUCT_PAGE";
|
|
33
|
+
DisplayPlacement[DisplayPlacement["DISPLAY_PLACEMENT_POST_PURCHASE"] = 3] = "DISPLAY_PLACEMENT_POST_PURCHASE";
|
|
34
|
+
DisplayPlacement[DisplayPlacement["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
35
|
+
})(DisplayPlacement || (exports.DisplayPlacement = DisplayPlacement = {}));
|
|
36
|
+
var PriceMode;
|
|
37
|
+
(function (PriceMode) {
|
|
38
|
+
PriceMode[PriceMode["PRICE_MODE_UNSPECIFIED"] = 0] = "PRICE_MODE_UNSPECIFIED";
|
|
39
|
+
PriceMode[PriceMode["PRICE_MODE_FIXED_TOTAL"] = 1] = "PRICE_MODE_FIXED_TOTAL";
|
|
40
|
+
PriceMode[PriceMode["PRICE_MODE_PER_ITEM_DISCOUNT"] = 2] = "PRICE_MODE_PER_ITEM_DISCOUNT";
|
|
41
|
+
PriceMode[PriceMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
42
|
+
})(PriceMode || (exports.PriceMode = PriceMode = {}));
|
|
43
|
+
var BundleType;
|
|
44
|
+
(function (BundleType) {
|
|
45
|
+
BundleType[BundleType["BUNDLE_TYPE_UNSPECIFIED"] = 0] = "BUNDLE_TYPE_UNSPECIFIED";
|
|
46
|
+
BundleType[BundleType["BUNDLE_TYPE_STANDARD"] = 1] = "BUNDLE_TYPE_STANDARD";
|
|
47
|
+
BundleType[BundleType["BUNDLE_TYPE_CROSS_SELL"] = 2] = "BUNDLE_TYPE_CROSS_SELL";
|
|
48
|
+
BundleType[BundleType["BUNDLE_TYPE_UPSELL"] = 3] = "BUNDLE_TYPE_UPSELL";
|
|
49
|
+
BundleType[BundleType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
50
|
+
})(BundleType || (exports.BundleType = BundleType = {}));
|
|
28
51
|
exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
29
52
|
function BundleServiceControllerMethods() {
|
|
30
53
|
return function (constructor) {
|
|
@@ -37,12 +60,18 @@ function BundleServiceControllerMethods() {
|
|
|
37
60
|
"addBundleItem",
|
|
38
61
|
"removeBundleItem",
|
|
39
62
|
"updateBundleItem",
|
|
63
|
+
"bulkAddBundleItems",
|
|
40
64
|
"addBundleRule",
|
|
41
65
|
"removeBundleRule",
|
|
66
|
+
"applyBundleRules",
|
|
42
67
|
"getBundlesByProduct",
|
|
43
68
|
"bulkUpdateBundleStatus",
|
|
44
69
|
"bulkDeleteBundles",
|
|
45
70
|
"checkBundleAvailability",
|
|
71
|
+
"cloneBundle",
|
|
72
|
+
"exportBundles",
|
|
73
|
+
"addCrossSellLink",
|
|
74
|
+
"generateBundleCollage",
|
|
46
75
|
];
|
|
47
76
|
for (const method of grpcMethods) {
|
|
48
77
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/dist/proto/bundle.proto
CHANGED
|
@@ -14,21 +14,30 @@ service BundleService {
|
|
|
14
14
|
rpc AddBundleItem (AddBundleItemRequest) returns (BundleDetailResponse);
|
|
15
15
|
rpc RemoveBundleItem (RemoveBundleItemRequest) returns (BundleDetailResponse);
|
|
16
16
|
rpc UpdateBundleItem (UpdateBundleItemRequest) returns (BundleDetailResponse);
|
|
17
|
+
rpc BulkAddBundleItems (BulkAddBundleItemsRequest) returns (BundleDetailResponse);
|
|
17
18
|
|
|
18
|
-
|
|
19
19
|
rpc AddBundleRule (AddBundleRuleRequest) returns (SuccessResponse);
|
|
20
20
|
rpc RemoveBundleRule (RemoveBundleRuleRequest) returns (SuccessResponse);
|
|
21
|
-
rpc
|
|
21
|
+
rpc ApplyBundleRules (ApplyBundleRulesRequest) returns (BundleDetailResponse);
|
|
22
22
|
|
|
23
|
+
rpc GetBundlesByProduct (GetBundlesByProductRequest) returns (GetBundlesResponse);
|
|
23
24
|
|
|
24
25
|
rpc BulkUpdateBundleStatus (BulkUpdateBundleStatusRequest) returns (SuccessResponse);
|
|
25
26
|
rpc BulkDeleteBundles (BulkDeleteBundlesRequest) returns (SuccessResponse);
|
|
26
27
|
|
|
27
|
-
|
|
28
28
|
rpc CheckBundleAvailability (CheckBundleAvailabilityRequest) returns (BundleAvailabilityResponse);
|
|
29
|
+
|
|
30
|
+
rpc CloneBundle (CloneBundleRequest) returns (BundleDetailResponse);
|
|
31
|
+
rpc ExportBundles (ExportBundlesRequest) returns (ExportBundlesResponse);
|
|
32
|
+
|
|
33
|
+
rpc AddCrossSellLink (AddCrossSellLinkRequest) returns (SuccessResponse);
|
|
34
|
+
|
|
35
|
+
rpc GenerateBundleCollage (GenerateBundleCollageRequest) returns (GenerateBundleCollageResponse);
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
|
|
39
|
+
// ─── Enums ────────────────────────────────────────────────────────────────────
|
|
40
|
+
|
|
32
41
|
enum BundleStatus {
|
|
33
42
|
BUNDLE_STATUS_UNSPECIFIED = 0;
|
|
34
43
|
BUNDLE_STATUS_DRAFT = 1;
|
|
@@ -42,12 +51,35 @@ enum DiscountType {
|
|
|
42
51
|
DISCOUNT_TYPE_FIXED_AMOUNT = 2;
|
|
43
52
|
}
|
|
44
53
|
|
|
54
|
+
enum DisplayPlacement {
|
|
55
|
+
DISPLAY_PLACEMENT_UNSPECIFIED = 0;
|
|
56
|
+
DISPLAY_PLACEMENT_CART = 1;
|
|
57
|
+
DISPLAY_PLACEMENT_PRODUCT_PAGE = 2;
|
|
58
|
+
DISPLAY_PLACEMENT_POST_PURCHASE = 3;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
enum PriceMode {
|
|
62
|
+
PRICE_MODE_UNSPECIFIED = 0;
|
|
63
|
+
PRICE_MODE_FIXED_TOTAL = 1;
|
|
64
|
+
PRICE_MODE_PER_ITEM_DISCOUNT = 2;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
enum BundleType {
|
|
68
|
+
BUNDLE_TYPE_UNSPECIFIED = 0;
|
|
69
|
+
BUNDLE_TYPE_STANDARD = 1;
|
|
70
|
+
BUNDLE_TYPE_CROSS_SELL = 2;
|
|
71
|
+
BUNDLE_TYPE_UPSELL = 3;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
// ─── Requests ─────────────────────────────────────────────────────────────────
|
|
45
76
|
|
|
46
77
|
message GetBundlesRequest {
|
|
47
78
|
PaginationRequest pagination = 1;
|
|
48
79
|
optional string search = 2;
|
|
49
80
|
optional BundleStatus status = 3;
|
|
50
81
|
optional string product_id = 4;
|
|
82
|
+
optional BundleType bundle_type = 5;
|
|
51
83
|
}
|
|
52
84
|
|
|
53
85
|
message GetBundleRequest {
|
|
@@ -78,6 +110,13 @@ message CreateBundleRequest {
|
|
|
78
110
|
|
|
79
111
|
repeated BundleItemPayload items = 15;
|
|
80
112
|
string created_by_id = 16;
|
|
113
|
+
|
|
114
|
+
// NEW
|
|
115
|
+
repeated DisplayPlacement display_placements = 17;
|
|
116
|
+
PriceMode price_mode = 18;
|
|
117
|
+
bool require_all_in_stock = 19;
|
|
118
|
+
BundleType bundle_type = 20;
|
|
119
|
+
optional string anchor_product_id = 21;
|
|
81
120
|
}
|
|
82
121
|
|
|
83
122
|
message UpdateBundleRequest {
|
|
@@ -103,6 +142,13 @@ message UpdateBundleRequest {
|
|
|
103
142
|
map<string, string> meta_description = 15;
|
|
104
143
|
|
|
105
144
|
repeated BundleItemPayload items = 16;
|
|
145
|
+
|
|
146
|
+
// NEW
|
|
147
|
+
repeated DisplayPlacement display_placements = 17;
|
|
148
|
+
optional PriceMode price_mode = 18;
|
|
149
|
+
optional bool require_all_in_stock = 19;
|
|
150
|
+
optional BundleType bundle_type = 20;
|
|
151
|
+
optional string anchor_product_id = 21;
|
|
106
152
|
}
|
|
107
153
|
|
|
108
154
|
message DeleteBundleRequest {
|
|
@@ -137,9 +183,14 @@ message UpdateBundleItemRequest {
|
|
|
137
183
|
optional int32 sort_order = 6;
|
|
138
184
|
}
|
|
139
185
|
|
|
186
|
+
message BulkAddBundleItemsRequest {
|
|
187
|
+
string bundle_id = 1;
|
|
188
|
+
repeated BundleItemPayload items = 2;
|
|
189
|
+
}
|
|
190
|
+
|
|
140
191
|
message AddBundleRuleRequest {
|
|
141
192
|
string bundle_id = 1;
|
|
142
|
-
string rule_type = 2;
|
|
193
|
+
string rule_type = 2;
|
|
143
194
|
string target_id = 3;
|
|
144
195
|
repeated string excluded_product_ids = 4;
|
|
145
196
|
}
|
|
@@ -149,6 +200,10 @@ message RemoveBundleRuleRequest {
|
|
|
149
200
|
string rule_id = 2;
|
|
150
201
|
}
|
|
151
202
|
|
|
203
|
+
message ApplyBundleRulesRequest {
|
|
204
|
+
string bundle_id = 1;
|
|
205
|
+
}
|
|
206
|
+
|
|
152
207
|
message GetBundlesByProductRequest {
|
|
153
208
|
string product_id = 1;
|
|
154
209
|
optional BundleStatus status = 2;
|
|
@@ -167,6 +222,23 @@ message CheckBundleAvailabilityRequest {
|
|
|
167
222
|
string bundle_id = 1;
|
|
168
223
|
}
|
|
169
224
|
|
|
225
|
+
message CloneBundleRequest {
|
|
226
|
+
string bundle_id = 1;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
message ExportBundlesRequest {
|
|
230
|
+
optional BundleStatus status = 1;
|
|
231
|
+
optional BundleType bundle_type = 2;
|
|
232
|
+
string format = 3; // "json" | "csv"
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
message AddCrossSellLinkRequest {
|
|
236
|
+
string bundle_id = 1;
|
|
237
|
+
string anchor_product_id = 2;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
// ─── Responses ────────────────────────────────────────────────────────────────
|
|
170
242
|
|
|
171
243
|
message GetBundlesResponse {
|
|
172
244
|
repeated BundleListItemResponse items = 1;
|
|
@@ -188,9 +260,13 @@ message BundleListItemResponse {
|
|
|
188
260
|
int32 sort_order = 10;
|
|
189
261
|
|
|
190
262
|
int32 item_count = 11;
|
|
191
|
-
double original_price = 12;
|
|
192
|
-
double final_price = 13;
|
|
263
|
+
double original_price = 12;
|
|
264
|
+
double final_price = 13;
|
|
193
265
|
bool in_stock = 14;
|
|
266
|
+
|
|
267
|
+
// NEW
|
|
268
|
+
BundleType bundle_type = 15;
|
|
269
|
+
repeated DisplayPlacement display_placements = 16;
|
|
194
270
|
}
|
|
195
271
|
|
|
196
272
|
message BundleDetailResponse {
|
|
@@ -221,6 +297,13 @@ message BundleDetailResponse {
|
|
|
221
297
|
double original_price = 18;
|
|
222
298
|
double final_price = 19;
|
|
223
299
|
bool in_stock = 20;
|
|
300
|
+
|
|
301
|
+
// NEW
|
|
302
|
+
repeated DisplayPlacement display_placements = 21;
|
|
303
|
+
PriceMode price_mode = 22;
|
|
304
|
+
bool require_all_in_stock = 23;
|
|
305
|
+
BundleType bundle_type = 24;
|
|
306
|
+
optional string anchor_product_id = 25;
|
|
224
307
|
}
|
|
225
308
|
|
|
226
309
|
message BundleItemResponse {
|
|
@@ -232,7 +315,6 @@ message BundleItemResponse {
|
|
|
232
315
|
optional double item_discount_value = 6;
|
|
233
316
|
int32 sort_order = 7;
|
|
234
317
|
|
|
235
|
-
|
|
236
318
|
map<string, string> product_name = 8;
|
|
237
319
|
string product_image = 9;
|
|
238
320
|
string product_sku = 10;
|
|
@@ -246,8 +328,6 @@ message BundleRuleResponse {
|
|
|
246
328
|
string rule_type = 2;
|
|
247
329
|
string target_id = 3;
|
|
248
330
|
repeated string excluded_product_ids = 4;
|
|
249
|
-
|
|
250
|
-
|
|
251
331
|
map<string, string> target_name = 5;
|
|
252
332
|
}
|
|
253
333
|
|
|
@@ -262,4 +342,24 @@ message BundleItemAvailability {
|
|
|
262
342
|
int32 required_quantity = 3;
|
|
263
343
|
int32 available_quantity = 4;
|
|
264
344
|
bool in_stock = 5;
|
|
265
|
-
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
message ExportBundlesResponse {
|
|
348
|
+
string content = 1; // JSON string or CSV string
|
|
349
|
+
string format = 2;
|
|
350
|
+
int32 count = 3;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
message GenerateBundleCollageRequest {
|
|
354
|
+
string bundle_id = 1;
|
|
355
|
+
// Optional: override cell pixel size (default 400)
|
|
356
|
+
optional int32 cell_size = 2;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
message GenerateBundleCollageResponse {
|
|
360
|
+
string url = 1; // Public CDN/S3 URL of the collage JPEG
|
|
361
|
+
string key = 2; // S3 object key
|
|
362
|
+
int32 width = 3; // Final image width in pixels
|
|
363
|
+
int32 height = 4; // Final image height in pixels
|
|
364
|
+
string bundle_id = 5;
|
|
365
|
+
}
|
package/gen/bundle.ts
CHANGED
|
@@ -26,11 +26,35 @@ export enum DiscountType {
|
|
|
26
26
|
UNRECOGNIZED = -1,
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
export enum DisplayPlacement {
|
|
30
|
+
DISPLAY_PLACEMENT_UNSPECIFIED = 0,
|
|
31
|
+
DISPLAY_PLACEMENT_CART = 1,
|
|
32
|
+
DISPLAY_PLACEMENT_PRODUCT_PAGE = 2,
|
|
33
|
+
DISPLAY_PLACEMENT_POST_PURCHASE = 3,
|
|
34
|
+
UNRECOGNIZED = -1,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export enum PriceMode {
|
|
38
|
+
PRICE_MODE_UNSPECIFIED = 0,
|
|
39
|
+
PRICE_MODE_FIXED_TOTAL = 1,
|
|
40
|
+
PRICE_MODE_PER_ITEM_DISCOUNT = 2,
|
|
41
|
+
UNRECOGNIZED = -1,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export enum BundleType {
|
|
45
|
+
BUNDLE_TYPE_UNSPECIFIED = 0,
|
|
46
|
+
BUNDLE_TYPE_STANDARD = 1,
|
|
47
|
+
BUNDLE_TYPE_CROSS_SELL = 2,
|
|
48
|
+
BUNDLE_TYPE_UPSELL = 3,
|
|
49
|
+
UNRECOGNIZED = -1,
|
|
50
|
+
}
|
|
51
|
+
|
|
29
52
|
export interface GetBundlesRequest {
|
|
30
53
|
pagination: PaginationRequest | undefined;
|
|
31
54
|
search?: string | undefined;
|
|
32
55
|
status?: BundleStatus | undefined;
|
|
33
56
|
productId?: string | undefined;
|
|
57
|
+
bundleType?: BundleType | undefined;
|
|
34
58
|
}
|
|
35
59
|
|
|
36
60
|
export interface GetBundleRequest {
|
|
@@ -55,6 +79,12 @@ export interface CreateBundleRequest {
|
|
|
55
79
|
metaDescription: { [key: string]: string };
|
|
56
80
|
items: BundleItemPayload[];
|
|
57
81
|
createdById: string;
|
|
82
|
+
/** NEW */
|
|
83
|
+
displayPlacements: DisplayPlacement[];
|
|
84
|
+
priceMode: PriceMode;
|
|
85
|
+
requireAllInStock: boolean;
|
|
86
|
+
bundleType: BundleType;
|
|
87
|
+
anchorProductId?: string | undefined;
|
|
58
88
|
}
|
|
59
89
|
|
|
60
90
|
export interface CreateBundleRequest_NameEntry {
|
|
@@ -99,6 +129,12 @@ export interface UpdateBundleRequest {
|
|
|
99
129
|
metaTitle: { [key: string]: string };
|
|
100
130
|
metaDescription: { [key: string]: string };
|
|
101
131
|
items: BundleItemPayload[];
|
|
132
|
+
/** NEW */
|
|
133
|
+
displayPlacements: DisplayPlacement[];
|
|
134
|
+
priceMode?: PriceMode | undefined;
|
|
135
|
+
requireAllInStock?: boolean | undefined;
|
|
136
|
+
bundleType?: BundleType | undefined;
|
|
137
|
+
anchorProductId?: string | undefined;
|
|
102
138
|
}
|
|
103
139
|
|
|
104
140
|
export interface UpdateBundleRequest_NameEntry {
|
|
@@ -158,6 +194,11 @@ export interface UpdateBundleItemRequest {
|
|
|
158
194
|
sortOrder?: number | undefined;
|
|
159
195
|
}
|
|
160
196
|
|
|
197
|
+
export interface BulkAddBundleItemsRequest {
|
|
198
|
+
bundleId: string;
|
|
199
|
+
items: BundleItemPayload[];
|
|
200
|
+
}
|
|
201
|
+
|
|
161
202
|
export interface AddBundleRuleRequest {
|
|
162
203
|
bundleId: string;
|
|
163
204
|
ruleType: string;
|
|
@@ -170,6 +211,10 @@ export interface RemoveBundleRuleRequest {
|
|
|
170
211
|
ruleId: string;
|
|
171
212
|
}
|
|
172
213
|
|
|
214
|
+
export interface ApplyBundleRulesRequest {
|
|
215
|
+
bundleId: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
173
218
|
export interface GetBundlesByProductRequest {
|
|
174
219
|
productId: string;
|
|
175
220
|
status?: BundleStatus | undefined;
|
|
@@ -188,6 +233,24 @@ export interface CheckBundleAvailabilityRequest {
|
|
|
188
233
|
bundleId: string;
|
|
189
234
|
}
|
|
190
235
|
|
|
236
|
+
export interface CloneBundleRequest {
|
|
237
|
+
bundleId: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface ExportBundlesRequest {
|
|
241
|
+
status?: BundleStatus | undefined;
|
|
242
|
+
bundleType?:
|
|
243
|
+
| BundleType
|
|
244
|
+
| undefined;
|
|
245
|
+
/** "json" | "csv" */
|
|
246
|
+
format: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface AddCrossSellLinkRequest {
|
|
250
|
+
bundleId: string;
|
|
251
|
+
anchorProductId: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
191
254
|
export interface GetBundlesResponse {
|
|
192
255
|
items: BundleListItemResponse[];
|
|
193
256
|
meta: PaginationMeta | undefined;
|
|
@@ -208,6 +271,9 @@ export interface BundleListItemResponse {
|
|
|
208
271
|
originalPrice: number;
|
|
209
272
|
finalPrice: number;
|
|
210
273
|
inStock: boolean;
|
|
274
|
+
/** NEW */
|
|
275
|
+
bundleType: BundleType;
|
|
276
|
+
displayPlacements: DisplayPlacement[];
|
|
211
277
|
}
|
|
212
278
|
|
|
213
279
|
export interface BundleListItemResponse_NameEntry {
|
|
@@ -236,6 +302,12 @@ export interface BundleDetailResponse {
|
|
|
236
302
|
originalPrice: number;
|
|
237
303
|
finalPrice: number;
|
|
238
304
|
inStock: boolean;
|
|
305
|
+
/** NEW */
|
|
306
|
+
displayPlacements: DisplayPlacement[];
|
|
307
|
+
priceMode: PriceMode;
|
|
308
|
+
requireAllInStock: boolean;
|
|
309
|
+
bundleType: BundleType;
|
|
310
|
+
anchorProductId?: string | undefined;
|
|
239
311
|
}
|
|
240
312
|
|
|
241
313
|
export interface BundleDetailResponse_NameEntry {
|
|
@@ -310,6 +382,31 @@ export interface BundleItemAvailability {
|
|
|
310
382
|
inStock: boolean;
|
|
311
383
|
}
|
|
312
384
|
|
|
385
|
+
export interface ExportBundlesResponse {
|
|
386
|
+
/** JSON string or CSV string */
|
|
387
|
+
content: string;
|
|
388
|
+
format: string;
|
|
389
|
+
count: number;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface GenerateBundleCollageRequest {
|
|
393
|
+
bundleId: string;
|
|
394
|
+
/** Optional: override cell pixel size (default 400) */
|
|
395
|
+
cellSize?: number | undefined;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface GenerateBundleCollageResponse {
|
|
399
|
+
/** Public CDN/S3 URL of the collage JPEG */
|
|
400
|
+
url: string;
|
|
401
|
+
/** S3 object key */
|
|
402
|
+
key: string;
|
|
403
|
+
/** Final image width in pixels */
|
|
404
|
+
width: number;
|
|
405
|
+
/** Final image height in pixels */
|
|
406
|
+
height: number;
|
|
407
|
+
bundleId: string;
|
|
408
|
+
}
|
|
409
|
+
|
|
313
410
|
export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
314
411
|
|
|
315
412
|
export interface BundleServiceClient {
|
|
@@ -329,10 +426,14 @@ export interface BundleServiceClient {
|
|
|
329
426
|
|
|
330
427
|
updateBundleItem(request: UpdateBundleItemRequest): Observable<BundleDetailResponse>;
|
|
331
428
|
|
|
429
|
+
bulkAddBundleItems(request: BulkAddBundleItemsRequest): Observable<BundleDetailResponse>;
|
|
430
|
+
|
|
332
431
|
addBundleRule(request: AddBundleRuleRequest): Observable<SuccessResponse>;
|
|
333
432
|
|
|
334
433
|
removeBundleRule(request: RemoveBundleRuleRequest): Observable<SuccessResponse>;
|
|
335
434
|
|
|
435
|
+
applyBundleRules(request: ApplyBundleRulesRequest): Observable<BundleDetailResponse>;
|
|
436
|
+
|
|
336
437
|
getBundlesByProduct(request: GetBundlesByProductRequest): Observable<GetBundlesResponse>;
|
|
337
438
|
|
|
338
439
|
bulkUpdateBundleStatus(request: BulkUpdateBundleStatusRequest): Observable<SuccessResponse>;
|
|
@@ -340,6 +441,14 @@ export interface BundleServiceClient {
|
|
|
340
441
|
bulkDeleteBundles(request: BulkDeleteBundlesRequest): Observable<SuccessResponse>;
|
|
341
442
|
|
|
342
443
|
checkBundleAvailability(request: CheckBundleAvailabilityRequest): Observable<BundleAvailabilityResponse>;
|
|
444
|
+
|
|
445
|
+
cloneBundle(request: CloneBundleRequest): Observable<BundleDetailResponse>;
|
|
446
|
+
|
|
447
|
+
exportBundles(request: ExportBundlesRequest): Observable<ExportBundlesResponse>;
|
|
448
|
+
|
|
449
|
+
addCrossSellLink(request: AddCrossSellLinkRequest): Observable<SuccessResponse>;
|
|
450
|
+
|
|
451
|
+
generateBundleCollage(request: GenerateBundleCollageRequest): Observable<GenerateBundleCollageResponse>;
|
|
343
452
|
}
|
|
344
453
|
|
|
345
454
|
export interface BundleServiceController {
|
|
@@ -373,6 +482,10 @@ export interface BundleServiceController {
|
|
|
373
482
|
request: UpdateBundleItemRequest,
|
|
374
483
|
): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
375
484
|
|
|
485
|
+
bulkAddBundleItems(
|
|
486
|
+
request: BulkAddBundleItemsRequest,
|
|
487
|
+
): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
488
|
+
|
|
376
489
|
addBundleRule(
|
|
377
490
|
request: AddBundleRuleRequest,
|
|
378
491
|
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
@@ -381,6 +494,10 @@ export interface BundleServiceController {
|
|
|
381
494
|
request: RemoveBundleRuleRequest,
|
|
382
495
|
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
383
496
|
|
|
497
|
+
applyBundleRules(
|
|
498
|
+
request: ApplyBundleRulesRequest,
|
|
499
|
+
): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
500
|
+
|
|
384
501
|
getBundlesByProduct(
|
|
385
502
|
request: GetBundlesByProductRequest,
|
|
386
503
|
): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
|
|
@@ -396,6 +513,22 @@ export interface BundleServiceController {
|
|
|
396
513
|
checkBundleAvailability(
|
|
397
514
|
request: CheckBundleAvailabilityRequest,
|
|
398
515
|
): Promise<BundleAvailabilityResponse> | Observable<BundleAvailabilityResponse> | BundleAvailabilityResponse;
|
|
516
|
+
|
|
517
|
+
cloneBundle(
|
|
518
|
+
request: CloneBundleRequest,
|
|
519
|
+
): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
|
|
520
|
+
|
|
521
|
+
exportBundles(
|
|
522
|
+
request: ExportBundlesRequest,
|
|
523
|
+
): Promise<ExportBundlesResponse> | Observable<ExportBundlesResponse> | ExportBundlesResponse;
|
|
524
|
+
|
|
525
|
+
addCrossSellLink(
|
|
526
|
+
request: AddCrossSellLinkRequest,
|
|
527
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
528
|
+
|
|
529
|
+
generateBundleCollage(
|
|
530
|
+
request: GenerateBundleCollageRequest,
|
|
531
|
+
): Promise<GenerateBundleCollageResponse> | Observable<GenerateBundleCollageResponse> | GenerateBundleCollageResponse;
|
|
399
532
|
}
|
|
400
533
|
|
|
401
534
|
export function BundleServiceControllerMethods() {
|
|
@@ -409,12 +542,18 @@ export function BundleServiceControllerMethods() {
|
|
|
409
542
|
"addBundleItem",
|
|
410
543
|
"removeBundleItem",
|
|
411
544
|
"updateBundleItem",
|
|
545
|
+
"bulkAddBundleItems",
|
|
412
546
|
"addBundleRule",
|
|
413
547
|
"removeBundleRule",
|
|
548
|
+
"applyBundleRules",
|
|
414
549
|
"getBundlesByProduct",
|
|
415
550
|
"bulkUpdateBundleStatus",
|
|
416
551
|
"bulkDeleteBundles",
|
|
417
552
|
"checkBundleAvailability",
|
|
553
|
+
"cloneBundle",
|
|
554
|
+
"exportBundles",
|
|
555
|
+
"addCrossSellLink",
|
|
556
|
+
"generateBundleCollage",
|
|
418
557
|
];
|
|
419
558
|
for (const method of grpcMethods) {
|
|
420
559
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/package.json
CHANGED
package/proto/bundle.proto
CHANGED
|
@@ -14,21 +14,30 @@ service BundleService {
|
|
|
14
14
|
rpc AddBundleItem (AddBundleItemRequest) returns (BundleDetailResponse);
|
|
15
15
|
rpc RemoveBundleItem (RemoveBundleItemRequest) returns (BundleDetailResponse);
|
|
16
16
|
rpc UpdateBundleItem (UpdateBundleItemRequest) returns (BundleDetailResponse);
|
|
17
|
+
rpc BulkAddBundleItems (BulkAddBundleItemsRequest) returns (BundleDetailResponse);
|
|
17
18
|
|
|
18
|
-
|
|
19
19
|
rpc AddBundleRule (AddBundleRuleRequest) returns (SuccessResponse);
|
|
20
20
|
rpc RemoveBundleRule (RemoveBundleRuleRequest) returns (SuccessResponse);
|
|
21
|
-
rpc
|
|
21
|
+
rpc ApplyBundleRules (ApplyBundleRulesRequest) returns (BundleDetailResponse);
|
|
22
22
|
|
|
23
|
+
rpc GetBundlesByProduct (GetBundlesByProductRequest) returns (GetBundlesResponse);
|
|
23
24
|
|
|
24
25
|
rpc BulkUpdateBundleStatus (BulkUpdateBundleStatusRequest) returns (SuccessResponse);
|
|
25
26
|
rpc BulkDeleteBundles (BulkDeleteBundlesRequest) returns (SuccessResponse);
|
|
26
27
|
|
|
27
|
-
|
|
28
28
|
rpc CheckBundleAvailability (CheckBundleAvailabilityRequest) returns (BundleAvailabilityResponse);
|
|
29
|
+
|
|
30
|
+
rpc CloneBundle (CloneBundleRequest) returns (BundleDetailResponse);
|
|
31
|
+
rpc ExportBundles (ExportBundlesRequest) returns (ExportBundlesResponse);
|
|
32
|
+
|
|
33
|
+
rpc AddCrossSellLink (AddCrossSellLinkRequest) returns (SuccessResponse);
|
|
34
|
+
|
|
35
|
+
rpc GenerateBundleCollage (GenerateBundleCollageRequest) returns (GenerateBundleCollageResponse);
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
|
|
39
|
+
// ─── Enums ────────────────────────────────────────────────────────────────────
|
|
40
|
+
|
|
32
41
|
enum BundleStatus {
|
|
33
42
|
BUNDLE_STATUS_UNSPECIFIED = 0;
|
|
34
43
|
BUNDLE_STATUS_DRAFT = 1;
|
|
@@ -42,12 +51,35 @@ enum DiscountType {
|
|
|
42
51
|
DISCOUNT_TYPE_FIXED_AMOUNT = 2;
|
|
43
52
|
}
|
|
44
53
|
|
|
54
|
+
enum DisplayPlacement {
|
|
55
|
+
DISPLAY_PLACEMENT_UNSPECIFIED = 0;
|
|
56
|
+
DISPLAY_PLACEMENT_CART = 1;
|
|
57
|
+
DISPLAY_PLACEMENT_PRODUCT_PAGE = 2;
|
|
58
|
+
DISPLAY_PLACEMENT_POST_PURCHASE = 3;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
enum PriceMode {
|
|
62
|
+
PRICE_MODE_UNSPECIFIED = 0;
|
|
63
|
+
PRICE_MODE_FIXED_TOTAL = 1;
|
|
64
|
+
PRICE_MODE_PER_ITEM_DISCOUNT = 2;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
enum BundleType {
|
|
68
|
+
BUNDLE_TYPE_UNSPECIFIED = 0;
|
|
69
|
+
BUNDLE_TYPE_STANDARD = 1;
|
|
70
|
+
BUNDLE_TYPE_CROSS_SELL = 2;
|
|
71
|
+
BUNDLE_TYPE_UPSELL = 3;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
// ─── Requests ─────────────────────────────────────────────────────────────────
|
|
45
76
|
|
|
46
77
|
message GetBundlesRequest {
|
|
47
78
|
PaginationRequest pagination = 1;
|
|
48
79
|
optional string search = 2;
|
|
49
80
|
optional BundleStatus status = 3;
|
|
50
81
|
optional string product_id = 4;
|
|
82
|
+
optional BundleType bundle_type = 5;
|
|
51
83
|
}
|
|
52
84
|
|
|
53
85
|
message GetBundleRequest {
|
|
@@ -78,6 +110,13 @@ message CreateBundleRequest {
|
|
|
78
110
|
|
|
79
111
|
repeated BundleItemPayload items = 15;
|
|
80
112
|
string created_by_id = 16;
|
|
113
|
+
|
|
114
|
+
// NEW
|
|
115
|
+
repeated DisplayPlacement display_placements = 17;
|
|
116
|
+
PriceMode price_mode = 18;
|
|
117
|
+
bool require_all_in_stock = 19;
|
|
118
|
+
BundleType bundle_type = 20;
|
|
119
|
+
optional string anchor_product_id = 21;
|
|
81
120
|
}
|
|
82
121
|
|
|
83
122
|
message UpdateBundleRequest {
|
|
@@ -103,6 +142,13 @@ message UpdateBundleRequest {
|
|
|
103
142
|
map<string, string> meta_description = 15;
|
|
104
143
|
|
|
105
144
|
repeated BundleItemPayload items = 16;
|
|
145
|
+
|
|
146
|
+
// NEW
|
|
147
|
+
repeated DisplayPlacement display_placements = 17;
|
|
148
|
+
optional PriceMode price_mode = 18;
|
|
149
|
+
optional bool require_all_in_stock = 19;
|
|
150
|
+
optional BundleType bundle_type = 20;
|
|
151
|
+
optional string anchor_product_id = 21;
|
|
106
152
|
}
|
|
107
153
|
|
|
108
154
|
message DeleteBundleRequest {
|
|
@@ -137,9 +183,14 @@ message UpdateBundleItemRequest {
|
|
|
137
183
|
optional int32 sort_order = 6;
|
|
138
184
|
}
|
|
139
185
|
|
|
186
|
+
message BulkAddBundleItemsRequest {
|
|
187
|
+
string bundle_id = 1;
|
|
188
|
+
repeated BundleItemPayload items = 2;
|
|
189
|
+
}
|
|
190
|
+
|
|
140
191
|
message AddBundleRuleRequest {
|
|
141
192
|
string bundle_id = 1;
|
|
142
|
-
string rule_type = 2;
|
|
193
|
+
string rule_type = 2;
|
|
143
194
|
string target_id = 3;
|
|
144
195
|
repeated string excluded_product_ids = 4;
|
|
145
196
|
}
|
|
@@ -149,6 +200,10 @@ message RemoveBundleRuleRequest {
|
|
|
149
200
|
string rule_id = 2;
|
|
150
201
|
}
|
|
151
202
|
|
|
203
|
+
message ApplyBundleRulesRequest {
|
|
204
|
+
string bundle_id = 1;
|
|
205
|
+
}
|
|
206
|
+
|
|
152
207
|
message GetBundlesByProductRequest {
|
|
153
208
|
string product_id = 1;
|
|
154
209
|
optional BundleStatus status = 2;
|
|
@@ -167,6 +222,23 @@ message CheckBundleAvailabilityRequest {
|
|
|
167
222
|
string bundle_id = 1;
|
|
168
223
|
}
|
|
169
224
|
|
|
225
|
+
message CloneBundleRequest {
|
|
226
|
+
string bundle_id = 1;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
message ExportBundlesRequest {
|
|
230
|
+
optional BundleStatus status = 1;
|
|
231
|
+
optional BundleType bundle_type = 2;
|
|
232
|
+
string format = 3; // "json" | "csv"
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
message AddCrossSellLinkRequest {
|
|
236
|
+
string bundle_id = 1;
|
|
237
|
+
string anchor_product_id = 2;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
// ─── Responses ────────────────────────────────────────────────────────────────
|
|
170
242
|
|
|
171
243
|
message GetBundlesResponse {
|
|
172
244
|
repeated BundleListItemResponse items = 1;
|
|
@@ -188,9 +260,13 @@ message BundleListItemResponse {
|
|
|
188
260
|
int32 sort_order = 10;
|
|
189
261
|
|
|
190
262
|
int32 item_count = 11;
|
|
191
|
-
double original_price = 12;
|
|
192
|
-
double final_price = 13;
|
|
263
|
+
double original_price = 12;
|
|
264
|
+
double final_price = 13;
|
|
193
265
|
bool in_stock = 14;
|
|
266
|
+
|
|
267
|
+
// NEW
|
|
268
|
+
BundleType bundle_type = 15;
|
|
269
|
+
repeated DisplayPlacement display_placements = 16;
|
|
194
270
|
}
|
|
195
271
|
|
|
196
272
|
message BundleDetailResponse {
|
|
@@ -221,6 +297,13 @@ message BundleDetailResponse {
|
|
|
221
297
|
double original_price = 18;
|
|
222
298
|
double final_price = 19;
|
|
223
299
|
bool in_stock = 20;
|
|
300
|
+
|
|
301
|
+
// NEW
|
|
302
|
+
repeated DisplayPlacement display_placements = 21;
|
|
303
|
+
PriceMode price_mode = 22;
|
|
304
|
+
bool require_all_in_stock = 23;
|
|
305
|
+
BundleType bundle_type = 24;
|
|
306
|
+
optional string anchor_product_id = 25;
|
|
224
307
|
}
|
|
225
308
|
|
|
226
309
|
message BundleItemResponse {
|
|
@@ -232,7 +315,6 @@ message BundleItemResponse {
|
|
|
232
315
|
optional double item_discount_value = 6;
|
|
233
316
|
int32 sort_order = 7;
|
|
234
317
|
|
|
235
|
-
|
|
236
318
|
map<string, string> product_name = 8;
|
|
237
319
|
string product_image = 9;
|
|
238
320
|
string product_sku = 10;
|
|
@@ -246,8 +328,6 @@ message BundleRuleResponse {
|
|
|
246
328
|
string rule_type = 2;
|
|
247
329
|
string target_id = 3;
|
|
248
330
|
repeated string excluded_product_ids = 4;
|
|
249
|
-
|
|
250
|
-
|
|
251
331
|
map<string, string> target_name = 5;
|
|
252
332
|
}
|
|
253
333
|
|
|
@@ -262,4 +342,24 @@ message BundleItemAvailability {
|
|
|
262
342
|
int32 required_quantity = 3;
|
|
263
343
|
int32 available_quantity = 4;
|
|
264
344
|
bool in_stock = 5;
|
|
265
|
-
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
message ExportBundlesResponse {
|
|
348
|
+
string content = 1; // JSON string or CSV string
|
|
349
|
+
string format = 2;
|
|
350
|
+
int32 count = 3;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
message GenerateBundleCollageRequest {
|
|
354
|
+
string bundle_id = 1;
|
|
355
|
+
// Optional: override cell pixel size (default 400)
|
|
356
|
+
optional int32 cell_size = 2;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
message GenerateBundleCollageResponse {
|
|
360
|
+
string url = 1; // Public CDN/S3 URL of the collage JPEG
|
|
361
|
+
string key = 2; // S3 object key
|
|
362
|
+
int32 width = 3; // Final image width in pixels
|
|
363
|
+
int32 height = 4; // Final image height in pixels
|
|
364
|
+
string bundle_id = 5;
|
|
365
|
+
}
|