@mamindom/contracts 1.0.79 → 1.0.80

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.
@@ -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,12 @@ 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
+ }
297
365
  export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
298
366
  export interface BundleServiceClient {
299
367
  getBundles(request: GetBundlesRequest): Observable<GetBundlesResponse>;
@@ -304,12 +372,17 @@ export interface BundleServiceClient {
304
372
  addBundleItem(request: AddBundleItemRequest): Observable<BundleDetailResponse>;
305
373
  removeBundleItem(request: RemoveBundleItemRequest): Observable<BundleDetailResponse>;
306
374
  updateBundleItem(request: UpdateBundleItemRequest): Observable<BundleDetailResponse>;
375
+ bulkAddBundleItems(request: BulkAddBundleItemsRequest): Observable<BundleDetailResponse>;
307
376
  addBundleRule(request: AddBundleRuleRequest): Observable<SuccessResponse>;
308
377
  removeBundleRule(request: RemoveBundleRuleRequest): Observable<SuccessResponse>;
378
+ applyBundleRules(request: ApplyBundleRulesRequest): Observable<BundleDetailResponse>;
309
379
  getBundlesByProduct(request: GetBundlesByProductRequest): Observable<GetBundlesResponse>;
310
380
  bulkUpdateBundleStatus(request: BulkUpdateBundleStatusRequest): Observable<SuccessResponse>;
311
381
  bulkDeleteBundles(request: BulkDeleteBundlesRequest): Observable<SuccessResponse>;
312
382
  checkBundleAvailability(request: CheckBundleAvailabilityRequest): Observable<BundleAvailabilityResponse>;
383
+ cloneBundle(request: CloneBundleRequest): Observable<BundleDetailResponse>;
384
+ exportBundles(request: ExportBundlesRequest): Observable<ExportBundlesResponse>;
385
+ addCrossSellLink(request: AddCrossSellLinkRequest): Observable<SuccessResponse>;
313
386
  }
314
387
  export interface BundleServiceController {
315
388
  getBundles(request: GetBundlesRequest): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
@@ -320,12 +393,17 @@ export interface BundleServiceController {
320
393
  addBundleItem(request: AddBundleItemRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
321
394
  removeBundleItem(request: RemoveBundleItemRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
322
395
  updateBundleItem(request: UpdateBundleItemRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
396
+ bulkAddBundleItems(request: BulkAddBundleItemsRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
323
397
  addBundleRule(request: AddBundleRuleRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
324
398
  removeBundleRule(request: RemoveBundleRuleRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
399
+ applyBundleRules(request: ApplyBundleRulesRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
325
400
  getBundlesByProduct(request: GetBundlesByProductRequest): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
326
401
  bulkUpdateBundleStatus(request: BulkUpdateBundleStatusRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
327
402
  bulkDeleteBundles(request: BulkDeleteBundlesRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
328
403
  checkBundleAvailability(request: CheckBundleAvailabilityRequest): Promise<BundleAvailabilityResponse> | Observable<BundleAvailabilityResponse> | BundleAvailabilityResponse;
404
+ cloneBundle(request: CloneBundleRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
405
+ exportBundles(request: ExportBundlesRequest): Promise<ExportBundlesResponse> | Observable<ExportBundlesResponse> | ExportBundlesResponse;
406
+ addCrossSellLink(request: AddCrossSellLinkRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
329
407
  }
330
408
  export declare function BundleServiceControllerMethods(): (constructor: Function) => void;
331
409
  export declare const BUNDLE_SERVICE_NAME = "BundleService";
@@ -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,17 @@ 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",
46
74
  ];
47
75
  for (const method of grpcMethods) {
48
76
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -14,21 +14,28 @@ 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 GetBundlesByProduct (GetBundlesByProductRequest) returns (GetBundlesResponse);
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);
29
34
  }
30
35
 
31
36
 
37
+ // ─── Enums ────────────────────────────────────────────────────────────────────
38
+
32
39
  enum BundleStatus {
33
40
  BUNDLE_STATUS_UNSPECIFIED = 0;
34
41
  BUNDLE_STATUS_DRAFT = 1;
@@ -42,12 +49,35 @@ enum DiscountType {
42
49
  DISCOUNT_TYPE_FIXED_AMOUNT = 2;
43
50
  }
44
51
 
52
+ enum DisplayPlacement {
53
+ DISPLAY_PLACEMENT_UNSPECIFIED = 0;
54
+ DISPLAY_PLACEMENT_CART = 1;
55
+ DISPLAY_PLACEMENT_PRODUCT_PAGE = 2;
56
+ DISPLAY_PLACEMENT_POST_PURCHASE = 3;
57
+ }
58
+
59
+ enum PriceMode {
60
+ PRICE_MODE_UNSPECIFIED = 0;
61
+ PRICE_MODE_FIXED_TOTAL = 1;
62
+ PRICE_MODE_PER_ITEM_DISCOUNT = 2;
63
+ }
64
+
65
+ enum BundleType {
66
+ BUNDLE_TYPE_UNSPECIFIED = 0;
67
+ BUNDLE_TYPE_STANDARD = 1;
68
+ BUNDLE_TYPE_CROSS_SELL = 2;
69
+ BUNDLE_TYPE_UPSELL = 3;
70
+ }
71
+
72
+
73
+ // ─── Requests ─────────────────────────────────────────────────────────────────
45
74
 
46
75
  message GetBundlesRequest {
47
76
  PaginationRequest pagination = 1;
48
77
  optional string search = 2;
49
78
  optional BundleStatus status = 3;
50
79
  optional string product_id = 4;
80
+ optional BundleType bundle_type = 5;
51
81
  }
52
82
 
53
83
  message GetBundleRequest {
@@ -78,6 +108,13 @@ message CreateBundleRequest {
78
108
 
79
109
  repeated BundleItemPayload items = 15;
80
110
  string created_by_id = 16;
111
+
112
+ // NEW
113
+ repeated DisplayPlacement display_placements = 17;
114
+ PriceMode price_mode = 18;
115
+ bool require_all_in_stock = 19;
116
+ BundleType bundle_type = 20;
117
+ optional string anchor_product_id = 21;
81
118
  }
82
119
 
83
120
  message UpdateBundleRequest {
@@ -103,6 +140,13 @@ message UpdateBundleRequest {
103
140
  map<string, string> meta_description = 15;
104
141
 
105
142
  repeated BundleItemPayload items = 16;
143
+
144
+ // NEW
145
+ repeated DisplayPlacement display_placements = 17;
146
+ optional PriceMode price_mode = 18;
147
+ optional bool require_all_in_stock = 19;
148
+ optional BundleType bundle_type = 20;
149
+ optional string anchor_product_id = 21;
106
150
  }
107
151
 
108
152
  message DeleteBundleRequest {
@@ -137,9 +181,14 @@ message UpdateBundleItemRequest {
137
181
  optional int32 sort_order = 6;
138
182
  }
139
183
 
184
+ message BulkAddBundleItemsRequest {
185
+ string bundle_id = 1;
186
+ repeated BundleItemPayload items = 2;
187
+ }
188
+
140
189
  message AddBundleRuleRequest {
141
190
  string bundle_id = 1;
142
- string rule_type = 2;
191
+ string rule_type = 2;
143
192
  string target_id = 3;
144
193
  repeated string excluded_product_ids = 4;
145
194
  }
@@ -149,6 +198,10 @@ message RemoveBundleRuleRequest {
149
198
  string rule_id = 2;
150
199
  }
151
200
 
201
+ message ApplyBundleRulesRequest {
202
+ string bundle_id = 1;
203
+ }
204
+
152
205
  message GetBundlesByProductRequest {
153
206
  string product_id = 1;
154
207
  optional BundleStatus status = 2;
@@ -167,6 +220,23 @@ message CheckBundleAvailabilityRequest {
167
220
  string bundle_id = 1;
168
221
  }
169
222
 
223
+ message CloneBundleRequest {
224
+ string bundle_id = 1;
225
+ }
226
+
227
+ message ExportBundlesRequest {
228
+ optional BundleStatus status = 1;
229
+ optional BundleType bundle_type = 2;
230
+ string format = 3; // "json" | "csv"
231
+ }
232
+
233
+ message AddCrossSellLinkRequest {
234
+ string bundle_id = 1;
235
+ string anchor_product_id = 2;
236
+ }
237
+
238
+
239
+ // ─── Responses ────────────────────────────────────────────────────────────────
170
240
 
171
241
  message GetBundlesResponse {
172
242
  repeated BundleListItemResponse items = 1;
@@ -188,9 +258,13 @@ message BundleListItemResponse {
188
258
  int32 sort_order = 10;
189
259
 
190
260
  int32 item_count = 11;
191
- double original_price = 12;
192
- double final_price = 13;
261
+ double original_price = 12;
262
+ double final_price = 13;
193
263
  bool in_stock = 14;
264
+
265
+ // NEW
266
+ BundleType bundle_type = 15;
267
+ repeated DisplayPlacement display_placements = 16;
194
268
  }
195
269
 
196
270
  message BundleDetailResponse {
@@ -221,6 +295,13 @@ message BundleDetailResponse {
221
295
  double original_price = 18;
222
296
  double final_price = 19;
223
297
  bool in_stock = 20;
298
+
299
+ // NEW
300
+ repeated DisplayPlacement display_placements = 21;
301
+ PriceMode price_mode = 22;
302
+ bool require_all_in_stock = 23;
303
+ BundleType bundle_type = 24;
304
+ optional string anchor_product_id = 25;
224
305
  }
225
306
 
226
307
  message BundleItemResponse {
@@ -232,7 +313,6 @@ message BundleItemResponse {
232
313
  optional double item_discount_value = 6;
233
314
  int32 sort_order = 7;
234
315
 
235
-
236
316
  map<string, string> product_name = 8;
237
317
  string product_image = 9;
238
318
  string product_sku = 10;
@@ -246,8 +326,6 @@ message BundleRuleResponse {
246
326
  string rule_type = 2;
247
327
  string target_id = 3;
248
328
  repeated string excluded_product_ids = 4;
249
-
250
-
251
329
  map<string, string> target_name = 5;
252
330
  }
253
331
 
@@ -262,4 +340,10 @@ message BundleItemAvailability {
262
340
  int32 required_quantity = 3;
263
341
  int32 available_quantity = 4;
264
342
  bool in_stock = 5;
265
- }
343
+ }
344
+
345
+ message ExportBundlesResponse {
346
+ string content = 1; // JSON string or CSV string
347
+ string format = 2;
348
+ int32 count = 3;
349
+ }
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,13 @@ 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
+
313
392
  export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
314
393
 
315
394
  export interface BundleServiceClient {
@@ -329,10 +408,14 @@ export interface BundleServiceClient {
329
408
 
330
409
  updateBundleItem(request: UpdateBundleItemRequest): Observable<BundleDetailResponse>;
331
410
 
411
+ bulkAddBundleItems(request: BulkAddBundleItemsRequest): Observable<BundleDetailResponse>;
412
+
332
413
  addBundleRule(request: AddBundleRuleRequest): Observable<SuccessResponse>;
333
414
 
334
415
  removeBundleRule(request: RemoveBundleRuleRequest): Observable<SuccessResponse>;
335
416
 
417
+ applyBundleRules(request: ApplyBundleRulesRequest): Observable<BundleDetailResponse>;
418
+
336
419
  getBundlesByProduct(request: GetBundlesByProductRequest): Observable<GetBundlesResponse>;
337
420
 
338
421
  bulkUpdateBundleStatus(request: BulkUpdateBundleStatusRequest): Observable<SuccessResponse>;
@@ -340,6 +423,12 @@ export interface BundleServiceClient {
340
423
  bulkDeleteBundles(request: BulkDeleteBundlesRequest): Observable<SuccessResponse>;
341
424
 
342
425
  checkBundleAvailability(request: CheckBundleAvailabilityRequest): Observable<BundleAvailabilityResponse>;
426
+
427
+ cloneBundle(request: CloneBundleRequest): Observable<BundleDetailResponse>;
428
+
429
+ exportBundles(request: ExportBundlesRequest): Observable<ExportBundlesResponse>;
430
+
431
+ addCrossSellLink(request: AddCrossSellLinkRequest): Observable<SuccessResponse>;
343
432
  }
344
433
 
345
434
  export interface BundleServiceController {
@@ -373,6 +462,10 @@ export interface BundleServiceController {
373
462
  request: UpdateBundleItemRequest,
374
463
  ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
375
464
 
465
+ bulkAddBundleItems(
466
+ request: BulkAddBundleItemsRequest,
467
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
468
+
376
469
  addBundleRule(
377
470
  request: AddBundleRuleRequest,
378
471
  ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
@@ -381,6 +474,10 @@ export interface BundleServiceController {
381
474
  request: RemoveBundleRuleRequest,
382
475
  ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
383
476
 
477
+ applyBundleRules(
478
+ request: ApplyBundleRulesRequest,
479
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
480
+
384
481
  getBundlesByProduct(
385
482
  request: GetBundlesByProductRequest,
386
483
  ): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
@@ -396,6 +493,18 @@ export interface BundleServiceController {
396
493
  checkBundleAvailability(
397
494
  request: CheckBundleAvailabilityRequest,
398
495
  ): Promise<BundleAvailabilityResponse> | Observable<BundleAvailabilityResponse> | BundleAvailabilityResponse;
496
+
497
+ cloneBundle(
498
+ request: CloneBundleRequest,
499
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
500
+
501
+ exportBundles(
502
+ request: ExportBundlesRequest,
503
+ ): Promise<ExportBundlesResponse> | Observable<ExportBundlesResponse> | ExportBundlesResponse;
504
+
505
+ addCrossSellLink(
506
+ request: AddCrossSellLinkRequest,
507
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
399
508
  }
400
509
 
401
510
  export function BundleServiceControllerMethods() {
@@ -409,12 +518,17 @@ export function BundleServiceControllerMethods() {
409
518
  "addBundleItem",
410
519
  "removeBundleItem",
411
520
  "updateBundleItem",
521
+ "bulkAddBundleItems",
412
522
  "addBundleRule",
413
523
  "removeBundleRule",
524
+ "applyBundleRules",
414
525
  "getBundlesByProduct",
415
526
  "bulkUpdateBundleStatus",
416
527
  "bulkDeleteBundles",
417
528
  "checkBundleAvailability",
529
+ "cloneBundle",
530
+ "exportBundles",
531
+ "addCrossSellLink",
418
532
  ];
419
533
  for (const method of grpcMethods) {
420
534
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.79",
4
+ "version": "1.0.80",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -14,21 +14,28 @@ 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 GetBundlesByProduct (GetBundlesByProductRequest) returns (GetBundlesResponse);
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);
29
34
  }
30
35
 
31
36
 
37
+ // ─── Enums ────────────────────────────────────────────────────────────────────
38
+
32
39
  enum BundleStatus {
33
40
  BUNDLE_STATUS_UNSPECIFIED = 0;
34
41
  BUNDLE_STATUS_DRAFT = 1;
@@ -42,12 +49,35 @@ enum DiscountType {
42
49
  DISCOUNT_TYPE_FIXED_AMOUNT = 2;
43
50
  }
44
51
 
52
+ enum DisplayPlacement {
53
+ DISPLAY_PLACEMENT_UNSPECIFIED = 0;
54
+ DISPLAY_PLACEMENT_CART = 1;
55
+ DISPLAY_PLACEMENT_PRODUCT_PAGE = 2;
56
+ DISPLAY_PLACEMENT_POST_PURCHASE = 3;
57
+ }
58
+
59
+ enum PriceMode {
60
+ PRICE_MODE_UNSPECIFIED = 0;
61
+ PRICE_MODE_FIXED_TOTAL = 1;
62
+ PRICE_MODE_PER_ITEM_DISCOUNT = 2;
63
+ }
64
+
65
+ enum BundleType {
66
+ BUNDLE_TYPE_UNSPECIFIED = 0;
67
+ BUNDLE_TYPE_STANDARD = 1;
68
+ BUNDLE_TYPE_CROSS_SELL = 2;
69
+ BUNDLE_TYPE_UPSELL = 3;
70
+ }
71
+
72
+
73
+ // ─── Requests ─────────────────────────────────────────────────────────────────
45
74
 
46
75
  message GetBundlesRequest {
47
76
  PaginationRequest pagination = 1;
48
77
  optional string search = 2;
49
78
  optional BundleStatus status = 3;
50
79
  optional string product_id = 4;
80
+ optional BundleType bundle_type = 5;
51
81
  }
52
82
 
53
83
  message GetBundleRequest {
@@ -78,6 +108,13 @@ message CreateBundleRequest {
78
108
 
79
109
  repeated BundleItemPayload items = 15;
80
110
  string created_by_id = 16;
111
+
112
+ // NEW
113
+ repeated DisplayPlacement display_placements = 17;
114
+ PriceMode price_mode = 18;
115
+ bool require_all_in_stock = 19;
116
+ BundleType bundle_type = 20;
117
+ optional string anchor_product_id = 21;
81
118
  }
82
119
 
83
120
  message UpdateBundleRequest {
@@ -103,6 +140,13 @@ message UpdateBundleRequest {
103
140
  map<string, string> meta_description = 15;
104
141
 
105
142
  repeated BundleItemPayload items = 16;
143
+
144
+ // NEW
145
+ repeated DisplayPlacement display_placements = 17;
146
+ optional PriceMode price_mode = 18;
147
+ optional bool require_all_in_stock = 19;
148
+ optional BundleType bundle_type = 20;
149
+ optional string anchor_product_id = 21;
106
150
  }
107
151
 
108
152
  message DeleteBundleRequest {
@@ -137,9 +181,14 @@ message UpdateBundleItemRequest {
137
181
  optional int32 sort_order = 6;
138
182
  }
139
183
 
184
+ message BulkAddBundleItemsRequest {
185
+ string bundle_id = 1;
186
+ repeated BundleItemPayload items = 2;
187
+ }
188
+
140
189
  message AddBundleRuleRequest {
141
190
  string bundle_id = 1;
142
- string rule_type = 2;
191
+ string rule_type = 2;
143
192
  string target_id = 3;
144
193
  repeated string excluded_product_ids = 4;
145
194
  }
@@ -149,6 +198,10 @@ message RemoveBundleRuleRequest {
149
198
  string rule_id = 2;
150
199
  }
151
200
 
201
+ message ApplyBundleRulesRequest {
202
+ string bundle_id = 1;
203
+ }
204
+
152
205
  message GetBundlesByProductRequest {
153
206
  string product_id = 1;
154
207
  optional BundleStatus status = 2;
@@ -167,6 +220,23 @@ message CheckBundleAvailabilityRequest {
167
220
  string bundle_id = 1;
168
221
  }
169
222
 
223
+ message CloneBundleRequest {
224
+ string bundle_id = 1;
225
+ }
226
+
227
+ message ExportBundlesRequest {
228
+ optional BundleStatus status = 1;
229
+ optional BundleType bundle_type = 2;
230
+ string format = 3; // "json" | "csv"
231
+ }
232
+
233
+ message AddCrossSellLinkRequest {
234
+ string bundle_id = 1;
235
+ string anchor_product_id = 2;
236
+ }
237
+
238
+
239
+ // ─── Responses ────────────────────────────────────────────────────────────────
170
240
 
171
241
  message GetBundlesResponse {
172
242
  repeated BundleListItemResponse items = 1;
@@ -188,9 +258,13 @@ message BundleListItemResponse {
188
258
  int32 sort_order = 10;
189
259
 
190
260
  int32 item_count = 11;
191
- double original_price = 12;
192
- double final_price = 13;
261
+ double original_price = 12;
262
+ double final_price = 13;
193
263
  bool in_stock = 14;
264
+
265
+ // NEW
266
+ BundleType bundle_type = 15;
267
+ repeated DisplayPlacement display_placements = 16;
194
268
  }
195
269
 
196
270
  message BundleDetailResponse {
@@ -221,6 +295,13 @@ message BundleDetailResponse {
221
295
  double original_price = 18;
222
296
  double final_price = 19;
223
297
  bool in_stock = 20;
298
+
299
+ // NEW
300
+ repeated DisplayPlacement display_placements = 21;
301
+ PriceMode price_mode = 22;
302
+ bool require_all_in_stock = 23;
303
+ BundleType bundle_type = 24;
304
+ optional string anchor_product_id = 25;
224
305
  }
225
306
 
226
307
  message BundleItemResponse {
@@ -232,7 +313,6 @@ message BundleItemResponse {
232
313
  optional double item_discount_value = 6;
233
314
  int32 sort_order = 7;
234
315
 
235
-
236
316
  map<string, string> product_name = 8;
237
317
  string product_image = 9;
238
318
  string product_sku = 10;
@@ -246,8 +326,6 @@ message BundleRuleResponse {
246
326
  string rule_type = 2;
247
327
  string target_id = 3;
248
328
  repeated string excluded_product_ids = 4;
249
-
250
-
251
329
  map<string, string> target_name = 5;
252
330
  }
253
331
 
@@ -262,4 +340,10 @@ message BundleItemAvailability {
262
340
  int32 required_quantity = 3;
263
341
  int32 available_quantity = 4;
264
342
  bool in_stock = 5;
265
- }
343
+ }
344
+
345
+ message ExportBundlesResponse {
346
+ string content = 1; // JSON string or CSV string
347
+ string format = 2;
348
+ int32 count = 3;
349
+ }