示例#1
0
        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));
        }
示例#2
0
        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));
        }