public async Task <Unit> Handle(UpdateVendorRegistrationCaseStatusCommand request, CancellationToken cancellationToken) { var legalEntity = await _legalEntitiesService.GetLegalEntity(request.AccountId, request.AccountLegalEntityId); var updateRequest = new UpdateVendorRegistrationCaseStatusRequest { HashedLegalEntityId = legalEntity.HashedLegalEntityId, Status = request.VrfCaseStatus, CaseStatusLastUpdatedDate = DateTime.Now }; await _vendorRegistrationService.UpdateVendorRegistrationCaseStatus(updateRequest); return(await Task.FromResult(Unit.Value)); }
private async Task SendUpdates(GetVendorRegistrationCaseStatusUpdateResponse response) { Task UpdateVendorRegistrationCaseStatus(VendorRegistrationCase @case) { return(_vendorRegistrationService.UpdateVendorRegistrationCaseStatus( new UpdateVendorRegistrationCaseStatusRequest { CaseId = @case.CaseId, HashedLegalEntityId = @case.ApprenticeshipLegalEntityId, Status = @case.CaseStatus, CaseStatusLastUpdatedDate = @case.CaseStatusLastUpdatedDate })); } await Task.WhenAll(response.RegistrationCases .Where(c => !string.IsNullOrEmpty(c.ApprenticeshipLegalEntityId) && c.CaseType?.ToUpper() == "NEW") .Select(UpdateVendorRegistrationCaseStatus)); }