using CMSMicroservice.Protobuf.Protos.DiscountCategory; using CMSMicroservice.WebApi.Common.Services; using CMSMicroservice.Application.DiscountShopCQ.Commands.CreateDiscountCategory; using CMSMicroservice.Application.DiscountShopCQ.Commands.UpdateDiscountCategory; using CMSMicroservice.Application.DiscountShopCQ.Commands.DeleteDiscountCategory; using CMSMicroservice.Application.DiscountShopCQ.Queries.GetDiscountCategories; namespace CMSMicroservice.WebApi.Services; public class DiscountCategoryService : DiscountCategoryContract.DiscountCategoryContractBase { private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS; public DiscountCategoryService(IDispatchRequestToCQRS dispatchRequestToCQRS) { _dispatchRequestToCQRS = dispatchRequestToCQRS; } public override async Task CreateDiscountCategory(CreateDiscountCategoryRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } public override async Task UpdateDiscountCategory(UpdateDiscountCategoryRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } public override async Task DeleteDiscountCategory(DeleteDiscountCategoryRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } public override async Task GetDiscountCategories(GetDiscountCategoriesRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } }