Merge branch 'kub-stage' into production
Build and Deploy to Production / build-and-deploy (push) Successful in 9m24s

This commit is contained in:
masoodafar-web
2026-05-14 01:13:03 +03:30
6 changed files with 16 additions and 4 deletions
+2
View File
@@ -101,6 +101,8 @@ spec:
--- ---
# CMS Ingress # CMS Ingress
# If clients report TLS PartialChain, the tls secret (cms-tls) tls.crt must include the full chain
# (leaf + intermediates). cert-manager ACME usually provides this; manual certs need fullchain.pem in tls.crt.
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
@@ -11,6 +11,7 @@ public class GetDiscountProductsQuery : IRequest<GetDiscountProductsResponseDto>
public bool? IsActive { get; set; } public bool? IsActive { get; set; }
public int? MinPrice { get; set; } public int? MinPrice { get; set; }
public int? MaxPrice { get; set; } public int? MaxPrice { get; set; }
public string? SortBy { get; set; }
} }
public class GetDiscountProductsResponseDto public class GetDiscountProductsResponseDto
@@ -1,3 +1,4 @@
using CMSMicroservice.Application.Common.Extensions;
using CMSMicroservice.Application.Common.Interfaces; using CMSMicroservice.Application.Common.Interfaces;
using CMSMicroservice.Application.Common.Models; using CMSMicroservice.Application.Common.Models;
using MediatR; using MediatR;
@@ -51,13 +52,16 @@ public class GetDiscountProductsQueryHandler : IRequestHandler<GetDiscountProduc
query = query.Where(p => p.Price <= request.MaxPrice.Value); query = query.Where(p => p.Price <= request.MaxPrice.Value);
} }
if (!string.IsNullOrEmpty(request.SortBy))
query = query.ApplyOrder(request.SortBy);
else
query = query.OrderByDescending(p => p.Created);
var totalCount = await query.CountAsync(cancellationToken); var totalCount = await query.CountAsync(cancellationToken);
// Apply pagination
var pagination = request.PaginationQuery ?? new PaginationState { PageNumber = 1, PageSize = 10 }; var pagination = request.PaginationQuery ?? new PaginationState { PageNumber = 1, PageSize = 10 };
var products = await query var products = await query
.OrderByDescending(p => p.Created)
.Skip((pagination.PageNumber - 1) * pagination.PageSize) .Skip((pagination.PageNumber - 1) * pagination.PageSize)
.Take(pagination.PageSize) .Take(pagination.PageSize)
.Select(p => new DiscountProductDto .Select(p => new DiscountProductDto
@@ -3,7 +3,7 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>0.0.195</Version> <Version>0.0.197</Version>
<DebugType>None</DebugType> <DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild> <GeneratePackageOnBuild>False</GeneratePackageOnBuild>
@@ -163,6 +163,7 @@ message GetDiscountProductsRequest
google.protobuf.BoolValue in_stock = 6; google.protobuf.BoolValue in_stock = 6;
int32 page_number = 7; int32 page_number = 7;
int32 page_size = 8; int32 page_size = 8;
google.protobuf.StringValue sort_by = 9;
} }
message GetDiscountProductsResponse message GetDiscountProductsResponse
@@ -184,6 +185,7 @@ message DiscountProductDto
int32 view_count = 9; int32 view_count = 9;
bool is_active = 10; bool is_active = 10;
google.protobuf.Timestamp created = 11; google.protobuf.Timestamp created = 11;
int32 sale_count = 12;
} }
// ===== Product Image Gallery Messages ===== // ===== Product Image Gallery Messages =====
@@ -23,6 +23,8 @@ public class DiscountProductProfile : IRegister
src => src.MinPrice != null ? (int?)src.MinPrice.Value : null) src => src.MinPrice != null ? (int?)src.MinPrice.Value : null)
.Map(dest => dest.MaxPrice, .Map(dest => dest.MaxPrice,
src => src.MaxPrice != null ? (int?)src.MaxPrice.Value : null) src => src.MaxPrice != null ? (int?)src.MaxPrice.Value : null)
.Map(dest => dest.SortBy,
src => string.IsNullOrEmpty(src.SortBy) ? null : src.SortBy)
.Map(dest => dest.PaginationQuery, src => new PaginationState .Map(dest => dest.PaginationQuery, src => new PaginationState
{ {
PageNumber = src.PageNumber > 0 ? src.PageNumber : 1, PageNumber = src.PageNumber > 0 ? src.PageNumber : 1,
@@ -64,6 +66,7 @@ public class DiscountProductProfile : IRegister
ThumbnailPath = p.ThumbnailPath ?? string.Empty, ThumbnailPath = p.ThumbnailPath ?? string.Empty,
RemainingCount = p.RemainingCount, RemainingCount = p.RemainingCount,
ViewCount = p.ViewCount, ViewCount = p.ViewCount,
SaleCount = p.SaleCount,
IsActive = p.IsActive, IsActive = p.IsActive,
Created = Timestamp.FromDateTime(DateTime.UtcNow) Created = Timestamp.FromDateTime(DateTime.UtcNow)
}); });