This commit is contained in:
masoodafar-web
2025-11-16 03:28:34 +03:30
parent e2107d1ac8
commit eed625c722
12 changed files with 216 additions and 70 deletions

View File

@@ -1,16 +1,26 @@
using CMSMicroservice.Protobuf.Protos.UserContract;
namespace FrontOffice.BFF.Application.UserCQ.Commands.AcceptContract;
public class AcceptContractCommandHandler : IRequestHandler<AcceptContractCommand, Unit>
{
private readonly IApplicationContractContext _context;
private readonly ICurrentUserService _currentUserService;
public AcceptContractCommandHandler(IApplicationContractContext context)
public AcceptContractCommandHandler(IApplicationContractContext context, ICurrentUserService currentUserService)
{
_context = context;
_currentUserService = currentUserService;
}
public async Task<Unit> Handle(AcceptContractCommand request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
await _context.UserContract.CreateNewUserContractAsync(new CreateNewUserContractRequest()
{
SignGuid = request.SignGuid,
UserId = long.Parse(_currentUserService.UserId ?? throw new InvalidOperationException()),
ContractId = 1,
SignedPdfFile = request.ContractHtml,
}, cancellationToken: cancellationToken);
return new Unit();
}
}