feat: extend discount product gRPC API with sort_by and sale_count
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m11s

- Add sort_by (StringValue) to GetDiscountProductsRequest proto to enable dynamic sorting
- Add sale_count (int32) to DiscountProductDto proto for top-seller exposure
- Update GetDiscountProductsQuery with SortBy property
- Update GetDiscountProductsQueryHandler to use ApplyOrder(SortBy) with fallback to Created desc; project SaleCount in SELECT
- Add SortBy and SaleCount Mapster mappings in DiscountProductProfile
- Bump CMSMicroservice.Protobuf version to 0.0.196

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
masoodafar-web
2026-05-13 19:47:56 +03:30
parent 98c2875ae2
commit 683ed370b5
5 changed files with 14 additions and 4 deletions
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.0.195</Version>
<Version>0.0.196</Version>
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -163,6 +163,7 @@ message GetDiscountProductsRequest
google.protobuf.BoolValue in_stock = 6;
int32 page_number = 7;
int32 page_size = 8;
google.protobuf.StringValue sort_by = 9;
}
message GetDiscountProductsResponse
@@ -184,6 +185,7 @@ message DiscountProductDto
int32 view_count = 9;
bool is_active = 10;
google.protobuf.Timestamp created = 11;
int32 sale_count = 12;
}
// ===== Product Image Gallery Messages =====