@mamindom/contracts 1.0.113 → 1.0.114

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,22 @@ export interface GetProductsRequest {
296
298
  sortBy?: string | undefined;
297
299
  attributeValueIds: string[];
298
300
  brandIds: string[];
301
+ productIds: string[];
302
+ }
303
+ export interface ProductPromoInfo {
304
+ id: string;
305
+ name: {
306
+ [key: string]: string;
307
+ };
308
+ label: string;
309
+ labelColor: string;
310
+ discountedPrice: number;
311
+ seoSlug?: string | undefined;
312
+ priority: number;
313
+ }
314
+ export interface ProductPromoInfo_NameEntry {
315
+ key: string;
316
+ value: string;
299
317
  }
300
318
  export interface GetProductsResponse {
301
319
  items: ProductListItemResponse[];
@@ -339,6 +339,57 @@ export interface RemovePromotionProductsRequest {
339
339
  promotionId: string;
340
340
  productIds: string[];
341
341
  }
342
+ export interface GetPromotionEligibleProductIdsRequest {
343
+ promotionId: string;
344
+ }
345
+ export interface GetPromotionEligibleProductIdsResponse {
346
+ productIds: string[];
347
+ }
348
+ export interface GetActivePromotionsSnapshotRequest {
349
+ }
350
+ export interface ActivePromotionSnapshotItem {
351
+ id: string;
352
+ name: {
353
+ [key: string]: string;
354
+ };
355
+ type: PromotionType;
356
+ discountType: DiscountType;
357
+ discountValue: number;
358
+ priority: number;
359
+ seoSlug?: string | undefined;
360
+ startsAt?: string | undefined;
361
+ endsAt?: string | undefined;
362
+ /** Resolved eligible product IDs (already deduped, exclusions applied). */
363
+ productIds: string[];
364
+ categoryIds: string[];
365
+ brandIds: string[];
366
+ excludedProductIds: string[];
367
+ excludedCategoryIds: string[];
368
+ excludedBrandIds: string[];
369
+ /** Per-product label/color override (key = productId). */
370
+ productLabels: {
371
+ [key: string]: string;
372
+ };
373
+ productLabelColors: {
374
+ [key: string]: string;
375
+ };
376
+ }
377
+ export interface ActivePromotionSnapshotItem_NameEntry {
378
+ key: string;
379
+ value: string;
380
+ }
381
+ export interface ActivePromotionSnapshotItem_ProductLabelsEntry {
382
+ key: string;
383
+ value: string;
384
+ }
385
+ export interface ActivePromotionSnapshotItem_ProductLabelColorsEntry {
386
+ key: string;
387
+ value: string;
388
+ }
389
+ export interface GetActivePromotionsSnapshotResponse {
390
+ items: ActivePromotionSnapshotItem[];
391
+ generatedAt: number;
392
+ }
342
393
  export interface GetPromotionCategoriesRequest {
343
394
  promotionId: string;
344
395
  }
@@ -389,8 +440,10 @@ export interface PromotionServiceClient {
389
440
  updatePromotionStatus(request: UpdatePromotionStatusRequest): Observable<PromotionResponse>;
390
441
  bulkApplyToCategories(request: BulkApplyToCategoriesRequest): Observable<SuccessResponse>;
391
442
  getActivePromotions(request: GetActivePromotionsRequest): Observable<GetActivePromotionsResponse>;
443
+ getActivePromotionsSnapshot(request: GetActivePromotionsSnapshotRequest): Observable<GetActivePromotionsSnapshotResponse>;
392
444
  /** Products */
393
445
  getPromotionProducts(request: GetPromotionProductsRequest): Observable<GetPromotionProductsResponse>;
446
+ getPromotionEligibleProductIds(request: GetPromotionEligibleProductIdsRequest): Observable<GetPromotionEligibleProductIdsResponse>;
394
447
  addPromotionProducts(request: AddPromotionProductsRequest): Observable<SuccessResponse>;
395
448
  removePromotionProducts(request: RemovePromotionProductsRequest): Observable<SuccessResponse>;
396
449
  /** Categories */
@@ -414,8 +467,10 @@ export interface PromotionServiceController {
414
467
  updatePromotionStatus(request: UpdatePromotionStatusRequest): Promise<PromotionResponse> | Observable<PromotionResponse> | PromotionResponse;
415
468
  bulkApplyToCategories(request: BulkApplyToCategoriesRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
416
469
  getActivePromotions(request: GetActivePromotionsRequest): Promise<GetActivePromotionsResponse> | Observable<GetActivePromotionsResponse> | GetActivePromotionsResponse;
470
+ getActivePromotionsSnapshot(request: GetActivePromotionsSnapshotRequest): Promise<GetActivePromotionsSnapshotResponse> | Observable<GetActivePromotionsSnapshotResponse> | GetActivePromotionsSnapshotResponse;
417
471
  /** Products */
418
472
  getPromotionProducts(request: GetPromotionProductsRequest): Promise<GetPromotionProductsResponse> | Observable<GetPromotionProductsResponse> | GetPromotionProductsResponse;
473
+ getPromotionEligibleProductIds(request: GetPromotionEligibleProductIdsRequest): Promise<GetPromotionEligibleProductIdsResponse> | Observable<GetPromotionEligibleProductIdsResponse> | GetPromotionEligibleProductIdsResponse;
419
474
  addPromotionProducts(request: AddPromotionProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
420
475
  removePromotionProducts(request: RemovePromotionProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
421
476
  /** 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,17 @@ 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
+ }
288
+
289
+ message ProductPromoInfo {
290
+ string id = 1;
291
+ map<string, string> name = 2;
292
+ string label = 3;
293
+ string label_color = 4;
294
+ double discounted_price = 5;
295
+ optional string seo_slug = 6;
296
+ int32 priority = 7;
284
297
  }
285
298
 
286
299
  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,45 @@ message RemovePromotionProductsRequest {
370
372
  repeated string product_ids = 2;
371
373
  }
372
374
 
375
+ message GetPromotionEligibleProductIdsRequest {
376
+ string promotion_id = 1;
377
+ }
378
+
379
+ message GetPromotionEligibleProductIdsResponse {
380
+ repeated string product_ids = 1;
381
+ }
382
+
383
+ // ─── Active promotions snapshot (for cross-service enrichment) ───────────────
384
+
385
+ message GetActivePromotionsSnapshotRequest {}
386
+
387
+ message ActivePromotionSnapshotItem {
388
+ string id = 1;
389
+ map<string, string> name = 2;
390
+ PromotionType type = 3;
391
+ DiscountType discount_type = 4;
392
+ double discount_value = 5;
393
+ int32 priority = 6;
394
+ optional string seo_slug = 7;
395
+ optional string starts_at = 8;
396
+ optional string ends_at = 9;
397
+ // Resolved eligible product IDs (already deduped, exclusions applied).
398
+ repeated string product_ids = 10;
399
+ repeated string category_ids = 11;
400
+ repeated string brand_ids = 12;
401
+ repeated string excluded_product_ids = 13;
402
+ repeated string excluded_category_ids = 14;
403
+ repeated string excluded_brand_ids = 15;
404
+ // Per-product label/color override (key = productId).
405
+ map<string, string> product_labels = 16;
406
+ map<string, string> product_label_colors = 17;
407
+ }
408
+
409
+ message GetActivePromotionsSnapshotResponse {
410
+ repeated ActivePromotionSnapshotItem items = 1;
411
+ int64 generated_at = 2;
412
+ }
413
+
373
414
 
374
415
  // ─── Categories ───────────────────────────────────────────────────────────────
375
416
 
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,22 @@ export interface GetProductsRequest {
310
312
  sortBy?: string | undefined;
311
313
  attributeValueIds: string[];
312
314
  brandIds: string[];
315
+ productIds: string[];
316
+ }
317
+
318
+ export interface ProductPromoInfo {
319
+ id: string;
320
+ name: { [key: string]: string };
321
+ label: string;
322
+ labelColor: string;
323
+ discountedPrice: number;
324
+ seoSlug?: string | undefined;
325
+ priority: number;
326
+ }
327
+
328
+ export interface ProductPromoInfo_NameEntry {
329
+ key: string;
330
+ value: string;
313
331
  }
314
332
 
315
333
  export interface GetProductsResponse {
package/gen/promotion.ts CHANGED
@@ -369,6 +369,61 @@ export interface RemovePromotionProductsRequest {
369
369
  productIds: string[];
370
370
  }
371
371
 
372
+ export interface GetPromotionEligibleProductIdsRequest {
373
+ promotionId: string;
374
+ }
375
+
376
+ export interface GetPromotionEligibleProductIdsResponse {
377
+ productIds: string[];
378
+ }
379
+
380
+ export interface GetActivePromotionsSnapshotRequest {
381
+ }
382
+
383
+ export interface ActivePromotionSnapshotItem {
384
+ id: string;
385
+ name: { [key: string]: string };
386
+ type: PromotionType;
387
+ discountType: DiscountType;
388
+ discountValue: number;
389
+ priority: number;
390
+ seoSlug?: string | undefined;
391
+ startsAt?: string | undefined;
392
+ endsAt?:
393
+ | string
394
+ | undefined;
395
+ /** Resolved eligible product IDs (already deduped, exclusions applied). */
396
+ productIds: string[];
397
+ categoryIds: string[];
398
+ brandIds: string[];
399
+ excludedProductIds: string[];
400
+ excludedCategoryIds: string[];
401
+ excludedBrandIds: string[];
402
+ /** Per-product label/color override (key = productId). */
403
+ productLabels: { [key: string]: string };
404
+ productLabelColors: { [key: string]: string };
405
+ }
406
+
407
+ export interface ActivePromotionSnapshotItem_NameEntry {
408
+ key: string;
409
+ value: string;
410
+ }
411
+
412
+ export interface ActivePromotionSnapshotItem_ProductLabelsEntry {
413
+ key: string;
414
+ value: string;
415
+ }
416
+
417
+ export interface ActivePromotionSnapshotItem_ProductLabelColorsEntry {
418
+ key: string;
419
+ value: string;
420
+ }
421
+
422
+ export interface GetActivePromotionsSnapshotResponse {
423
+ items: ActivePromotionSnapshotItem[];
424
+ generatedAt: number;
425
+ }
426
+
372
427
  export interface GetPromotionCategoriesRequest {
373
428
  promotionId: string;
374
429
  }
@@ -440,10 +495,18 @@ export interface PromotionServiceClient {
440
495
 
441
496
  getActivePromotions(request: GetActivePromotionsRequest): Observable<GetActivePromotionsResponse>;
442
497
 
498
+ getActivePromotionsSnapshot(
499
+ request: GetActivePromotionsSnapshotRequest,
500
+ ): Observable<GetActivePromotionsSnapshotResponse>;
501
+
443
502
  /** Products */
444
503
 
445
504
  getPromotionProducts(request: GetPromotionProductsRequest): Observable<GetPromotionProductsResponse>;
446
505
 
506
+ getPromotionEligibleProductIds(
507
+ request: GetPromotionEligibleProductIdsRequest,
508
+ ): Observable<GetPromotionEligibleProductIdsResponse>;
509
+
447
510
  addPromotionProducts(request: AddPromotionProductsRequest): Observable<SuccessResponse>;
448
511
 
449
512
  removePromotionProducts(request: RemovePromotionProductsRequest): Observable<SuccessResponse>;
@@ -506,12 +569,26 @@ export interface PromotionServiceController {
506
569
  request: GetActivePromotionsRequest,
507
570
  ): Promise<GetActivePromotionsResponse> | Observable<GetActivePromotionsResponse> | GetActivePromotionsResponse;
508
571
 
572
+ getActivePromotionsSnapshot(
573
+ request: GetActivePromotionsSnapshotRequest,
574
+ ):
575
+ | Promise<GetActivePromotionsSnapshotResponse>
576
+ | Observable<GetActivePromotionsSnapshotResponse>
577
+ | GetActivePromotionsSnapshotResponse;
578
+
509
579
  /** Products */
510
580
 
511
581
  getPromotionProducts(
512
582
  request: GetPromotionProductsRequest,
513
583
  ): Promise<GetPromotionProductsResponse> | Observable<GetPromotionProductsResponse> | GetPromotionProductsResponse;
514
584
 
585
+ getPromotionEligibleProductIds(
586
+ request: GetPromotionEligibleProductIdsRequest,
587
+ ):
588
+ | Promise<GetPromotionEligibleProductIdsResponse>
589
+ | Observable<GetPromotionEligibleProductIdsResponse>
590
+ | GetPromotionEligibleProductIdsResponse;
591
+
515
592
  addPromotionProducts(
516
593
  request: AddPromotionProductsRequest,
517
594
  ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
@@ -570,7 +647,9 @@ export function PromotionServiceControllerMethods() {
570
647
  "updatePromotionStatus",
571
648
  "bulkApplyToCategories",
572
649
  "getActivePromotions",
650
+ "getActivePromotionsSnapshot",
573
651
  "getPromotionProducts",
652
+ "getPromotionEligibleProductIds",
574
653
  "addPromotionProducts",
575
654
  "removePromotionProducts",
576
655
  "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.114",
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,17 @@ 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
+ }
288
+
289
+ message ProductPromoInfo {
290
+ string id = 1;
291
+ map<string, string> name = 2;
292
+ string label = 3;
293
+ string label_color = 4;
294
+ double discounted_price = 5;
295
+ optional string seo_slug = 6;
296
+ int32 priority = 7;
284
297
  }
285
298
 
286
299
  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,45 @@ message RemovePromotionProductsRequest {
370
372
  repeated string product_ids = 2;
371
373
  }
372
374
 
375
+ message GetPromotionEligibleProductIdsRequest {
376
+ string promotion_id = 1;
377
+ }
378
+
379
+ message GetPromotionEligibleProductIdsResponse {
380
+ repeated string product_ids = 1;
381
+ }
382
+
383
+ // ─── Active promotions snapshot (for cross-service enrichment) ───────────────
384
+
385
+ message GetActivePromotionsSnapshotRequest {}
386
+
387
+ message ActivePromotionSnapshotItem {
388
+ string id = 1;
389
+ map<string, string> name = 2;
390
+ PromotionType type = 3;
391
+ DiscountType discount_type = 4;
392
+ double discount_value = 5;
393
+ int32 priority = 6;
394
+ optional string seo_slug = 7;
395
+ optional string starts_at = 8;
396
+ optional string ends_at = 9;
397
+ // Resolved eligible product IDs (already deduped, exclusions applied).
398
+ repeated string product_ids = 10;
399
+ repeated string category_ids = 11;
400
+ repeated string brand_ids = 12;
401
+ repeated string excluded_product_ids = 13;
402
+ repeated string excluded_category_ids = 14;
403
+ repeated string excluded_brand_ids = 15;
404
+ // Per-product label/color override (key = productId).
405
+ map<string, string> product_labels = 16;
406
+ map<string, string> product_label_colors = 17;
407
+ }
408
+
409
+ message GetActivePromotionsSnapshotResponse {
410
+ repeated ActivePromotionSnapshotItem items = 1;
411
+ int64 generated_at = 2;
412
+ }
413
+
373
414
 
374
415
  // ─── Categories ───────────────────────────────────────────────────────────────
375
416