Generator Changes at 11/20/2025 12:22:59 AM +03:30

This commit is contained in:
masoodafar-web
2025-11-20 00:26:12 +03:30
parent 0d518a90d9
commit 852a0f7277
20 changed files with 788 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
namespace FrontOffice.BFF.WebApi.Common.Mappings;
public class ShopingCartProfile : IRegister
{
void IRegister.Register(TypeAdapterConfig config)
{
//config.NewConfig<Source,Destination>()
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
}
}

View File

@@ -0,0 +1,27 @@
using FrontOffice.BFF.Protobuf.Protos.ShopingCart;
using FrontOffice.BFF.WebApi.Common.Services;
using FrontOffice.BFF.Application.ShopingCartCQ.Commands.AddNewUserCart;
using FrontOffice.BFF.Application.ShopingCartCQ.Queries.GetAllUserCart;
using FrontOffice.BFF.Application.ShopingCartCQ.Commands.UpdateUserCart;
namespace FrontOffice.BFF.WebApi.Services;
public class ShopingCartService : ShopingCartContract.ShopingCartContractBase
{
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
public ShopingCartService(IDispatchRequestToCQRS dispatchRequestToCQRS)
{
_dispatchRequestToCQRS = dispatchRequestToCQRS;
}
public override async Task<Empty> AddNewUserCart(AddNewUserCartRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<AddNewUserCartRequest, AddNewUserCartCommand>(request, context);
}
public override async Task<GetAllUserCartResponse> GetAllUserCart(Empty request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetAllUserCartQuery, GetAllUserCartResponse>(context);
}
public override async Task<Empty> UpdateUserCart(UpdateUserCartRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<UpdateUserCartRequest, UpdateUserCartCommand>(request, context);
}
}