@mamindom/contracts 1.0.113 → 1.0.115

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.
@@ -100,6 +100,7 @@ export interface ProductListItemResponse {
100
100
  rating: number;
101
101
  reviewCount: number;
102
102
  stickers: ProductStickerResponse[];
103
+ activePromo?: ProductPromoInfo | undefined;
103
104
  }
104
105
  export interface ProductListItemResponse_NameEntry {
105
106
  key: string;
@@ -161,6 +162,7 @@ export interface ProductDetailResponse {
161
162
  rating: number;
162
163
  reviewCount: number;
163
164
  manualRating?: number | undefined;
165
+ activePromo?: ProductPromoInfo | undefined;
164
166
  }
165
167
  export interface ProductDetailResponse_NameEntry {
166
168
  key: string;
@@ -296,6 +298,31 @@ export interface GetProductsRequest {
296
298
  sortBy?: string | undefined;
297
299
  attributeValueIds: string[];
298
300
  brandIds: string[];
301
+ productIds: string[];
302
+ promotionFilter?: PromotionFilter | undefined;
303
+ }
304
+ export interface PromotionFilter {
305
+ includeProductIds: string[];
306
+ includeCategoryIds: string[];
307
+ includeBrandIds: string[];
308
+ excludeProductIds: string[];
309
+ excludeCategoryIds: string[];
310
+ excludeBrandIds: string[];
311
+ }
312
+ export interface ProductPromoInfo {
313
+ id: string;
314
+ name: {
315
+ [key: string]: string;
316
+ };
317
+ label: string;
318
+ labelColor: string;
319
+ discountedPrice: number;
320
+ seoSlug?: string | undefined;
321
+ priority: number;
322
+ }
323
+ export interface ProductPromoInfo_NameEntry {
324
+ key: string;
325
+ value: string;
299
326
  }
300
327
  export interface GetProductsResponse {
301
328
  items: ProductListItemResponse[];
@@ -339,6 +339,67 @@ export interface RemovePromotionProductsRequest {
339
339
  promotionId: string;
340
340
  productIds: string[];
341
341
  }
342
+ export interface GetPromotionEligibleProductIdsRequest {
343
+ promotionId: string;
344
+ }
345
+ /**
346
+ * Returns the full membership of the promotion (NOT resolved to a flat list).
347
+ * Catalog-service joins these (UNION include − exclude) using its own data.
348
+ */
349
+ export interface GetPromotionEligibleProductIdsResponse {
350
+ includeProductIds: string[];
351
+ includeCategoryIds: string[];
352
+ includeBrandIds: string[];
353
+ excludeProductIds: string[];
354
+ excludeCategoryIds: string[];
355
+ excludeBrandIds: string[];
356
+ exists?: boolean | undefined;
357
+ }
358
+ export interface GetActivePromotionsSnapshotRequest {
359
+ }
360
+ export interface ActivePromotionSnapshotItem {
361
+ id: string;
362
+ name: {
363
+ [key: string]: string;
364
+ };
365
+ type: PromotionType;
366
+ discountType: DiscountType;
367
+ discountValue: number;
368
+ priority: number;
369
+ seoSlug?: string | undefined;
370
+ startsAt?: string | undefined;
371
+ endsAt?: string | undefined;
372
+ /** Resolved eligible product IDs (already deduped, exclusions applied). */
373
+ productIds: string[];
374
+ categoryIds: string[];
375
+ brandIds: string[];
376
+ excludedProductIds: string[];
377
+ excludedCategoryIds: string[];
378
+ excludedBrandIds: string[];
379
+ /** Per-product label/color override (key = productId). */
380
+ productLabels: {
381
+ [key: string]: string;
382
+ };
383
+ productLabelColors: {
384
+ [key: string]: string;
385
+ };
386
+ }
387
+ export interface ActivePromotionSnapshotItem_NameEntry {
388
+ key: string;
389
+ value: string;
390
+ }
391
+ export interface ActivePromotionSnapshotItem_ProductLabelsEntry {
392
+ key: string;
393
+ value: string;
394
+ }
395
+ export interface ActivePromotionSnapshotItem_ProductLabelColorsEntry {
396
+ key: string;
397
+ value: string;
398
+ }
399
+ export interface GetActivePromotionsSnapshotResponse {
400
+ items: ActivePromotionSnapshotItem[];
401
+ generatedAt: number;
402
+ }
342
403
  export interface GetPromotionCategoriesRequest {
343
404
  promotionId: string;
344
405
  }
@@ -389,8 +450,10 @@ export interface PromotionServiceClient {
389
450
  updatePromotionStatus(request: UpdatePromotionStatusRequest): Observable<PromotionResponse>;
390
451
  bulkApplyToCategories(request: BulkApplyToCategoriesRequest): Observable<SuccessResponse>;
391
452
  getActivePromotions(request: GetActivePromotionsRequest): Observable<GetActivePromotionsResponse>;
453
+ getActivePromotionsSnapshot(request: GetActivePromotionsSnapshotRequest): Observable<GetActivePromotionsSnapshotResponse>;
392
454
  /** Products */
393
455
  getPromotionProducts(request: GetPromotionProductsRequest): Observable<GetPromotionProductsResponse>;
456
+ getPromotionEligibleProductIds(request: GetPromotionEligibleProductIdsRequest): Observable<GetPromotionEligibleProductIdsResponse>;
394
457
  addPromotionProducts(request: AddPromotionProductsRequest): Observable<SuccessResponse>;
395
458
  removePromotionProducts(request: RemovePromotionProductsRequest): Observable<SuccessResponse>;
396
459
  /** Categories */
@@ -414,8 +477,10 @@ export interface PromotionServiceController {
414
477
  updatePromotionStatus(request: UpdatePromotionStatusRequest): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
415
478
  bulkApplyToCategories(request: BulkApplyToCategoriesRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
416
479
  getActivePromotions(request: GetActivePromotionsRequest): Promise<GetActivePromotionsResponse> | Observable<GetActivePromotionsResponse> | GetActivePromotionsResponse;
480
+ getActivePromotionsSnapshot(request: GetActivePromotionsSnapshotRequest): Promise<GetActivePromotionsSnapshotResponse> | Observable<GetActivePromotionsSnapshotResponse> | GetActivePromotionsSnapshotResponse;
417
481
  /** Products */
418
482
  getPromotionProducts(request: GetPromotionProductsRequest): Promise<GetPromotionProductsResponse> | Observable<GetPromotionProductsResponse> | GetPromotionProductsResponse;
483
+ getPromotionEligibleProductIds(request: GetPromotionEligibleProductIdsRequest): Promise<GetPromotionEligibleProductIdsResponse> | Observable<GetPromotionEligibleProductIdsResponse> | GetPromotionEligibleProductIdsResponse;
419
484
  addPromotionProducts(request: AddPromotionProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
420
485
  removePromotionProducts(request: RemovePromotionProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
421
486
  /** Categories */
@@ -85,7 +85,9 @@ function PromotionServiceControllerMethods() {
85
85
  "updatePromotionStatus",
86
86
  "bulkApplyToCategories",
87
87
  "getActivePromotions",
88
+ "getActivePromotionsSnapshot",
88
89
  "getPromotionProducts",
90
+ "getPromotionEligibleProductIds",
89
91
  "addPromotionProducts",
90
92
  "removePromotionProducts",
91
93
  "getPromotionCategories",
@@ -161,6 +161,7 @@ message ProductListItemResponse {
161
161
  float rating = 20;
162
162
  int32 review_count = 21;
163
163
  repeated ProductStickerResponse stickers = 22;
164
+ optional ProductPromoInfo active_promo = 23;
164
165
  }
165
166
 
166
167
 
@@ -208,6 +209,7 @@ message ProductDetailResponse {
208
209
  float rating = 35;
209
210
  int32 review_count = 36;
210
211
  optional float manual_rating = 37;
212
+ optional ProductPromoInfo active_promo = 38;
211
213
  }
212
214
 
213
215
 
@@ -281,6 +283,27 @@ message GetProductsRequest {
281
283
 
282
284
  repeated string attribute_value_ids = 10;
283
285
  repeated string brand_ids = 11;
286
+ repeated string product_ids = 12;
287
+ optional PromotionFilter promotion_filter = 13;
288
+ }
289
+
290
+ message PromotionFilter {
291
+ repeated string include_product_ids = 1;
292
+ repeated string include_category_ids = 2;
293
+ repeated string include_brand_ids = 3;
294
+ repeated string exclude_product_ids = 4;
295
+ repeated string exclude_category_ids = 5;
296
+ repeated string exclude_brand_ids = 6;
297
+ }
298
+
299
+ message ProductPromoInfo {
300
+ string id = 1;
301
+ map<string, string> name = 2;
302
+ string label = 3;
303
+ string label_color = 4;
304
+ double discounted_price = 5;
305
+ optional string seo_slug = 6;
306
+ int32 priority = 7;
284
307
  }
285
308
 
286
309
  message GetProductsResponse {
@@ -17,9 +17,11 @@ service PromotionService {
17
17
  rpc BulkApplyToCategories (BulkApplyToCategoriesRequest) returns (SuccessResponse);
18
18
 
19
19
  rpc GetActivePromotions (GetActivePromotionsRequest) returns (GetActivePromotionsResponse);
20
+ rpc GetActivePromotionsSnapshot (GetActivePromotionsSnapshotRequest) returns (GetActivePromotionsSnapshotResponse);
20
21
 
21
22
  // Products
22
23
  rpc GetPromotionProducts (GetPromotionProductsRequest) returns (GetPromotionProductsResponse);
24
+ rpc GetPromotionEligibleProductIds (GetPromotionEligibleProductIdsRequest) returns (GetPromotionEligibleProductIdsResponse);
23
25
  rpc AddPromotionProducts (AddPromotionProductsRequest) returns (SuccessResponse);
24
26
  rpc RemovePromotionProducts (RemovePromotionProductsRequest) returns (SuccessResponse);
25
27
 
@@ -370,6 +372,53 @@ message RemovePromotionProductsRequest {
370
372
  repeated string product_ids = 2;
371
373
  }
372
374
 
375
+ message GetPromotionEligibleProductIdsRequest {
376
+ string promotion_id = 1;
377
+ }
378
+
379
+ // Returns the full membership of the promotion (NOT resolved to a flat list).
380
+ // Catalog-service joins these (UNION include − exclude) using its own data.
381
+ message GetPromotionEligibleProductIdsResponse {
382
+ repeated string include_product_ids = 1;
383
+ repeated string include_category_ids = 2;
384
+ repeated string include_brand_ids = 3;
385
+ repeated string exclude_product_ids = 4;
386
+ repeated string exclude_category_ids = 5;
387
+ repeated string exclude_brand_ids = 6;
388
+ optional bool exists = 7;
389
+ }
390
+
391
+ // ─── Active promotions snapshot (for cross-service enrichment) ───────────────
392
+
393
+ message GetActivePromotionsSnapshotRequest {}
394
+
395
+ message ActivePromotionSnapshotItem {
396
+ string id = 1;
397
+ map<string, string> name = 2;
398
+ PromotionType type = 3;
399
+ DiscountType discount_type = 4;
400
+ double discount_value = 5;
401
+ int32 priority = 6;
402
+ optional string seo_slug = 7;
403
+ optional string starts_at = 8;
404
+ optional string ends_at = 9;
405
+ // Resolved eligible product IDs (already deduped, exclusions applied).
406
+ repeated string product_ids = 10;
407
+ repeated string category_ids = 11;
408
+ repeated string brand_ids = 12;
409
+ repeated string excluded_product_ids = 13;
410
+ repeated string excluded_category_ids = 14;
411
+ repeated string excluded_brand_ids = 15;
412
+ // Per-product label/color override (key = productId).
413
+ map<string, string> product_labels = 16;
414
+ map<string, string> product_label_colors = 17;
415
+ }
416
+
417
+ message GetActivePromotionsSnapshotResponse {
418
+ repeated ActivePromotionSnapshotItem items = 1;
419
+ int64 generated_at = 2;
420
+ }
421
+
373
422
 
374
423
  // ─── Categories ───────────────────────────────────────────────────────────────
375
424
 
package/gen/product.ts CHANGED
@@ -121,6 +121,7 @@ export interface ProductListItemResponse {
121
121
  rating: number;
122
122
  reviewCount: number;
123
123
  stickers: ProductStickerResponse[];
124
+ activePromo?: ProductPromoInfo | undefined;
124
125
  }
125
126
 
126
127
  export interface ProductListItemResponse_NameEntry {
@@ -166,6 +167,7 @@ export interface ProductDetailResponse {
166
167
  rating: number;
167
168
  reviewCount: number;
168
169
  manualRating?: number | undefined;
170
+ activePromo?: ProductPromoInfo | undefined;
169
171
  }
170
172
 
171
173
  export interface ProductDetailResponse_NameEntry {
@@ -310,6 +312,32 @@ export interface GetProductsRequest {
310
312
  sortBy?: string | undefined;
311
313
  attributeValueIds: string[];
312
314
  brandIds: string[];
315
+ productIds: string[];
316
+ promotionFilter?: PromotionFilter | undefined;
317
+ }
318
+
319
+ export interface PromotionFilter {
320
+ includeProductIds: string[];
321
+ includeCategoryIds: string[];
322
+ includeBrandIds: string[];
323
+ excludeProductIds: string[];
324
+ excludeCategoryIds: string[];
325
+ excludeBrandIds: string[];
326
+ }
327
+
328
+ export interface ProductPromoInfo {
329
+ id: string;
330
+ name: { [key: string]: string };
331
+ label: string;
332
+ labelColor: string;
333
+ discountedPrice: number;
334
+ seoSlug?: string | undefined;
335
+ priority: number;
336
+ }
337
+
338
+ export interface ProductPromoInfo_NameEntry {
339
+ key: string;
340
+ value: string;
313
341
  }
314
342
 
315
343
  export interface GetProductsResponse {
package/gen/promotion.ts CHANGED
@@ -369,6 +369,71 @@ export interface RemovePromotionProductsRequest {
369
369
  productIds: string[];
370
370
  }
371
371
 
372
+ export interface GetPromotionEligibleProductIdsRequest {
373
+ promotionId: string;
374
+ }
375
+
376
+ /**
377
+ * Returns the full membership of the promotion (NOT resolved to a flat list).
378
+ * Catalog-service joins these (UNION include − exclude) using its own data.
379
+ */
380
+ export interface GetPromotionEligibleProductIdsResponse {
381
+ includeProductIds: string[];
382
+ includeCategoryIds: string[];
383
+ includeBrandIds: string[];
384
+ excludeProductIds: string[];
385
+ excludeCategoryIds: string[];
386
+ excludeBrandIds: string[];
387
+ exists?: boolean | undefined;
388
+ }
389
+
390
+ export interface GetActivePromotionsSnapshotRequest {
391
+ }
392
+
393
+ export interface ActivePromotionSnapshotItem {
394
+ id: string;
395
+ name: { [key: string]: string };
396
+ type: PromotionType;
397
+ discountType: DiscountType;
398
+ discountValue: number;
399
+ priority: number;
400
+ seoSlug?: string | undefined;
401
+ startsAt?: string | undefined;
402
+ endsAt?:
403
+ | string
404
+ | undefined;
405
+ /** Resolved eligible product IDs (already deduped, exclusions applied). */
406
+ productIds: string[];
407
+ categoryIds: string[];
408
+ brandIds: string[];
409
+ excludedProductIds: string[];
410
+ excludedCategoryIds: string[];
411
+ excludedBrandIds: string[];
412
+ /** Per-product label/color override (key = productId). */
413
+ productLabels: { [key: string]: string };
414
+ productLabelColors: { [key: string]: string };
415
+ }
416
+
417
+ export interface ActivePromotionSnapshotItem_NameEntry {
418
+ key: string;
419
+ value: string;
420
+ }
421
+
422
+ export interface ActivePromotionSnapshotItem_ProductLabelsEntry {
423
+ key: string;
424
+ value: string;
425
+ }
426
+
427
+ export interface ActivePromotionSnapshotItem_ProductLabelColorsEntry {
428
+ key: string;
429
+ value: string;
430
+ }
431
+
432
+ export interface GetActivePromotionsSnapshotResponse {
433
+ items: ActivePromotionSnapshotItem[];
434
+ generatedAt: number;
435
+ }
436
+
372
437
  export interface GetPromotionCategoriesRequest {
373
438
  promotionId: string;
374
439
  }
@@ -440,10 +505,18 @@ export interface PromotionServiceClient {
440
505
 
441
506
  getActivePromotions(request: GetActivePromotionsRequest): Observable<GetActivePromotionsResponse>;
442
507
 
508
+ getActivePromotionsSnapshot(
509
+ request: GetActivePromotionsSnapshotRequest,
510
+ ): Observable<GetActivePromotionsSnapshotResponse>;
511
+
443
512
  /** Products */
444
513
 
445
514
  getPromotionProducts(request: GetPromotionProductsRequest): Observable<GetPromotionProductsResponse>;
446
515
 
516
+ getPromotionEligibleProductIds(
517
+ request: GetPromotionEligibleProductIdsRequest,
518
+ ): Observable<GetPromotionEligibleProductIdsResponse>;
519
+
447
520
  addPromotionProducts(request: AddPromotionProductsRequest): Observable<SuccessResponse>;
448
521
 
449
522
  removePromotionProducts(request: RemovePromotionProductsRequest): Observable<SuccessResponse>;
@@ -506,12 +579,26 @@ export interface PromotionServiceController {
506
579
  request: GetActivePromotionsRequest,
507
580
  ): Promise<GetActivePromotionsResponse> | Observable<GetActivePromotionsResponse> | GetActivePromotionsResponse;
508
581
 
582
+ getActivePromotionsSnapshot(
583
+ request: GetActivePromotionsSnapshotRequest,
584
+ ):
585
+ | Promise<GetActivePromotionsSnapshotResponse>
586
+ | Observable<GetActivePromotionsSnapshotResponse>
587
+ | GetActivePromotionsSnapshotResponse;
588
+
509
589
  /** Products */
510
590
 
511
591
  getPromotionProducts(
512
592
  request: GetPromotionProductsRequest,
513
593
  ): Promise<GetPromotionProductsResponse> | Observable<GetPromotionProductsResponse> | GetPromotionProductsResponse;
514
594
 
595
+ getPromotionEligibleProductIds(
596
+ request: GetPromotionEligibleProductIdsRequest,
597
+ ):
598
+ | Promise<GetPromotionEligibleProductIdsResponse>
599
+ | Observable<GetPromotionEligibleProductIdsResponse>
600
+ | GetPromotionEligibleProductIdsResponse;
601
+
515
602
  addPromotionProducts(
516
603
  request: AddPromotionProductsRequest,
517
604
  ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
@@ -570,7 +657,9 @@ export function PromotionServiceControllerMethods() {
570
657
  "updatePromotionStatus",
571
658
  "bulkApplyToCategories",
572
659
  "getActivePromotions",
660
+ "getActivePromotionsSnapshot",
573
661
  "getPromotionProducts",
662
+ "getPromotionEligibleProductIds",
574
663
  "addPromotionProducts",
575
664
  "removePromotionProducts",
576
665
  "getPromotionCategories",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.113",
4
+ "version": "1.0.115",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -161,6 +161,7 @@ message ProductListItemResponse {
161
161
  float rating = 20;
162
162
  int32 review_count = 21;
163
163
  repeated ProductStickerResponse stickers = 22;
164
+ optional ProductPromoInfo active_promo = 23;
164
165
  }
165
166
 
166
167
 
@@ -208,6 +209,7 @@ message ProductDetailResponse {
208
209
  float rating = 35;
209
210
  int32 review_count = 36;
210
211
  optional float manual_rating = 37;
212
+ optional ProductPromoInfo active_promo = 38;
211
213
  }
212
214
 
213
215
 
@@ -281,6 +283,27 @@ message GetProductsRequest {
281
283
 
282
284
  repeated string attribute_value_ids = 10;
283
285
  repeated string brand_ids = 11;
286
+ repeated string product_ids = 12;
287
+ optional PromotionFilter promotion_filter = 13;
288
+ }
289
+
290
+ message PromotionFilter {
291
+ repeated string include_product_ids = 1;
292
+ repeated string include_category_ids = 2;
293
+ repeated string include_brand_ids = 3;
294
+ repeated string exclude_product_ids = 4;
295
+ repeated string exclude_category_ids = 5;
296
+ repeated string exclude_brand_ids = 6;
297
+ }
298
+
299
+ message ProductPromoInfo {
300
+ string id = 1;
301
+ map<string, string> name = 2;
302
+ string label = 3;
303
+ string label_color = 4;
304
+ double discounted_price = 5;
305
+ optional string seo_slug = 6;
306
+ int32 priority = 7;
284
307
  }
285
308
 
286
309
  message GetProductsResponse {
@@ -17,9 +17,11 @@ service PromotionService {
17
17
  rpc BulkApplyToCategories (BulkApplyToCategoriesRequest) returns (SuccessResponse);
18
18
 
19
19
  rpc GetActivePromotions (GetActivePromotionsRequest) returns (GetActivePromotionsResponse);
20
+ rpc GetActivePromotionsSnapshot (GetActivePromotionsSnapshotRequest) returns (GetActivePromotionsSnapshotResponse);
20
21
 
21
22
  // Products
22
23
  rpc GetPromotionProducts (GetPromotionProductsRequest) returns (GetPromotionProductsResponse);
24
+ rpc GetPromotionEligibleProductIds (GetPromotionEligibleProductIdsRequest) returns (GetPromotionEligibleProductIdsResponse);
23
25
  rpc AddPromotionProducts (AddPromotionProductsRequest) returns (SuccessResponse);
24
26
  rpc RemovePromotionProducts (RemovePromotionProductsRequest) returns (SuccessResponse);
25
27
 
@@ -370,6 +372,53 @@ message RemovePromotionProductsRequest {
370
372
  repeated string product_ids = 2;
371
373
  }
372
374
 
375
+ message GetPromotionEligibleProductIdsRequest {
376
+ string promotion_id = 1;
377
+ }
378
+
379
+ // Returns the full membership of the promotion (NOT resolved to a flat list).
380
+ // Catalog-service joins these (UNION include − exclude) using its own data.
381
+ message GetPromotionEligibleProductIdsResponse {
382
+ repeated string include_product_ids = 1;
383
+ repeated string include_category_ids = 2;
384
+ repeated string include_brand_ids = 3;
385
+ repeated string exclude_product_ids = 4;
386
+ repeated string exclude_category_ids = 5;
387
+ repeated string exclude_brand_ids = 6;
388
+ optional bool exists = 7;
389
+ }
390
+
391
+ // ─── Active promotions snapshot (for cross-service enrichment) ───────────────
392
+
393
+ message GetActivePromotionsSnapshotRequest {}
394
+
395
+ message ActivePromotionSnapshotItem {
396
+ string id = 1;
397
+ map<string, string> name = 2;
398
+ PromotionType type = 3;
399
+ DiscountType discount_type = 4;
400
+ double discount_value = 5;
401
+ int32 priority = 6;
402
+ optional string seo_slug = 7;
403
+ optional string starts_at = 8;
404
+ optional string ends_at = 9;
405
+ // Resolved eligible product IDs (already deduped, exclusions applied).
406
+ repeated string product_ids = 10;
407
+ repeated string category_ids = 11;
408
+ repeated string brand_ids = 12;
409
+ repeated string excluded_product_ids = 13;
410
+ repeated string excluded_category_ids = 14;
411
+ repeated string excluded_brand_ids = 15;
412
+ // Per-product label/color override (key = productId).
413
+ map<string, string> product_labels = 16;
414
+ map<string, string> product_label_colors = 17;
415
+ }
416
+
417
+ message GetActivePromotionsSnapshotResponse {
418
+ repeated ActivePromotionSnapshotItem items = 1;
419
+ int64 generated_at = 2;
420
+ }
421
+
373
422
 
374
423
  // ─── Categories ───────────────────────────────────────────────────────────────
375
424