@mamindom/contracts 1.0.116 → 1.0.117

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.
@@ -163,6 +163,7 @@ export interface ProductDetailResponse {
163
163
  reviewCount: number;
164
164
  manualRating?: number | undefined;
165
165
  activePromo?: ProductPromoInfo | undefined;
166
+ colors: ProductColorResponse[];
166
167
  }
167
168
  export interface ProductDetailResponse_NameEntry {
168
169
  key: string;
@@ -671,6 +672,7 @@ export interface ProductVariantDetailResponse {
671
672
  images: ProductImageResponse[];
672
673
  attributes: ProductAttributeResponse[];
673
674
  overrides: VariantOverrides | undefined;
675
+ colorId?: string | undefined;
674
676
  }
675
677
  export interface ProductVariantDetailResponse_OptionsEntry {
676
678
  key: string;
@@ -740,6 +742,7 @@ export interface CreateProductVariantRequest {
740
742
  videoUrl?: string | undefined;
741
743
  images: ProductImagePayload[];
742
744
  attributeValueIds: string[];
745
+ colorId?: string | undefined;
743
746
  }
744
747
  export interface CreateProductVariantRequest_OptionsEntry {
745
748
  key: string;
@@ -796,6 +799,7 @@ export interface UpdateProductVariantRequest {
796
799
  videoUrl?: string | undefined;
797
800
  images: ProductImagePayload[];
798
801
  attributeValueIds: string[];
802
+ colorId?: string | undefined;
799
803
  clearPrice: boolean;
800
804
  clearOldPrice: boolean;
801
805
  clearName: boolean;
@@ -807,6 +811,7 @@ export interface UpdateProductVariantRequest {
807
811
  clearImages: boolean;
808
812
  clearAttributes: boolean;
809
813
  clearVideo: boolean;
814
+ clearColor: boolean;
810
815
  }
811
816
  export interface UpdateProductVariantRequest_OptionsEntry {
812
817
  key: string;
@@ -863,6 +868,115 @@ export interface BulkLookupProductsRequest {
863
868
  export interface BulkLookupProductsResponse {
864
869
  results: ProductLookupResult[];
865
870
  }
871
+ export interface ProductColorImagePayload {
872
+ url: string;
873
+ mediaId: string;
874
+ sortOrder?: number | undefined;
875
+ }
876
+ export interface ProductColorImageResponse {
877
+ id: string;
878
+ url: string;
879
+ mediaId: string;
880
+ alt: {
881
+ [key: string]: string;
882
+ };
883
+ sortOrder: number;
884
+ }
885
+ export interface ProductColorImageResponse_AltEntry {
886
+ key: string;
887
+ value: string;
888
+ }
889
+ export interface ProductColorResponse {
890
+ id: string;
891
+ productId: string;
892
+ label: {
893
+ [key: string]: string;
894
+ };
895
+ hex?: string | undefined;
896
+ description: {
897
+ [key: string]: string;
898
+ };
899
+ mainImage?: string | undefined;
900
+ mainImageId?: string | undefined;
901
+ sortOrder: number;
902
+ guid1c?: string | undefined;
903
+ images: ProductColorImageResponse[];
904
+ }
905
+ export interface ProductColorResponse_LabelEntry {
906
+ key: string;
907
+ value: string;
908
+ }
909
+ export interface ProductColorResponse_DescriptionEntry {
910
+ key: string;
911
+ value: string;
912
+ }
913
+ export interface CreateProductColorRequest {
914
+ productId: string;
915
+ label: {
916
+ [key: string]: string;
917
+ };
918
+ hex?: string | undefined;
919
+ description: {
920
+ [key: string]: string;
921
+ };
922
+ mainImage?: string | undefined;
923
+ mainImageId?: string | undefined;
924
+ sortOrder?: number | undefined;
925
+ guid1c?: string | undefined;
926
+ images: ProductColorImagePayload[];
927
+ }
928
+ export interface CreateProductColorRequest_LabelEntry {
929
+ key: string;
930
+ value: string;
931
+ }
932
+ export interface CreateProductColorRequest_DescriptionEntry {
933
+ key: string;
934
+ value: string;
935
+ }
936
+ export interface UpdateProductColorRequest {
937
+ id: string;
938
+ label: {
939
+ [key: string]: string;
940
+ };
941
+ hex?: string | undefined;
942
+ description: {
943
+ [key: string]: string;
944
+ };
945
+ mainImage?: string | undefined;
946
+ mainImageId?: string | undefined;
947
+ sortOrder?: number | undefined;
948
+ guid1c?: string | undefined;
949
+ images: ProductColorImagePayload[];
950
+ clearHex: boolean;
951
+ clearDescription: boolean;
952
+ clearMainImage: boolean;
953
+ clearImages: boolean;
954
+ }
955
+ export interface UpdateProductColorRequest_LabelEntry {
956
+ key: string;
957
+ value: string;
958
+ }
959
+ export interface UpdateProductColorRequest_DescriptionEntry {
960
+ key: string;
961
+ value: string;
962
+ }
963
+ export interface DeleteProductColorRequest {
964
+ id: string;
965
+ }
966
+ export interface GetProductColorsRequest {
967
+ productId: string;
968
+ }
969
+ export interface GetProductColorsResponse {
970
+ items: ProductColorResponse[];
971
+ }
972
+ export interface ReorderProductColorsRequest {
973
+ productId: string;
974
+ items: ColorSortOrderItem[];
975
+ }
976
+ export interface ColorSortOrderItem {
977
+ colorId: string;
978
+ sortOrder: number;
979
+ }
866
980
  export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
867
981
  export interface ProductServiceClient {
868
982
  getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
@@ -903,6 +1017,12 @@ export interface ProductServiceClient {
903
1017
  assignVariantSizeCharts(request: AssignVariantSizeChartsRequest): Observable<SuccessResponse>;
904
1018
  removeVariantSizeChart(request: RemoveVariantSizeChartRequest): Observable<SuccessResponse>;
905
1019
  getVariantSizeCharts(request: GetVariantSizeChartsRequest): Observable<GetProductSizeChartsResponse>;
1020
+ /** ─── Product colors (нова ієрархія: Product → Color → Variant) ────────────── */
1021
+ createProductColor(request: CreateProductColorRequest): Observable<ProductColorResponse>;
1022
+ updateProductColor(request: UpdateProductColorRequest): Observable<ProductColorResponse>;
1023
+ deleteProductColor(request: DeleteProductColorRequest): Observable<DeleteResponse>;
1024
+ getProductColors(request: GetProductColorsRequest): Observable<GetProductColorsResponse>;
1025
+ reorderProductColors(request: ReorderProductColorsRequest): Observable<SuccessResponse>;
906
1026
  }
907
1027
  export interface ProductServiceController {
908
1028
  getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
@@ -943,6 +1063,12 @@ export interface ProductServiceController {
943
1063
  assignVariantSizeCharts(request: AssignVariantSizeChartsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
944
1064
  removeVariantSizeChart(request: RemoveVariantSizeChartRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
945
1065
  getVariantSizeCharts(request: GetVariantSizeChartsRequest): Promise<GetProductSizeChartsResponse> | Observable<GetProductSizeChartsResponse> | GetProductSizeChartsResponse;
1066
+ /** ─── Product colors (нова ієрархія: Product → Color → Variant) ────────────── */
1067
+ createProductColor(request: CreateProductColorRequest): Promise<ProductColorResponse> | Observable<ProductColorResponse> | ProductColorResponse;
1068
+ updateProductColor(request: UpdateProductColorRequest): Promise<ProductColorResponse> | Observable<ProductColorResponse> | ProductColorResponse;
1069
+ deleteProductColor(request: DeleteProductColorRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
1070
+ getProductColors(request: GetProductColorsRequest): Promise<GetProductColorsResponse> | Observable<GetProductColorsResponse> | GetProductColorsResponse;
1071
+ reorderProductColors(request: ReorderProductColorsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
946
1072
  }
947
1073
  export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
948
1074
  export declare const PRODUCT_SERVICE_NAME = "ProductService";
@@ -84,6 +84,11 @@ function ProductServiceControllerMethods() {
84
84
  "assignVariantSizeCharts",
85
85
  "removeVariantSizeChart",
86
86
  "getVariantSizeCharts",
87
+ "createProductColor",
88
+ "updateProductColor",
89
+ "deleteProductColor",
90
+ "getProductColors",
91
+ "reorderProductColors",
87
92
  ];
88
93
  for (const method of grpcMethods) {
89
94
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -62,16 +62,23 @@ service ProductService {
62
62
  rpc AddProductToGroup (AddProductToGroupRequest) returns (SuccessResponse);
63
63
  rpc RemoveProductFromGroup (RemoveProductFromGroupRequest) returns (SuccessResponse);
64
64
 
65
-
65
+
66
66
  rpc CreateProductVariant (CreateProductVariantRequest) returns (ProductVariantDetailResponse);
67
67
  rpc UpdateProductVariant (UpdateProductVariantRequest) returns (ProductVariantDetailResponse);
68
68
  rpc GetProductVariant (GetProductVariantRequest) returns (ProductVariantDetailResponse);
69
69
 
70
-
70
+
71
71
 
72
72
  rpc AssignVariantSizeCharts (AssignVariantSizeChartsRequest) returns (SuccessResponse);
73
73
  rpc RemoveVariantSizeChart (RemoveVariantSizeChartRequest) returns (SuccessResponse);
74
74
  rpc GetVariantSizeCharts (GetVariantSizeChartsRequest) returns (GetProductSizeChartsResponse);
75
+
76
+ // ─── Product colors (нова ієрархія: Product → Color → Variant) ──────────────
77
+ rpc CreateProductColor (CreateProductColorRequest) returns (ProductColorResponse);
78
+ rpc UpdateProductColor (UpdateProductColorRequest) returns (ProductColorResponse);
79
+ rpc DeleteProductColor (DeleteProductColorRequest) returns (DeleteResponse);
80
+ rpc GetProductColors (GetProductColorsRequest) returns (GetProductColorsResponse);
81
+ rpc ReorderProductColors (ReorderProductColorsRequest) returns (SuccessResponse);
75
82
  }
76
83
 
77
84
 
@@ -210,6 +217,7 @@ message ProductDetailResponse {
210
217
  int32 review_count = 36;
211
218
  optional float manual_rating = 37;
212
219
  optional ProductPromoInfo active_promo = 38;
220
+ repeated ProductColorResponse colors = 39;
213
221
  }
214
222
 
215
223
 
@@ -612,6 +620,8 @@ message ProductVariantDetailResponse {
612
620
  repeated ProductAttributeResponse attributes = 19;
613
621
 
614
622
  VariantOverrides overrides = 20;
623
+
624
+ optional string color_id = 21;
615
625
  }
616
626
 
617
627
  message VariantOverrides {
@@ -651,6 +661,7 @@ message CreateProductVariantRequest {
651
661
  optional string video_url = 16;
652
662
  repeated ProductImagePayload images = 17;
653
663
  repeated string attribute_value_ids = 18;
664
+ optional string color_id = 19;
654
665
  }
655
666
 
656
667
 
@@ -677,6 +688,7 @@ message UpdateProductVariantRequest {
677
688
  optional string video_url = 16;
678
689
  repeated ProductImagePayload images = 17;
679
690
  repeated string attribute_value_ids = 18;
691
+ optional string color_id = 19;
680
692
 
681
693
 
682
694
  bool clear_price = 30;
@@ -690,6 +702,7 @@ message UpdateProductVariantRequest {
690
702
  bool clear_images = 38;
691
703
  bool clear_attributes = 39;
692
704
  bool clear_video = 40;
705
+ bool clear_color = 41;
693
706
  }
694
707
 
695
708
  message GetProductVariantRequest {
@@ -737,4 +750,85 @@ message BulkLookupProductsRequest {
737
750
 
738
751
  message BulkLookupProductsResponse {
739
752
  repeated ProductLookupResult results = 1;
753
+ }
754
+
755
+
756
+ // ─── Product colors ──────────────────────────────────────────────────────────
757
+
758
+ message ProductColorImagePayload {
759
+ string url = 1;
760
+ string media_id = 2;
761
+ optional int32 sort_order = 3;
762
+ }
763
+
764
+ message ProductColorImageResponse {
765
+ string id = 1;
766
+ string url = 2;
767
+ string media_id = 3;
768
+ map<string, string> alt = 4;
769
+ int32 sort_order = 5;
770
+ }
771
+
772
+ message ProductColorResponse {
773
+ string id = 1;
774
+ string product_id = 2;
775
+ map<string, string> label = 3;
776
+ optional string hex = 4;
777
+ map<string, string> description = 5;
778
+ optional string main_image = 6;
779
+ optional string main_image_id = 7;
780
+ int32 sort_order = 8;
781
+ optional string guid_1c = 9;
782
+ repeated ProductColorImageResponse images = 10;
783
+ }
784
+
785
+ message CreateProductColorRequest {
786
+ string product_id = 1;
787
+ map<string, string> label = 2;
788
+ optional string hex = 3;
789
+ map<string, string> description = 4;
790
+ optional string main_image = 5;
791
+ optional string main_image_id = 6;
792
+ optional int32 sort_order = 7;
793
+ optional string guid_1c = 8;
794
+ repeated ProductColorImagePayload images = 9;
795
+ }
796
+
797
+ message UpdateProductColorRequest {
798
+ string id = 1;
799
+ map<string, string> label = 2;
800
+ optional string hex = 3;
801
+ map<string, string> description = 4;
802
+ optional string main_image = 5;
803
+ optional string main_image_id = 6;
804
+ optional int32 sort_order = 7;
805
+ optional string guid_1c = 8;
806
+ repeated ProductColorImagePayload images = 9;
807
+
808
+ bool clear_hex = 30;
809
+ bool clear_description = 31;
810
+ bool clear_main_image = 32;
811
+ bool clear_images = 33;
812
+ }
813
+
814
+ message DeleteProductColorRequest {
815
+ string id = 1;
816
+ }
817
+
818
+ message GetProductColorsRequest {
819
+ string product_id = 1;
820
+ }
821
+
822
+ message GetProductColorsResponse {
823
+ repeated ProductColorResponse items = 1;
824
+ }
825
+
826
+ message ReorderProductColorsRequest {
827
+ string product_id = 1;
828
+ repeated ColorSortOrderItem items = 2;
829
+ }
830
+
831
+ message ColorSortOrderItem {
832
+ string color_id = 1;
833
+ int32 sort_order = 2;
740
834
  }
package/gen/product.ts CHANGED
@@ -168,6 +168,7 @@ export interface ProductDetailResponse {
168
168
  reviewCount: number;
169
169
  manualRating?: number | undefined;
170
170
  activePromo?: ProductPromoInfo | undefined;
171
+ colors: ProductColorResponse[];
171
172
  }
172
173
 
173
174
  export interface ProductDetailResponse_NameEntry {
@@ -687,6 +688,7 @@ export interface ProductVariantDetailResponse {
687
688
  images: ProductImageResponse[];
688
689
  attributes: ProductAttributeResponse[];
689
690
  overrides: VariantOverrides | undefined;
691
+ colorId?: string | undefined;
690
692
  }
691
693
 
692
694
  export interface ProductVariantDetailResponse_OptionsEntry {
@@ -752,6 +754,7 @@ export interface CreateProductVariantRequest {
752
754
  videoUrl?: string | undefined;
753
755
  images: ProductImagePayload[];
754
756
  attributeValueIds: string[];
757
+ colorId?: string | undefined;
755
758
  }
756
759
 
757
760
  export interface CreateProductVariantRequest_OptionsEntry {
@@ -803,6 +806,7 @@ export interface UpdateProductVariantRequest {
803
806
  videoUrl?: string | undefined;
804
807
  images: ProductImagePayload[];
805
808
  attributeValueIds: string[];
809
+ colorId?: string | undefined;
806
810
  clearPrice: boolean;
807
811
  clearOldPrice: boolean;
808
812
  clearName: boolean;
@@ -814,6 +818,7 @@ export interface UpdateProductVariantRequest {
814
818
  clearImages: boolean;
815
819
  clearAttributes: boolean;
816
820
  clearVideo: boolean;
821
+ clearColor: boolean;
817
822
  }
818
823
 
819
824
  export interface UpdateProductVariantRequest_OptionsEntry {
@@ -884,6 +889,118 @@ export interface BulkLookupProductsResponse {
884
889
  results: ProductLookupResult[];
885
890
  }
886
891
 
892
+ export interface ProductColorImagePayload {
893
+ url: string;
894
+ mediaId: string;
895
+ sortOrder?: number | undefined;
896
+ }
897
+
898
+ export interface ProductColorImageResponse {
899
+ id: string;
900
+ url: string;
901
+ mediaId: string;
902
+ alt: { [key: string]: string };
903
+ sortOrder: number;
904
+ }
905
+
906
+ export interface ProductColorImageResponse_AltEntry {
907
+ key: string;
908
+ value: string;
909
+ }
910
+
911
+ export interface ProductColorResponse {
912
+ id: string;
913
+ productId: string;
914
+ label: { [key: string]: string };
915
+ hex?: string | undefined;
916
+ description: { [key: string]: string };
917
+ mainImage?: string | undefined;
918
+ mainImageId?: string | undefined;
919
+ sortOrder: number;
920
+ guid1c?: string | undefined;
921
+ images: ProductColorImageResponse[];
922
+ }
923
+
924
+ export interface ProductColorResponse_LabelEntry {
925
+ key: string;
926
+ value: string;
927
+ }
928
+
929
+ export interface ProductColorResponse_DescriptionEntry {
930
+ key: string;
931
+ value: string;
932
+ }
933
+
934
+ export interface CreateProductColorRequest {
935
+ productId: string;
936
+ label: { [key: string]: string };
937
+ hex?: string | undefined;
938
+ description: { [key: string]: string };
939
+ mainImage?: string | undefined;
940
+ mainImageId?: string | undefined;
941
+ sortOrder?: number | undefined;
942
+ guid1c?: string | undefined;
943
+ images: ProductColorImagePayload[];
944
+ }
945
+
946
+ export interface CreateProductColorRequest_LabelEntry {
947
+ key: string;
948
+ value: string;
949
+ }
950
+
951
+ export interface CreateProductColorRequest_DescriptionEntry {
952
+ key: string;
953
+ value: string;
954
+ }
955
+
956
+ export interface UpdateProductColorRequest {
957
+ id: string;
958
+ label: { [key: string]: string };
959
+ hex?: string | undefined;
960
+ description: { [key: string]: string };
961
+ mainImage?: string | undefined;
962
+ mainImageId?: string | undefined;
963
+ sortOrder?: number | undefined;
964
+ guid1c?: string | undefined;
965
+ images: ProductColorImagePayload[];
966
+ clearHex: boolean;
967
+ clearDescription: boolean;
968
+ clearMainImage: boolean;
969
+ clearImages: boolean;
970
+ }
971
+
972
+ export interface UpdateProductColorRequest_LabelEntry {
973
+ key: string;
974
+ value: string;
975
+ }
976
+
977
+ export interface UpdateProductColorRequest_DescriptionEntry {
978
+ key: string;
979
+ value: string;
980
+ }
981
+
982
+ export interface DeleteProductColorRequest {
983
+ id: string;
984
+ }
985
+
986
+ export interface GetProductColorsRequest {
987
+ productId: string;
988
+ }
989
+
990
+ export interface GetProductColorsResponse {
991
+ items: ProductColorResponse[];
992
+ }
993
+
994
+ export interface ReorderProductColorsRequest {
995
+ productId: string;
996
+ items: ColorSortOrderItem[];
997
+ }
998
+
999
+ export interface ColorSortOrderItem {
1000
+ colorId: string;
1001
+ sortOrder: number;
1002
+ }
1003
+
887
1004
  export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
888
1005
 
889
1006
  export interface ProductServiceClient {
@@ -962,6 +1079,18 @@ export interface ProductServiceClient {
962
1079
  removeVariantSizeChart(request: RemoveVariantSizeChartRequest): Observable<SuccessResponse>;
963
1080
 
964
1081
  getVariantSizeCharts(request: GetVariantSizeChartsRequest): Observable<GetProductSizeChartsResponse>;
1082
+
1083
+ /** ─── Product colors (нова ієрархія: Product → Color → Variant) ────────────── */
1084
+
1085
+ createProductColor(request: CreateProductColorRequest): Observable<ProductColorResponse>;
1086
+
1087
+ updateProductColor(request: UpdateProductColorRequest): Observable<ProductColorResponse>;
1088
+
1089
+ deleteProductColor(request: DeleteProductColorRequest): Observable<DeleteResponse>;
1090
+
1091
+ getProductColors(request: GetProductColorsRequest): Observable<GetProductColorsResponse>;
1092
+
1093
+ reorderProductColors(request: ReorderProductColorsRequest): Observable<SuccessResponse>;
965
1094
  }
966
1095
 
967
1096
  export interface ProductServiceController {
@@ -1114,6 +1243,28 @@ export interface ProductServiceController {
1114
1243
  getVariantSizeCharts(
1115
1244
  request: GetVariantSizeChartsRequest,
1116
1245
  ): Promise<GetProductSizeChartsResponse> | Observable<GetProductSizeChartsResponse> | GetProductSizeChartsResponse;
1246
+
1247
+ /** ─── Product colors (нова ієрархія: Product → Color → Variant) ────────────── */
1248
+
1249
+ createProductColor(
1250
+ request: CreateProductColorRequest,
1251
+ ): Promise<ProductColorResponse> | Observable<ProductColorResponse> | ProductColorResponse;
1252
+
1253
+ updateProductColor(
1254
+ request: UpdateProductColorRequest,
1255
+ ): Promise<ProductColorResponse> | Observable<ProductColorResponse> | ProductColorResponse;
1256
+
1257
+ deleteProductColor(
1258
+ request: DeleteProductColorRequest,
1259
+ ): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
1260
+
1261
+ getProductColors(
1262
+ request: GetProductColorsRequest,
1263
+ ): Promise<GetProductColorsResponse> | Observable<GetProductColorsResponse> | GetProductColorsResponse;
1264
+
1265
+ reorderProductColors(
1266
+ request: ReorderProductColorsRequest,
1267
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
1117
1268
  }
1118
1269
 
1119
1270
  export function ProductServiceControllerMethods() {
@@ -1157,6 +1308,11 @@ export function ProductServiceControllerMethods() {
1157
1308
  "assignVariantSizeCharts",
1158
1309
  "removeVariantSizeChart",
1159
1310
  "getVariantSizeCharts",
1311
+ "createProductColor",
1312
+ "updateProductColor",
1313
+ "deleteProductColor",
1314
+ "getProductColors",
1315
+ "reorderProductColors",
1160
1316
  ];
1161
1317
  for (const method of grpcMethods) {
1162
1318
  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.116",
4
+ "version": "1.0.117",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -62,16 +62,23 @@ service ProductService {
62
62
  rpc AddProductToGroup (AddProductToGroupRequest) returns (SuccessResponse);
63
63
  rpc RemoveProductFromGroup (RemoveProductFromGroupRequest) returns (SuccessResponse);
64
64
 
65
-
65
+
66
66
  rpc CreateProductVariant (CreateProductVariantRequest) returns (ProductVariantDetailResponse);
67
67
  rpc UpdateProductVariant (UpdateProductVariantRequest) returns (ProductVariantDetailResponse);
68
68
  rpc GetProductVariant (GetProductVariantRequest) returns (ProductVariantDetailResponse);
69
69
 
70
-
70
+
71
71
 
72
72
  rpc AssignVariantSizeCharts (AssignVariantSizeChartsRequest) returns (SuccessResponse);
73
73
  rpc RemoveVariantSizeChart (RemoveVariantSizeChartRequest) returns (SuccessResponse);
74
74
  rpc GetVariantSizeCharts (GetVariantSizeChartsRequest) returns (GetProductSizeChartsResponse);
75
+
76
+ // ─── Product colors (нова ієрархія: Product → Color → Variant) ──────────────
77
+ rpc CreateProductColor (CreateProductColorRequest) returns (ProductColorResponse);
78
+ rpc UpdateProductColor (UpdateProductColorRequest) returns (ProductColorResponse);
79
+ rpc DeleteProductColor (DeleteProductColorRequest) returns (DeleteResponse);
80
+ rpc GetProductColors (GetProductColorsRequest) returns (GetProductColorsResponse);
81
+ rpc ReorderProductColors (ReorderProductColorsRequest) returns (SuccessResponse);
75
82
  }
76
83
 
77
84
 
@@ -210,6 +217,7 @@ message ProductDetailResponse {
210
217
  int32 review_count = 36;
211
218
  optional float manual_rating = 37;
212
219
  optional ProductPromoInfo active_promo = 38;
220
+ repeated ProductColorResponse colors = 39;
213
221
  }
214
222
 
215
223
 
@@ -612,6 +620,8 @@ message ProductVariantDetailResponse {
612
620
  repeated ProductAttributeResponse attributes = 19;
613
621
 
614
622
  VariantOverrides overrides = 20;
623
+
624
+ optional string color_id = 21;
615
625
  }
616
626
 
617
627
  message VariantOverrides {
@@ -651,6 +661,7 @@ message CreateProductVariantRequest {
651
661
  optional string video_url = 16;
652
662
  repeated ProductImagePayload images = 17;
653
663
  repeated string attribute_value_ids = 18;
664
+ optional string color_id = 19;
654
665
  }
655
666
 
656
667
 
@@ -677,6 +688,7 @@ message UpdateProductVariantRequest {
677
688
  optional string video_url = 16;
678
689
  repeated ProductImagePayload images = 17;
679
690
  repeated string attribute_value_ids = 18;
691
+ optional string color_id = 19;
680
692
 
681
693
 
682
694
  bool clear_price = 30;
@@ -690,6 +702,7 @@ message UpdateProductVariantRequest {
690
702
  bool clear_images = 38;
691
703
  bool clear_attributes = 39;
692
704
  bool clear_video = 40;
705
+ bool clear_color = 41;
693
706
  }
694
707
 
695
708
  message GetProductVariantRequest {
@@ -737,4 +750,85 @@ message BulkLookupProductsRequest {
737
750
 
738
751
  message BulkLookupProductsResponse {
739
752
  repeated ProductLookupResult results = 1;
753
+ }
754
+
755
+
756
+ // ─── Product colors ──────────────────────────────────────────────────────────
757
+
758
+ message ProductColorImagePayload {
759
+ string url = 1;
760
+ string media_id = 2;
761
+ optional int32 sort_order = 3;
762
+ }
763
+
764
+ message ProductColorImageResponse {
765
+ string id = 1;
766
+ string url = 2;
767
+ string media_id = 3;
768
+ map<string, string> alt = 4;
769
+ int32 sort_order = 5;
770
+ }
771
+
772
+ message ProductColorResponse {
773
+ string id = 1;
774
+ string product_id = 2;
775
+ map<string, string> label = 3;
776
+ optional string hex = 4;
777
+ map<string, string> description = 5;
778
+ optional string main_image = 6;
779
+ optional string main_image_id = 7;
780
+ int32 sort_order = 8;
781
+ optional string guid_1c = 9;
782
+ repeated ProductColorImageResponse images = 10;
783
+ }
784
+
785
+ message CreateProductColorRequest {
786
+ string product_id = 1;
787
+ map<string, string> label = 2;
788
+ optional string hex = 3;
789
+ map<string, string> description = 4;
790
+ optional string main_image = 5;
791
+ optional string main_image_id = 6;
792
+ optional int32 sort_order = 7;
793
+ optional string guid_1c = 8;
794
+ repeated ProductColorImagePayload images = 9;
795
+ }
796
+
797
+ message UpdateProductColorRequest {
798
+ string id = 1;
799
+ map<string, string> label = 2;
800
+ optional string hex = 3;
801
+ map<string, string> description = 4;
802
+ optional string main_image = 5;
803
+ optional string main_image_id = 6;
804
+ optional int32 sort_order = 7;
805
+ optional string guid_1c = 8;
806
+ repeated ProductColorImagePayload images = 9;
807
+
808
+ bool clear_hex = 30;
809
+ bool clear_description = 31;
810
+ bool clear_main_image = 32;
811
+ bool clear_images = 33;
812
+ }
813
+
814
+ message DeleteProductColorRequest {
815
+ string id = 1;
816
+ }
817
+
818
+ message GetProductColorsRequest {
819
+ string product_id = 1;
820
+ }
821
+
822
+ message GetProductColorsResponse {
823
+ repeated ProductColorResponse items = 1;
824
+ }
825
+
826
+ message ReorderProductColorsRequest {
827
+ string product_id = 1;
828
+ repeated ColorSortOrderItem items = 2;
829
+ }
830
+
831
+ message ColorSortOrderItem {
832
+ string color_id = 1;
833
+ int32 sort_order = 2;
740
834
  }