d0224d41b2
Build and Deploy / build (push) Successful in 2m33s
- Added GetDiscountSalesReportQuery and GetDiscountSalesReportQueryHandler to fetch discount sales reports. - Introduced DiscountSalesReportDto, SalesSummaryDto, and PeriodSalesDto for structured report data. feat: Add Discount Product Image Management - Created AddDiscountProductImageCommand and AddDiscountProductImageCommandHandler for image uploads. - Implemented DeleteDiscountProductImageCommand and DeleteDiscountProductImageCommandHandler for image deletion. - Added ReorderDiscountProductImagesCommand and ReorderDiscountProductImagesCommandHandler for image reordering. - Developed UpdateDiscountProductImageCommand and UpdateDiscountProductImageCommandHandler for image updates. feat: Enhance Product Tag Management - Introduced DeleteProductTagCommand and DeleteProductTagCommandHandler for tag deletion. - Added UpdateProductTagCommand and UpdateProductTagCommandHandler for updating product tags. - Implemented GetAllProductTagsQuery and GetAllProductTagsQueryHandler for fetching all product tags. - Created GetProductTagQuery and GetProductTagQueryHandler for retrieving specific product tags. feat: Develop Web API Services for Discount and Product Management - Implemented DiscountCategoryService for managing discount categories. - Created DiscountOrderService for handling discount orders and related queries. - Developed DiscountProductService for managing discount products and their images. - Added DiscountShoppingCartService for managing shopping cart operations. - Implemented ProductTagService for managing product tags and their associations. - Created TagService for managing tags and their related operations.
28 lines
914 B
C#
28 lines
914 B
C#
using CMSMicroservice.Protobuf.Protos.DiscountShoppingCart;
|
|
|
|
namespace BackOffice.BFF.Application.DiscountShoppingCartCQ.Commands.UpdateCartItemCount;
|
|
|
|
public class UpdateCartItemCountCommandHandler : IRequestHandler<UpdateCartItemCountCommand>
|
|
{
|
|
private readonly IApplicationContractContext _context;
|
|
|
|
public UpdateCartItemCountCommandHandler(IApplicationContractContext context)
|
|
{
|
|
_context = context;
|
|
}
|
|
|
|
public async Task<Unit> Handle(UpdateCartItemCountCommand request, CancellationToken cancellationToken)
|
|
{
|
|
await _context.DiscountShoppingCarts.UpdateCartItemCountAsync(
|
|
new UpdateCartItemCountRequest
|
|
{
|
|
UserId = request.UserId,
|
|
ProductId = request.ProductId,
|
|
NewCount = request.NewCount
|
|
},
|
|
cancellationToken: cancellationToken);
|
|
|
|
return Unit.Value;
|
|
}
|
|
}
|