Add product categories CQRS handlers and gRPC endpoints

This commit is contained in:
masoodafar-web
2025-11-27 03:46:51 +03:30
parent ad3cc728df
commit 8340a932ce
7 changed files with 118 additions and 0 deletions

View File

@@ -60,6 +60,19 @@ service ProductsContract
body: "*"
};
};
rpc GetCategories(GetCategoriesRequest) returns (GetCategoriesResponse){
option (google.api.http) = {
get: "/GetCategories"
};
};
rpc UpdateProductCategories(UpdateProductCategoriesRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/UpdateProductCategories"
body: "*"
};
};
}
message ImageFileModel
@@ -233,3 +246,26 @@ message RemoveProductImageRequest
{
int64 product_gallery_id = 1;
}
message CategoryItem
{
int64 id = 1;
string title = 2;
bool selected = 3;
}
message GetCategoriesRequest
{
int64 product_id = 1;
}
message GetCategoriesResponse
{
repeated CategoryItem items = 1;
}
message UpdateProductCategoriesRequest
{
int64 product_id = 1;
repeated int64 category_ids = 2;
}