public InvalidHeaderData MapData(IMessage message)
        {
            var ukprn = message.LearningProviderEntity.UKPRN;

            var invalidHeaderData = new InvalidHeaderData();

            invalidHeaderData.CollectionDetails = new List <CollectionDetail>()
            {
                new CollectionDetail
                {
                    UKPRN               = ukprn,
                    Collection          = message.HeaderEntity.CollectionDetailsEntity.CollectionString,
                    FilePreparationDate = message.HeaderEntity.CollectionDetailsEntity.FilePreparationDate,
                    Year = message.HeaderEntity.CollectionDetailsEntity.YearString
                }
            };

            invalidHeaderData.LearningProviders = new List <LearningProvider>()
            {
                new LearningProvider
                {
                    UKPRN = ukprn
                }
            };

            var source = message.HeaderEntity.SourceEntity;

            invalidHeaderData.Sources = new List <Source>()
            {
                new Source
                {
                    UKPRN = ukprn,
                    ComponentSetVersion = source.ComponentSetVersion,
                    DateTime            = source.DateTime,
                    ProtectiveMarking   = source.ProtectiveMarkingString,
                    ReferenceData       = source.ReferenceData,
                    Release             = source.Release,
                    SerialNo            = source.SerialNo,
                    SoftwarePackage     = source.SoftwarePackage,
                    SoftwareSupplier    = source.SoftwareSupplier
                }
            };

            invalidHeaderData.SourceFiles = BuildInvalidSourceFileCollection(message);

            return(invalidHeaderData);
        }
 public Task StoreInvalidHeaderDataAsync(InvalidHeaderData invalidHeaderData, SqlConnection sqlConnection, CancellationToken cancellationToken)
 => _invalidHeaderDataStoreService.StoreAsync(invalidHeaderData, sqlConnection, cancellationToken);