Add validators and services for Product Galleries and Product Tags

- Implemented Create, Delete, Get, and Update validators for Product Galleries.
- Added Create, Delete, Get, and Update validators for Product Tags.
- Created service classes for handling Discount Categories, Discount Orders, Discount Products, Discount Shopping Cart, Product Categories, Product Galleries, and Product Tags.
- Each service class integrates with CQRS for command and query handling.
- Established mapping profiles for Product Galleries.
This commit is contained in:
masoodafar-web
2025-12-04 02:40:49 +03:30
parent 40d54d08fc
commit f0f48118e7
436 changed files with 33159 additions and 2005 deletions
@@ -0,0 +1,37 @@
using CMSMicroservice.Protobuf.Protos.ProductCategory;
using CMSMicroservice.WebApi.Common.Services;
using CMSMicroservice.Application.ProductCategoryCQ.Commands.CreateNewProductCategory;
using CMSMicroservice.Application.ProductCategoryCQ.Commands.UpdateProductCategory;
using CMSMicroservice.Application.ProductCategoryCQ.Commands.DeleteProductCategory;
using CMSMicroservice.Application.ProductCategoryCQ.Queries.GetProductCategory;
using CMSMicroservice.Application.ProductCategoryCQ.Queries.GetAllProductCategoryByFilter;
namespace CMSMicroservice.WebApi.Services;
public class ProductCategoryService : ProductCategoryContract.ProductCategoryContractBase
{
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
public ProductCategoryService(IDispatchRequestToCQRS dispatchRequestToCQRS)
{
_dispatchRequestToCQRS = dispatchRequestToCQRS;
}
public override async Task<CreateNewProductCategoryResponse> CreateNewProductCategory(CreateNewProductCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<CreateNewProductCategoryRequest, CreateNewProductCategoryCommand, CreateNewProductCategoryResponse>(request, context);
}
public override async Task<Empty> UpdateProductCategory(UpdateProductCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<UpdateProductCategoryRequest, UpdateProductCategoryCommand>(request, context);
}
public override async Task<Empty> DeleteProductCategory(DeleteProductCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<DeleteProductCategoryRequest, DeleteProductCategoryCommand>(request, context);
}
public override async Task<GetProductCategoryResponse> GetProductCategory(GetProductCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetProductCategoryRequest, GetProductCategoryQuery, GetProductCategoryResponse>(request, context);
}
public override async Task<GetAllProductCategoryByFilterResponse> GetAllProductCategoryByFilter(GetAllProductCategoryByFilterRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetAllProductCategoryByFilterRequest, GetAllProductCategoryByFilterQuery, GetAllProductCategoryByFilterResponse>(request, context);
}
}