예제 #1
0
        public async Task <Unit> Handle(UpdateVendorRegistrationCaseStatusCommand request, CancellationToken cancellationToken)
        {
            var legalEntity = await _incentivesService.GetLegalEntity(request.AccountId, request.AccountLegalEntityId);

            var updateRequest = new UpdateVendorRegistrationCaseStatusRequest
            {
                HashedLegalEntityId = legalEntity.HashedLegalEntityId,
                Status = request.VrfCaseStatus,
                CaseStatusLastUpdatedDate = DateTime.Now
            };
            await _incentivesService.UpdateVendorRegistrationCaseStatus(updateRequest);

            return(await Task.FromResult(Unit.Value));
        }
예제 #2
0
        private async Task SendUpdates(GetVendorRegistrationCaseStatusUpdateResponse response)
        {
            Task UpdateVendorRegistrationCaseStatus(VendorRegistrationCase @case)
            {
                return(_incentivesService.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));
        }