udpate
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user