public async Task ValidateData(
            SupplementaryDataWrapper wrapper,
            ISourceFileModel sourceFile,
            CancellationToken cancellationToken)
        {
            try
            {
                foreach (var looseModel in wrapper.SupplementaryDataLooseModels)
                {
                    if (_looseValidatorCommand.Execute(looseModel))
                    {
                        continue;
                    }

                    foreach (var error in _looseValidatorCommand.Errors)
                    {
                        wrapper.ValidErrorModels.Add(error);
                    }

                    if (!_looseValidatorCommand.RejectFile)
                    {
                        continue;
                    }

                    return;
                }

                wrapper.SupplementaryDataLooseModels = FilterOutInvalidLooseRows(wrapper);

                wrapper.SupplementaryDataModels = wrapper.SupplementaryDataLooseModels
                                                  .Select(m => _mapper.GetSupplementaryDataModelFromLooseModel(m)).ToList();

                await PrePopulateReferenceDataCache(wrapper, sourceFile, cancellationToken);

                foreach (var command in _validatorCommands)
                {
                    if (command is ICrossRecordCommand)
                    {
                        ((ICrossRecordCommand)command).AllRecords = wrapper.SupplementaryDataModels;
                    }

                    foreach (var model in wrapper.SupplementaryDataModels)
                    {
                        if (command.IsValid(model))
                        {
                            continue;
                        }

                        foreach (var error in command.Errors)
                        {
                            wrapper.ValidErrorModels.Add(error);
                        }

                        if (!command.RejectFile)
                        {
                            continue;
                        }

                        RejectFile = true;
                        return;
                    }
                }

                wrapper.SupplementaryDataModels = FilterOutInvalidRows(wrapper);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message, ex);
                throw;
            }
        }
        public void ValidateData(
            SupplementaryDataWrapper wrapper,
            SourceFileModel sourceFile,
            CancellationToken cancellationToken)
        {
            foreach (var looseModel in wrapper.SupplementaryDataLooseModels)
            {
                if (_looseValidatorCommand.Execute(looseModel))
                {
                    continue;
                }

                foreach (var error in _looseValidatorCommand.Errors)
                {
                    wrapper.ValidErrorModels.Add(error);
                }

                if (!_looseValidatorCommand.RejectFile)
                {
                    continue;
                }

                return;
            }

            wrapper.SupplementaryDataLooseModels = FilterOutInvalidLooseRows(wrapper);

            wrapper.SupplementaryDataModels = wrapper.SupplementaryDataLooseModels.Select(m => _mapper.GetSupplementaryDataModelFromLooseModel(m)).ToList();

            var allUlns = wrapper.SupplementaryDataModels.Select(m => m.ULN).ToList();

            _populationService.PrePopulateUlnCache(allUlns, cancellationToken);

            var ukPrn = Convert.ToInt64(sourceFile.UKPRN);

            _populationService.PrePopulateContractAllocations(ukPrn, wrapper.SupplementaryDataModels, cancellationToken);

            foreach (var command in _validatorCommands)
            {
                if (command is ICrossRecordCommand)
                {
                    ((ICrossRecordCommand)command).AllRecords = wrapper.SupplementaryDataModels;
                }

                foreach (var model in wrapper.SupplementaryDataModels)
                {
                    if (command.Execute(model))
                    {
                        continue;
                    }

                    foreach (var error in command.Errors)
                    {
                        wrapper.ValidErrorModels.Add(error);
                    }

                    if (!command.RejectFile)
                    {
                        continue;
                    }

                    RejectFile = true;
                    return;
                }
            }

            wrapper.SupplementaryDataModels = FilterOutInvalidRows(wrapper);
        }