@mamindom/contracts 1.0.68 → 1.0.70

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.
@@ -9,6 +9,20 @@ export declare enum ProductStatus {
9
9
  PRODUCT_STATUS_ARCHIVED = 4,
10
10
  UNRECOGNIZED = -1
11
11
  }
12
+ export declare enum RelatedProductType {
13
+ RELATED_TYPE_UNSPECIFIED = 0,
14
+ RELATED_TYPE_CROSS_SELL = 1,
15
+ RELATED_TYPE_UP_SELL = 2,
16
+ RELATED_TYPE_BOUGHT_TOGETHER = 3,
17
+ RELATED_TYPE_POPULAR = 4,
18
+ UNRECOGNIZED = -1
19
+ }
20
+ export declare enum ExportFormat {
21
+ EXPORT_FORMAT_UNSPECIFIED = 0,
22
+ EXPORT_FORMAT_CSV = 1,
23
+ EXPORT_FORMAT_XLSX = 2,
24
+ UNRECOGNIZED = -1
25
+ }
12
26
  export interface BulkStickerRequest {
13
27
  productIds: string[];
14
28
  stickerId: string;
@@ -425,6 +439,66 @@ export interface UpdateProductVariantRequest_OptionsEntry {
425
439
  export interface DeleteProductVariantRequest {
426
440
  id: string;
427
441
  }
442
+ export interface GetRelatedProductsRequest {
443
+ productId: string;
444
+ type?: RelatedProductType | undefined;
445
+ }
446
+ export interface RelatedProductItem {
447
+ productId: string;
448
+ sku: string;
449
+ slug: string;
450
+ name: {
451
+ [key: string]: string;
452
+ };
453
+ mainImage: string;
454
+ price: number;
455
+ oldPrice?: number | undefined;
456
+ status: ProductStatus;
457
+ totalStock: number;
458
+ type: RelatedProductType;
459
+ }
460
+ export interface RelatedProductItem_NameEntry {
461
+ key: string;
462
+ value: string;
463
+ }
464
+ export interface GetRelatedProductsResponse {
465
+ crossSell: RelatedProductItem[];
466
+ upSell: RelatedProductItem[];
467
+ boughtTogether: RelatedProductItem[];
468
+ popular: RelatedProductItem[];
469
+ }
470
+ export interface SetRelatedProductsRequest {
471
+ productId: string;
472
+ type: RelatedProductType;
473
+ relatedProductIds: string[];
474
+ }
475
+ export interface RemoveRelatedProductRequest {
476
+ productId: string;
477
+ relatedProductId: string;
478
+ type: RelatedProductType;
479
+ }
480
+ export interface ExportProductsRequest {
481
+ search?: string | undefined;
482
+ categoryId?: string | undefined;
483
+ brandId?: string | undefined;
484
+ status?: ProductStatus | undefined;
485
+ inStock?: boolean | undefined;
486
+ priceMin?: number | undefined;
487
+ priceMax?: number | undefined;
488
+ sortBy?: string | undefined;
489
+ format: ExportFormat;
490
+ fields: string[];
491
+ createdById: string;
492
+ locale?: string | undefined;
493
+ }
494
+ export interface ExportProductsResponse {
495
+ downloadUrl: string;
496
+ fileName: string;
497
+ totalRows: number;
498
+ }
499
+ export interface BulkUpdateSortOrderRequest {
500
+ items: ProductOrderItem[];
501
+ }
428
502
  export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
429
503
  export interface ProductServiceClient {
430
504
  getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
@@ -446,6 +520,11 @@ export interface ProductServiceClient {
446
520
  deleteProductVariant(request: DeleteProductVariantRequest): Observable<DeleteResponse>;
447
521
  updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Observable<SuccessResponse>;
448
522
  updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Observable<SuccessResponse>;
523
+ getRelatedProducts(request: GetRelatedProductsRequest): Observable<GetRelatedProductsResponse>;
524
+ setRelatedProducts(request: SetRelatedProductsRequest): Observable<SuccessResponse>;
525
+ removeRelatedProduct(request: RemoveRelatedProductRequest): Observable<SuccessResponse>;
526
+ exportProducts(request: ExportProductsRequest): Observable<ExportProductsResponse>;
527
+ bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Observable<SuccessResponse>;
449
528
  }
450
529
  export interface ProductServiceController {
451
530
  getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
@@ -467,6 +546,11 @@ export interface ProductServiceController {
467
546
  deleteProductVariant(request: DeleteProductVariantRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
468
547
  updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
469
548
  updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
549
+ getRelatedProducts(request: GetRelatedProductsRequest): Promise<GetRelatedProductsResponse> | Observable<GetRelatedProductsResponse> | GetRelatedProductsResponse;
550
+ setRelatedProducts(request: SetRelatedProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
551
+ removeRelatedProduct(request: RemoveRelatedProductRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
552
+ exportProducts(request: ExportProductsRequest): Promise<ExportProductsResponse> | Observable<ExportProductsResponse> | ExportProductsResponse;
553
+ bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
470
554
  }
471
555
  export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
472
556
  export declare const PRODUCT_SERVICE_NAME = "ProductService";
@@ -5,7 +5,7 @@
5
5
  // protoc v3.21.12
6
6
  // source: product.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.PRODUCT_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.ProductStatus = exports.protobufPackage = void 0;
8
+ exports.PRODUCT_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.ExportFormat = exports.RelatedProductType = exports.ProductStatus = exports.protobufPackage = void 0;
9
9
  exports.ProductServiceControllerMethods = ProductServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
@@ -19,6 +19,22 @@ var ProductStatus;
19
19
  ProductStatus[ProductStatus["PRODUCT_STATUS_ARCHIVED"] = 4] = "PRODUCT_STATUS_ARCHIVED";
20
20
  ProductStatus[ProductStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
21
21
  })(ProductStatus || (exports.ProductStatus = ProductStatus = {}));
22
+ var RelatedProductType;
23
+ (function (RelatedProductType) {
24
+ RelatedProductType[RelatedProductType["RELATED_TYPE_UNSPECIFIED"] = 0] = "RELATED_TYPE_UNSPECIFIED";
25
+ RelatedProductType[RelatedProductType["RELATED_TYPE_CROSS_SELL"] = 1] = "RELATED_TYPE_CROSS_SELL";
26
+ RelatedProductType[RelatedProductType["RELATED_TYPE_UP_SELL"] = 2] = "RELATED_TYPE_UP_SELL";
27
+ RelatedProductType[RelatedProductType["RELATED_TYPE_BOUGHT_TOGETHER"] = 3] = "RELATED_TYPE_BOUGHT_TOGETHER";
28
+ RelatedProductType[RelatedProductType["RELATED_TYPE_POPULAR"] = 4] = "RELATED_TYPE_POPULAR";
29
+ RelatedProductType[RelatedProductType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
30
+ })(RelatedProductType || (exports.RelatedProductType = RelatedProductType = {}));
31
+ var ExportFormat;
32
+ (function (ExportFormat) {
33
+ ExportFormat[ExportFormat["EXPORT_FORMAT_UNSPECIFIED"] = 0] = "EXPORT_FORMAT_UNSPECIFIED";
34
+ ExportFormat[ExportFormat["EXPORT_FORMAT_CSV"] = 1] = "EXPORT_FORMAT_CSV";
35
+ ExportFormat[ExportFormat["EXPORT_FORMAT_XLSX"] = 2] = "EXPORT_FORMAT_XLSX";
36
+ ExportFormat[ExportFormat["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
37
+ })(ExportFormat || (exports.ExportFormat = ExportFormat = {}));
22
38
  exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
23
39
  function ProductServiceControllerMethods() {
24
40
  return function (constructor) {
@@ -42,6 +58,11 @@ function ProductServiceControllerMethods() {
42
58
  "deleteProductVariant",
43
59
  "updateProductGlobalOrder",
44
60
  "updateProductCategoryOrder",
61
+ "getRelatedProducts",
62
+ "setRelatedProducts",
63
+ "removeRelatedProduct",
64
+ "exportProducts",
65
+ "bulkUpdateSortOrder",
45
66
  ];
46
67
  for (const method of grpcMethods) {
47
68
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -0,0 +1,45 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "catalog.v1";
3
+ export interface GetShopFiltersRequest {
4
+ categoryId: string;
5
+ }
6
+ export interface GetShopFiltersResponse {
7
+ brands: ShopFilterOption[];
8
+ colors: ShopFilterColorOption[];
9
+ sizes: ShopFilterOption[];
10
+ attributes: ShopFilterAttribute[];
11
+ priceMin: number;
12
+ priceMax: number;
13
+ }
14
+ export interface ShopFilterOption {
15
+ value: string;
16
+ label: string;
17
+ count: number;
18
+ }
19
+ export interface ShopFilterColorOption {
20
+ value: string;
21
+ label: string;
22
+ hex: string;
23
+ count: number;
24
+ }
25
+ export interface ShopFilterAttribute {
26
+ slug: string;
27
+ name: {
28
+ [key: string]: string;
29
+ };
30
+ displayType: string;
31
+ values: ShopFilterOption[];
32
+ }
33
+ export interface ShopFilterAttribute_NameEntry {
34
+ key: string;
35
+ value: string;
36
+ }
37
+ export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
38
+ export interface ShopFilterServiceClient {
39
+ getShopFilters(request: GetShopFiltersRequest): Observable<GetShopFiltersResponse>;
40
+ }
41
+ export interface ShopFilterServiceController {
42
+ getShopFilters(request: GetShopFiltersRequest): Promise<GetShopFiltersResponse> | Observable<GetShopFiltersResponse> | GetShopFiltersResponse;
43
+ }
44
+ export declare function ShopFilterServiceControllerMethods(): (constructor: Function) => void;
45
+ export declare const SHOP_FILTER_SERVICE_NAME = "ShopFilterService";
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v3.21.12
6
+ // source: shop_filters.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.SHOP_FILTER_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.ShopFilterServiceControllerMethods = ShopFilterServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "catalog.v1";
13
+ exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
14
+ function ShopFilterServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["getShopFilters"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("ShopFilterService", method)(constructor.prototype[method], method, descriptor);
20
+ }
21
+ const grpcStreamMethods = [];
22
+ for (const method of grpcStreamMethods) {
23
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
24
+ (0, microservices_1.GrpcStreamMethod)("ShopFilterService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.SHOP_FILTER_SERVICE_NAME = "ShopFilterService";
@@ -37,6 +37,16 @@ service ProductService {
37
37
 
38
38
  rpc UpdateProductGlobalOrder (UpdateProductGlobalOrderRequest) returns (SuccessResponse);
39
39
  rpc UpdateProductCategoryOrder (UpdateProductCategoryOrderRequest) returns (SuccessResponse);
40
+
41
+ rpc GetRelatedProducts (GetRelatedProductsRequest) returns (GetRelatedProductsResponse);
42
+ rpc SetRelatedProducts (SetRelatedProductsRequest) returns (SuccessResponse);
43
+ rpc RemoveRelatedProduct (RemoveRelatedProductRequest) returns (SuccessResponse);
44
+
45
+
46
+ rpc ExportProducts (ExportProductsRequest) returns (ExportProductsResponse);
47
+
48
+
49
+ rpc BulkUpdateSortOrder (BulkUpdateSortOrderRequest) returns (SuccessResponse);
40
50
  }
41
51
 
42
52
 
@@ -365,3 +375,83 @@ enum ProductStatus {
365
375
  PRODUCT_STATUS_INACTIVE = 3;
366
376
  PRODUCT_STATUS_ARCHIVED = 4;
367
377
  }
378
+
379
+ enum RelatedProductType {
380
+ RELATED_TYPE_UNSPECIFIED = 0;
381
+ RELATED_TYPE_CROSS_SELL = 1;
382
+ RELATED_TYPE_UP_SELL = 2;
383
+ RELATED_TYPE_BOUGHT_TOGETHER = 3;
384
+ RELATED_TYPE_POPULAR = 4;
385
+ }
386
+
387
+ message GetRelatedProductsRequest {
388
+ string product_id = 1;
389
+ optional RelatedProductType type = 2;
390
+ }
391
+
392
+ message RelatedProductItem {
393
+ string product_id = 1;
394
+ string sku = 2;
395
+ string slug = 3;
396
+ map<string, string> name = 4;
397
+ string main_image = 5;
398
+ double price = 6;
399
+ optional double old_price = 7;
400
+ ProductStatus status = 8;
401
+ int32 total_stock = 9;
402
+ RelatedProductType type = 10;
403
+ }
404
+
405
+ message GetRelatedProductsResponse {
406
+ repeated RelatedProductItem cross_sell = 1;
407
+ repeated RelatedProductItem up_sell = 2;
408
+ repeated RelatedProductItem bought_together = 3;
409
+ repeated RelatedProductItem popular = 4;
410
+ }
411
+
412
+ message SetRelatedProductsRequest {
413
+ string product_id = 1;
414
+ RelatedProductType type = 2;
415
+ repeated string related_product_ids = 3;
416
+ }
417
+
418
+ message RemoveRelatedProductRequest {
419
+ string product_id = 1;
420
+ string related_product_id = 2;
421
+ RelatedProductType type = 3;
422
+ }
423
+
424
+
425
+ enum ExportFormat {
426
+ EXPORT_FORMAT_UNSPECIFIED = 0;
427
+ EXPORT_FORMAT_CSV = 1;
428
+ EXPORT_FORMAT_XLSX = 2;
429
+ }
430
+
431
+ message ExportProductsRequest {
432
+
433
+ optional string search = 1;
434
+ optional string category_id = 2;
435
+ optional string brand_id = 3;
436
+ optional ProductStatus status = 4;
437
+ optional bool in_stock = 5;
438
+ optional double price_min = 6;
439
+ optional double price_max = 7;
440
+ optional string sort_by = 8;
441
+
442
+ ExportFormat format = 9;
443
+ repeated string fields = 10;
444
+ string created_by_id = 11;
445
+ optional string locale = 12;
446
+ }
447
+
448
+ message ExportProductsResponse {
449
+ string download_url = 1;
450
+ string file_name = 2;
451
+ int32 total_rows = 3;
452
+ }
453
+
454
+ message BulkUpdateSortOrderRequest {
455
+ repeated ProductOrderItem items = 1;
456
+ }
457
+
@@ -0,0 +1,46 @@
1
+
2
+ syntax = "proto3";
3
+
4
+ package catalog.v1;
5
+
6
+ import "common.proto";
7
+
8
+ service ShopFilterService {
9
+
10
+ rpc GetShopFilters (GetShopFiltersRequest) returns (GetShopFiltersResponse);
11
+ }
12
+
13
+
14
+ message GetShopFiltersRequest {
15
+ string category_id = 1;
16
+ }
17
+
18
+
19
+ message GetShopFiltersResponse {
20
+ repeated ShopFilterOption brands = 1;
21
+ repeated ShopFilterColorOption colors = 2;
22
+ repeated ShopFilterOption sizes = 3;
23
+ repeated ShopFilterAttribute attributes = 4;
24
+ double price_min = 5;
25
+ double price_max = 6;
26
+ }
27
+
28
+ message ShopFilterOption {
29
+ string value = 1;
30
+ string label = 2;
31
+ int32 count = 3;
32
+ }
33
+
34
+ message ShopFilterColorOption {
35
+ string value = 1;
36
+ string label = 2;
37
+ string hex = 3;
38
+ int32 count = 4;
39
+ }
40
+
41
+ message ShopFilterAttribute {
42
+ string slug = 1;
43
+ map<string, string> name = 2;
44
+ string display_type = 3;
45
+ repeated ShopFilterOption values = 4;
46
+ }
@@ -12,6 +12,7 @@ export declare const PROTO_PATHS: {
12
12
  readonly STICKER: string;
13
13
  readonly STOCK: string;
14
14
  readonly BUNDLE: string;
15
+ readonly FILTER: string;
15
16
  readonly COMMON_PROMO: string;
16
17
  readonly CALCULATION: string;
17
18
  readonly COUPON: string;
@@ -16,6 +16,7 @@ exports.PROTO_PATHS = {
16
16
  STICKER: (0, node_path_1.join)(__dirname, '../../proto/sticker.proto'),
17
17
  STOCK: (0, node_path_1.join)(__dirname, '../../proto/stock.proto'),
18
18
  BUNDLE: (0, node_path_1.join)(__dirname, '../../proto/bundle.proto'),
19
+ FILTER: (0, node_path_1.join)(__dirname, '../../proto/shop_filters.proto'),
19
20
  COMMON_PROMO: (0, node_path_1.join)(__dirname, '../../proto/common_promo.proto'),
20
21
  CALCULATION: (0, node_path_1.join)(__dirname, '../../proto/calculation.proto'),
21
22
  COUPON: (0, node_path_1.join)(__dirname, '../../proto/coupon.proto'),
package/gen/product.ts CHANGED
@@ -20,6 +20,22 @@ export enum ProductStatus {
20
20
  UNRECOGNIZED = -1,
21
21
  }
22
22
 
23
+ export enum RelatedProductType {
24
+ RELATED_TYPE_UNSPECIFIED = 0,
25
+ RELATED_TYPE_CROSS_SELL = 1,
26
+ RELATED_TYPE_UP_SELL = 2,
27
+ RELATED_TYPE_BOUGHT_TOGETHER = 3,
28
+ RELATED_TYPE_POPULAR = 4,
29
+ UNRECOGNIZED = -1,
30
+ }
31
+
32
+ export enum ExportFormat {
33
+ EXPORT_FORMAT_UNSPECIFIED = 0,
34
+ EXPORT_FORMAT_CSV = 1,
35
+ EXPORT_FORMAT_XLSX = 2,
36
+ UNRECOGNIZED = -1,
37
+ }
38
+
23
39
  export interface BulkStickerRequest {
24
40
  productIds: string[];
25
41
  stickerId: string;
@@ -439,6 +455,73 @@ export interface DeleteProductVariantRequest {
439
455
  id: string;
440
456
  }
441
457
 
458
+ export interface GetRelatedProductsRequest {
459
+ productId: string;
460
+ type?: RelatedProductType | undefined;
461
+ }
462
+
463
+ export interface RelatedProductItem {
464
+ productId: string;
465
+ sku: string;
466
+ slug: string;
467
+ name: { [key: string]: string };
468
+ mainImage: string;
469
+ price: number;
470
+ oldPrice?: number | undefined;
471
+ status: ProductStatus;
472
+ totalStock: number;
473
+ type: RelatedProductType;
474
+ }
475
+
476
+ export interface RelatedProductItem_NameEntry {
477
+ key: string;
478
+ value: string;
479
+ }
480
+
481
+ export interface GetRelatedProductsResponse {
482
+ crossSell: RelatedProductItem[];
483
+ upSell: RelatedProductItem[];
484
+ boughtTogether: RelatedProductItem[];
485
+ popular: RelatedProductItem[];
486
+ }
487
+
488
+ export interface SetRelatedProductsRequest {
489
+ productId: string;
490
+ type: RelatedProductType;
491
+ relatedProductIds: string[];
492
+ }
493
+
494
+ export interface RemoveRelatedProductRequest {
495
+ productId: string;
496
+ relatedProductId: string;
497
+ type: RelatedProductType;
498
+ }
499
+
500
+ export interface ExportProductsRequest {
501
+ search?: string | undefined;
502
+ categoryId?: string | undefined;
503
+ brandId?: string | undefined;
504
+ status?: ProductStatus | undefined;
505
+ inStock?: boolean | undefined;
506
+ priceMin?: number | undefined;
507
+ priceMax?: number | undefined;
508
+ sortBy?: string | undefined;
509
+ format: ExportFormat;
510
+ fields: string[];
511
+ createdById: string;
512
+ locale?: string | undefined;
513
+ }
514
+
515
+ export interface ExportProductsResponse {
516
+ downloadUrl: string;
517
+ fileName: string;
518
+ totalRows: number;
519
+ }
520
+
521
+ export interface BulkUpdateSortOrderRequest {
522
+ items: ProductOrderItem[];
523
+ }
524
+
442
525
  export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
443
526
 
444
527
  export interface ProductServiceClient {
@@ -479,6 +562,16 @@ export interface ProductServiceClient {
479
562
  updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Observable<SuccessResponse>;
480
563
 
481
564
  updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Observable<SuccessResponse>;
565
+
566
+ getRelatedProducts(request: GetRelatedProductsRequest): Observable<GetRelatedProductsResponse>;
567
+
568
+ setRelatedProducts(request: SetRelatedProductsRequest): Observable<SuccessResponse>;
569
+
570
+ removeRelatedProduct(request: RemoveRelatedProductRequest): Observable<SuccessResponse>;
571
+
572
+ exportProducts(request: ExportProductsRequest): Observable<ExportProductsResponse>;
573
+
574
+ bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Observable<SuccessResponse>;
482
575
  }
483
576
 
484
577
  export interface ProductServiceController {
@@ -555,6 +648,26 @@ export interface ProductServiceController {
555
648
  updateProductCategoryOrder(
556
649
  request: UpdateProductCategoryOrderRequest,
557
650
  ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
651
+
652
+ getRelatedProducts(
653
+ request: GetRelatedProductsRequest,
654
+ ): Promise<GetRelatedProductsResponse> | Observable<GetRelatedProductsResponse> | GetRelatedProductsResponse;
655
+
656
+ setRelatedProducts(
657
+ request: SetRelatedProductsRequest,
658
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
659
+
660
+ removeRelatedProduct(
661
+ request: RemoveRelatedProductRequest,
662
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
663
+
664
+ exportProducts(
665
+ request: ExportProductsRequest,
666
+ ): Promise<ExportProductsResponse> | Observable<ExportProductsResponse> | ExportProductsResponse;
667
+
668
+ bulkUpdateSortOrder(
669
+ request: BulkUpdateSortOrderRequest,
670
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
558
671
  }
559
672
 
560
673
  export function ProductServiceControllerMethods() {
@@ -579,6 +692,11 @@ export function ProductServiceControllerMethods() {
579
692
  "deleteProductVariant",
580
693
  "updateProductGlobalOrder",
581
694
  "updateProductCategoryOrder",
695
+ "getRelatedProducts",
696
+ "setRelatedProducts",
697
+ "removeRelatedProduct",
698
+ "exportProducts",
699
+ "bulkUpdateSortOrder",
582
700
  ];
583
701
  for (const method of grpcMethods) {
584
702
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -0,0 +1,78 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v3.21.12
5
+ // source: shop_filters.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "catalog.v1";
12
+
13
+ export interface GetShopFiltersRequest {
14
+ categoryId: string;
15
+ }
16
+
17
+ export interface GetShopFiltersResponse {
18
+ brands: ShopFilterOption[];
19
+ colors: ShopFilterColorOption[];
20
+ sizes: ShopFilterOption[];
21
+ attributes: ShopFilterAttribute[];
22
+ priceMin: number;
23
+ priceMax: number;
24
+ }
25
+
26
+ export interface ShopFilterOption {
27
+ value: string;
28
+ label: string;
29
+ count: number;
30
+ }
31
+
32
+ export interface ShopFilterColorOption {
33
+ value: string;
34
+ label: string;
35
+ hex: string;
36
+ count: number;
37
+ }
38
+
39
+ export interface ShopFilterAttribute {
40
+ slug: string;
41
+ name: { [key: string]: string };
42
+ displayType: string;
43
+ values: ShopFilterOption[];
44
+ }
45
+
46
+ export interface ShopFilterAttribute_NameEntry {
47
+ key: string;
48
+ value: string;
49
+ }
50
+
51
+ export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
52
+
53
+ export interface ShopFilterServiceClient {
54
+ getShopFilters(request: GetShopFiltersRequest): Observable<GetShopFiltersResponse>;
55
+ }
56
+
57
+ export interface ShopFilterServiceController {
58
+ getShopFilters(
59
+ request: GetShopFiltersRequest,
60
+ ): Promise<GetShopFiltersResponse> | Observable<GetShopFiltersResponse> | GetShopFiltersResponse;
61
+ }
62
+
63
+ export function ShopFilterServiceControllerMethods() {
64
+ return function (constructor: Function) {
65
+ const grpcMethods: string[] = ["getShopFilters"];
66
+ for (const method of grpcMethods) {
67
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
68
+ GrpcMethod("ShopFilterService", method)(constructor.prototype[method], method, descriptor);
69
+ }
70
+ const grpcStreamMethods: string[] = [];
71
+ for (const method of grpcStreamMethods) {
72
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
73
+ GrpcStreamMethod("ShopFilterService", method)(constructor.prototype[method], method, descriptor);
74
+ }
75
+ };
76
+ }
77
+
78
+ export const SHOP_FILTER_SERVICE_NAME = "ShopFilterService";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.68",
4
+ "version": "1.0.70",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -37,6 +37,16 @@ service ProductService {
37
37
 
38
38
  rpc UpdateProductGlobalOrder (UpdateProductGlobalOrderRequest) returns (SuccessResponse);
39
39
  rpc UpdateProductCategoryOrder (UpdateProductCategoryOrderRequest) returns (SuccessResponse);
40
+
41
+ rpc GetRelatedProducts (GetRelatedProductsRequest) returns (GetRelatedProductsResponse);
42
+ rpc SetRelatedProducts (SetRelatedProductsRequest) returns (SuccessResponse);
43
+ rpc RemoveRelatedProduct (RemoveRelatedProductRequest) returns (SuccessResponse);
44
+
45
+
46
+ rpc ExportProducts (ExportProductsRequest) returns (ExportProductsResponse);
47
+
48
+
49
+ rpc BulkUpdateSortOrder (BulkUpdateSortOrderRequest) returns (SuccessResponse);
40
50
  }
41
51
 
42
52
 
@@ -365,3 +375,83 @@ enum ProductStatus {
365
375
  PRODUCT_STATUS_INACTIVE = 3;
366
376
  PRODUCT_STATUS_ARCHIVED = 4;
367
377
  }
378
+
379
+ enum RelatedProductType {
380
+ RELATED_TYPE_UNSPECIFIED = 0;
381
+ RELATED_TYPE_CROSS_SELL = 1;
382
+ RELATED_TYPE_UP_SELL = 2;
383
+ RELATED_TYPE_BOUGHT_TOGETHER = 3;
384
+ RELATED_TYPE_POPULAR = 4;
385
+ }
386
+
387
+ message GetRelatedProductsRequest {
388
+ string product_id = 1;
389
+ optional RelatedProductType type = 2;
390
+ }
391
+
392
+ message RelatedProductItem {
393
+ string product_id = 1;
394
+ string sku = 2;
395
+ string slug = 3;
396
+ map<string, string> name = 4;
397
+ string main_image = 5;
398
+ double price = 6;
399
+ optional double old_price = 7;
400
+ ProductStatus status = 8;
401
+ int32 total_stock = 9;
402
+ RelatedProductType type = 10;
403
+ }
404
+
405
+ message GetRelatedProductsResponse {
406
+ repeated RelatedProductItem cross_sell = 1;
407
+ repeated RelatedProductItem up_sell = 2;
408
+ repeated RelatedProductItem bought_together = 3;
409
+ repeated RelatedProductItem popular = 4;
410
+ }
411
+
412
+ message SetRelatedProductsRequest {
413
+ string product_id = 1;
414
+ RelatedProductType type = 2;
415
+ repeated string related_product_ids = 3;
416
+ }
417
+
418
+ message RemoveRelatedProductRequest {
419
+ string product_id = 1;
420
+ string related_product_id = 2;
421
+ RelatedProductType type = 3;
422
+ }
423
+
424
+
425
+ enum ExportFormat {
426
+ EXPORT_FORMAT_UNSPECIFIED = 0;
427
+ EXPORT_FORMAT_CSV = 1;
428
+ EXPORT_FORMAT_XLSX = 2;
429
+ }
430
+
431
+ message ExportProductsRequest {
432
+
433
+ optional string search = 1;
434
+ optional string category_id = 2;
435
+ optional string brand_id = 3;
436
+ optional ProductStatus status = 4;
437
+ optional bool in_stock = 5;
438
+ optional double price_min = 6;
439
+ optional double price_max = 7;
440
+ optional string sort_by = 8;
441
+
442
+ ExportFormat format = 9;
443
+ repeated string fields = 10;
444
+ string created_by_id = 11;
445
+ optional string locale = 12;
446
+ }
447
+
448
+ message ExportProductsResponse {
449
+ string download_url = 1;
450
+ string file_name = 2;
451
+ int32 total_rows = 3;
452
+ }
453
+
454
+ message BulkUpdateSortOrderRequest {
455
+ repeated ProductOrderItem items = 1;
456
+ }
457
+
@@ -0,0 +1,46 @@
1
+
2
+ syntax = "proto3";
3
+
4
+ package catalog.v1;
5
+
6
+ import "common.proto";
7
+
8
+ service ShopFilterService {
9
+
10
+ rpc GetShopFilters (GetShopFiltersRequest) returns (GetShopFiltersResponse);
11
+ }
12
+
13
+
14
+ message GetShopFiltersRequest {
15
+ string category_id = 1;
16
+ }
17
+
18
+
19
+ message GetShopFiltersResponse {
20
+ repeated ShopFilterOption brands = 1;
21
+ repeated ShopFilterColorOption colors = 2;
22
+ repeated ShopFilterOption sizes = 3;
23
+ repeated ShopFilterAttribute attributes = 4;
24
+ double price_min = 5;
25
+ double price_max = 6;
26
+ }
27
+
28
+ message ShopFilterOption {
29
+ string value = 1;
30
+ string label = 2;
31
+ int32 count = 3;
32
+ }
33
+
34
+ message ShopFilterColorOption {
35
+ string value = 1;
36
+ string label = 2;
37
+ string hex = 3;
38
+ int32 count = 4;
39
+ }
40
+
41
+ message ShopFilterAttribute {
42
+ string slug = 1;
43
+ map<string, string> name = 2;
44
+ string display_type = 3;
45
+ repeated ShopFilterOption values = 4;
46
+ }