Пример #1
0
        private void ComparePriceEpisodes(EarningEvents.Messages.Events.EarningEvent earningEvent,
                                          EarningEventModel earningEventModel)
        {
            if (earningEvent.PriceEpisodes.IsNullOrEmpty())
            {
                return;
            }
            earningEventModel.PriceEpisodes.Should().NotBeNullOrEmpty();

            foreach (var priceEpisode in earningEvent.PriceEpisodes)
            {
                var priceEpisodeModel = earningEventModel.PriceEpisodes.FirstOrDefault(x => x.PriceEpisodeIdentifier == priceEpisode.Identifier);
                priceEpisodeModel.Should().NotBeNull();
                priceEpisodeModel.ActualEndDate.Should().Be(priceEpisode.ActualEndDate);
                priceEpisodeModel.AgreedPrice.Should().Be(priceEpisode.AgreedPrice);
                priceEpisodeModel.Completed.Should().Be(priceEpisode.Completed);
                priceEpisodeModel.CompletionAmount.Should().Be(priceEpisode.CompletionAmount);
                priceEpisodeModel.CompletionHoldBackExemptionCode.Should().Be(priceEpisode.CompletionHoldBackExemptionCode);
                priceEpisodeModel.CourseStartDate.Should().Be(priceEpisode.CourseStartDate);
                priceEpisodeModel.EarningEventId.Should().Be(earningEvent.EventId);
                priceEpisodeModel.EffectiveTotalNegotiatedPriceStartDate.Should().Be(priceEpisode.EffectiveTotalNegotiatedPriceStartDate);
                priceEpisodeModel.EmployerContribution.Should().Be(priceEpisode.EmployerContribution);
                priceEpisodeModel.InstalmentAmount.Should().Be(priceEpisode.InstalmentAmount);
                priceEpisodeModel.NumberOfInstalments.Should().Be(priceEpisode.NumberOfInstalments);
                priceEpisodeModel.PlannedEndDate.Should().Be(priceEpisode.PlannedEndDate);
                priceEpisodeModel.SfaContributionPercentage.Should().Be(priceEpisode.EmployerContribution);
                priceEpisodeModel.StartDate.Should().Be(priceEpisode.StartDate);
                priceEpisodeModel.TotalNegotiatedPrice1.Should().Be(priceEpisode.TotalNegotiatedPrice1);
                priceEpisodeModel.TotalNegotiatedPrice2.Should().Be(priceEpisode.TotalNegotiatedPrice2);
                priceEpisodeModel.TotalNegotiatedPrice3.Should().Be(priceEpisode.TotalNegotiatedPrice3);
                priceEpisodeModel.TotalNegotiatedPrice4.Should().Be(priceEpisode.TotalNegotiatedPrice4);
            }
        }
Пример #2
0
        private static List <AmountFromDate> GetTnpValue(
            EarningEventModel earning,
            Func <EarningEventPriceEpisodeModel, decimal> tnpSelector)
        {
            return(earning.PriceEpisodes.Select(AmountSelector).ToList());

            AmountFromDate AmountSelector(EarningEventPriceEpisodeModel pe) =>
            (pe.StartDate, tnpSelector(pe));
        }
        public List <EarningEventPriceEpisodeModel> Resolve(EarningEvent source, EarningEventModel destination, List <EarningEventPriceEpisodeModel> destMember, ResolutionContext context)
        {
            var priceEpisodeModels = source.PriceEpisodes?
                                     .Select(priceEpisode => context.Mapper.Map <EarningEventPriceEpisodeModel>(priceEpisode))
                                     .ToList() ?? new List <EarningEventPriceEpisodeModel>();

            priceEpisodeModels.ForEach(model => model.EarningEventId = source.EventId);
            return(priceEpisodeModels);
        }
Пример #4
0
        private static decimal CalculateCost(this EarningEventModel earning)
        {
            var tnp1and2 = earning.PriceEpisodes.Sum(e =>
                                                     e.TotalNegotiatedPrice1 + e.TotalNegotiatedPrice2);

            var tnp3and4 = earning.PriceEpisodes.Sum(e =>
                                                     e.TotalNegotiatedPrice3 + e.TotalNegotiatedPrice4);

            return(tnp3and4 > 0 ? tnp3and4 : tnp1and2);
        }
Пример #5
0
 public static CollectionPeriod ToCollectionPeriod(
     this EarningEventModel earning,
     ApprenticeshipModel apprenticeship,
     IEnumerable <DataLockEventModel> datalocks)
 =>
 new CollectionPeriod
 {
     Period         = new Period(earning.AcademicYear, earning.CollectionPeriod),
     DataLocks      = datalocks.ToDataLocks(earning),
     Apprenticeship = apprenticeship?.ToDataMatch(),
     Ilr            = earning.ToDataMatch(),
 };
Пример #6
0
 private void CompareCourseDetails(EarningEvents.Messages.Events.EarningEvent earningEvent,
                                   EarningEventModel earningEventModel)
 {
     earningEventModel.LearningStartDate.Should().Be(earningEvent.LearningAim.StartDate);
     earningEventModel.LearningAimSequenceNumber.Should().Be(earningEvent.LearningAim?.SequenceNumber);
     earningEventModel.LearningAimFrameworkCode.Should().Be(earningEvent.LearningAim.FrameworkCode);
     earningEventModel.LearningAimPathwayCode.Should().Be(earningEvent.LearningAim.PathwayCode);
     earningEventModel.LearningAimProgrammeType.Should().Be(earningEvent.LearningAim.ProgrammeType);
     earningEventModel.LearningAimStandardCode.Should().Be(earningEvent.LearningAim.StandardCode);
     earningEventModel.LearningAimReference.Should().Be(earningEvent.LearningAim.Reference);
     earningEventModel.LearningAimFundingLineType.Should().Be(earningEvent.PriceEpisodes.Single(x => x.LearningAimSequenceNumber == earningEvent.LearningAim.SequenceNumber).FundingLineType);
 }
Пример #7
0
        public void CanMapEarningEventModelToFunctionalSkillAct1EarningEvent()
        {
            var earningEventModel = new EarningEventModel
            {
                AgreementId                = "1",
                Ukprn                      = 100,
                AcademicYear               = 1819,
                EventId                    = Guid.NewGuid(),
                EventTime                  = DateTime.Today,
                IlrSubmissionDateTime      = DateTime.Today,
                JobId                      = 1,
                IlrFileName                = "100.xml",
                SfaContributionPercentage  = 0.5m,
                CollectionPeriod           = 1,
                LearnerReferenceNumber     = "20",
                LearnerUln                 = 1000,
                LearningAimReference       = "30",
                LearningAimProgrammeType   = (int)ProgrammeType.Standard,
                LearningAimStandardCode    = 25,
                LearningAimFrameworkCode   = 402,
                LearningAimPathwayCode     = 103,
                LearningAimFundingLineType = "18-19",
                LearningAimSequenceNumber  = 1,
                StartDate                  = DateTime.Today
            };

            var act1EarningEvent = Mapper.Map <Act1FunctionalSkillEarningsEvent>(earningEventModel);

            act1EarningEvent.Learner     = Mapper.Map <Learner>(earningEventModel);
            act1EarningEvent.LearningAim = Mapper.Map <LearningAim>(earningEventModel);

            act1EarningEvent.Ukprn.Should().Be(earningEventModel.Ukprn);
            act1EarningEvent.CollectionPeriod.Period.Should().Be(earningEventModel.CollectionPeriod);
            act1EarningEvent.CollectionPeriod.AcademicYear.Should().Be(earningEventModel.AcademicYear);
            act1EarningEvent.CollectionYear.Should().Be(earningEventModel.AcademicYear);
            act1EarningEvent.EventId.Should().Be(earningEventModel.EventId);
            act1EarningEvent.EventTime.Should().Be(earningEventModel.EventTime);
            act1EarningEvent.IlrSubmissionDateTime.Should().Be(earningEventModel.IlrSubmissionDateTime);
            act1EarningEvent.JobId.Should().Be(earningEventModel.JobId);
            act1EarningEvent.IlrFileName.Should().Be(earningEventModel.IlrFileName);
            act1EarningEvent.StartDate.Should().Be(earningEventModel.StartDate);

            act1EarningEvent.Learner.Uln.Should().Be(earningEventModel.LearnerUln);
            act1EarningEvent.Learner.ReferenceNumber.Should().Be(earningEventModel.LearnerReferenceNumber);

            act1EarningEvent.LearningAim.Reference.Should().Be(earningEventModel.LearningAimReference);
            act1EarningEvent.LearningAim.ProgrammeType.Should().Be(earningEventModel.LearningAimProgrammeType);
            act1EarningEvent.LearningAim.StandardCode.Should().Be(earningEventModel.LearningAimStandardCode);
            act1EarningEvent.LearningAim.FrameworkCode.Should().Be(earningEventModel.LearningAimFrameworkCode);
            act1EarningEvent.LearningAim.PathwayCode.Should().Be(earningEventModel.LearningAimPathwayCode);
            act1EarningEvent.LearningAim.FundingLineType.Should().Be(earningEventModel.LearningAimFundingLineType);
            act1EarningEvent.LearningAim.SequenceNumber.Should().Be(earningEventModel.LearningAimSequenceNumber);
        }
Пример #8
0
 private static DataMatch ToDataMatch(this EarningEventModel earning) =>
 new DataMatch
 {
     Uln               = earning.LearnerUln,
     Ukprn             = earning.Ukprn,
     Standard          = (short)earning.LearningAimStandardCode,
     Framework         = (short)earning.LearningAimFrameworkCode,
     Program           = (short)earning.LearningAimProgrammeType,
     Pathway           = (short)earning.LearningAimPathwayCode,
     Cost              = earning.CalculateCost(),
     PriceStart        = earning.PriceEpisodes.FirstOrDefault()?.StartDate,
     StoppedOn         = earning.PriceEpisodes.FirstOrDefault()?.ActualEndDate,
     IlrSubmissionDate = earning.IlrSubmissionDateTime,
     Tnp1              = GetTnpValue(earning, x => x.TotalNegotiatedPrice1),
     Tnp2              = GetTnpValue(earning, x => x.TotalNegotiatedPrice2),
     Tnp3              = GetTnpValue(earning, x => x.TotalNegotiatedPrice3),
     Tnp4              = GetTnpValue(earning, x => x.TotalNegotiatedPrice4),
 };
Пример #9
0
        public void Test()
        {
            var eventId = Guid.NewGuid();
            var earning = new EarningEventModel
            {
                Id            = 1,
                EventId       = eventId,
                ContractType  = ContractType.Act1,
                JobId         = 123,
                PriceEpisodes = new List <EarningEventPriceEpisodeModel> {
                    new EarningEventPriceEpisodeModel {
                        Id = 1, EarningEventId = eventId, CompletionAmount = 3000, InstalmentAmount = 1000
                    }
                },
                Periods = new List <EarningEventPeriodModel> {
                    new EarningEventPeriodModel {
                        Id = 1, EarningEventId = eventId, PriceEpisodeIdentifier = "1/1/1234", TransactionType = TransactionType.Learning, Amount = 1000
                    }
                }
            };

            var     config = new MapperConfiguration(cfg => cfg.AddProfile <EarningEventProfile>());
            IMapper mapper = new Mapper(config);

            var newEarning = mapper.Map <EarningEventModel, EarningEventModel>(earning);

            newEarning.Should().NotBeNull();
            newEarning.Id.Should().Be(0);
            newEarning.EventId.Should().Be(earning.EventId);
            newEarning.ContractType.Should().Be(earning.ContractType);
            newEarning.JobId.Should().Be(earning.JobId);
            newEarning.PriceEpisodes.Should().NotBeNullOrEmpty();
            newEarning.PriceEpisodes.First().Id.Should().Be(0);
            newEarning.PriceEpisodes.First().EarningEventId.Should().Be(earning.EventId);
            newEarning.PriceEpisodes.First().CompletionAmount.Should().Be(3000);
            newEarning.PriceEpisodes.First().InstalmentAmount.Should().Be(1000);
            newEarning.Periods.Should().NotBeNullOrEmpty();
            newEarning.Periods.First().Id.Should().Be(0);
            newEarning.Periods.First().Amount.Should().Be(1000);
            newEarning.Periods.First().EarningEventId.Should().Be(eventId);
            newEarning.Periods.First().PriceEpisodeIdentifier.Should().Be("1/1/1234");
            newEarning.Periods.First().TransactionType.Should().Be(TransactionType.Learning);
        }
Пример #10
0
        private EarningEventModel CreateEarningEventModel(
            Action <EarningEventModel> action)
        {
            var earningEvent = new EarningEventModel
            {
                JobId                      = 123,
                CollectionPeriod           = 1,
                AcademicYear               = 1920,
                Ukprn                      = 1234,
                EventId                    = Guid.NewGuid(),
                LearnerUln                 = 123456,
                LearnerReferenceNumber     = "learner ref",
                EventTime                  = DateTimeOffset.Now,
                IlrSubmissionDateTime      = DateTime.Now,
                SfaContributionPercentage  = .95M,
                AgreementId                = null,
                IlrFileName                = "somefile.ilr",
                Periods                    = new List <EarningEventPeriodModel>(),
                LearningAimFundingLineType = "Funding line type",
                LearningAimSequenceNumber  = 1,
                LearningAimFrameworkCode   = 10,
                LearningAimPathwayCode     = 11,
                LearningAimReference       = "learn ref",
                LearningStartDate          = DateTime.Today.AddYears(-1),
                LearningAimProgrammeType   = 12,
                LearningAimStandardCode    = 13,
                ContractType               = ContractType.Act1,
                PriceEpisodes              = new List <EarningEventPriceEpisodeModel>(),
                StartDate                  = DateTime.Today,
                ActualEndDate              = null,
                PlannedEndDate             = DateTime.Today.AddYears(1),
                InstalmentAmount           = 500,
                NumberOfInstalments        = 24,
                CompletionAmount           = 1500,
                CompletionStatus           = 1,
                EventType                  = typeof(ApprenticeshipContractType1EarningEvent).FullName,
            };

            action?.Invoke(earningEvent);
            return(earningEvent);
        }
        public async Task Get_Apprenticeship_Update_FunctionalSkill_Payments_Correctly()
        {
            mocker.Mock <IActorDataCache <List <ApprenticeshipModel> > >()
            .Setup(x => x.TryGet(It.IsAny <string>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(new ConditionalValue <List <ApprenticeshipModel> >(false, null));

            //Arrange
            updatedApprenticeship.Ukprn = 100;
            updatedApprenticeship.Uln   = 200;

            var eventId = Guid.NewGuid();

            var earningModel = new EarningEventModel
            {
                Ukprn            = updatedApprenticeship.Ukprn,
                LearnerUln       = updatedApprenticeship.Uln,
                Periods          = new List <EarningEventPeriodModel>(),
                StartDate        = DateTime.Today,
                EventId          = eventId,
                AcademicYear     = 1819,
                CollectionPeriod = 1,
                AgreementId      = "1",
                PriceEpisodes    = new List <EarningEventPriceEpisodeModel>(),
            };

            var transactionTypes = Enum.GetValues(typeof(FunctionalSkillType)).Cast <int>().ToList();;

            foreach (var transactionType in transactionTypes)
            {
                earningModel.Periods.Add(new EarningEventPeriodModel
                {
                    TransactionType           = (TransactionType)transactionType,
                    CensusDate                = DateTime.Today,
                    Amount                    = 100m,
                    PriceEpisodeIdentifier    = "1",
                    SfaContributionPercentage = 0.5m,
                    DeliveryPeriod            = 1,
                    EarningEventId            = eventId
                });
            }

            //mocker.Mock<IApprenticeshipRepository>()
            //    .Setup(x => x.GetLatestProviderApprenticeshipEarnings(updatedApprenticeship.Uln, updatedApprenticeship.Ukprn, It.IsAny<string>(), It.IsAny<CancellationToken>()))
            //    .ReturnsAsync(earningModel)
            //    .Verifiable();

            mocker.Mock <IDataLockProcessor>()
            .Setup(x => x.GetFunctionalSkillPaymentEvents(It.IsAny <Act1FunctionalSkillEarningsEvent>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(new List <FunctionalSkillDataLockEvent>())
            .Verifiable();

            var processor = mocker.Create <ApprenticeshipUpdatedProcessor>();

            await processor.GetApprenticeshipUpdateFunctionalSkillPayments(updatedApprenticeship);

            //mocker.Mock<IApprenticeshipRepository>()
            //    .Verify(x => x.GetLatestProviderApprenticeshipEarnings(updatedApprenticeship.Uln, updatedApprenticeship.Ukprn, It.IsAny<string>(), It.IsAny<CancellationToken>()),
            //        Times.Once);

            mocker.Mock <IDataLockProcessor>()
            .Verify(x => x.GetFunctionalSkillPaymentEvents(It.IsAny <Act1FunctionalSkillEarningsEvent>(), It.IsAny <CancellationToken>()),
                    Times.Once);
        }
        public List <EarningEventPeriodModel> Resolve(FunctionalSkillEarningsEvent source, EarningEventModel destination, List <EarningEventPeriodModel> destMember, ResolutionContext context)
        {
            var periods = destination.Periods ?? new List <EarningEventPeriodModel>();

            periods.AddRange(source.Earnings
                             .SelectMany(earning => earning.Periods, (earning, period) => new { earning, period })
                             .Select(item => new EarningEventPeriodModel
            {
                TransactionType           = (TransactionType)item.earning.Type,
                DeliveryPeriod            = item.period.Period,
                Amount                    = item.period.Amount,
                PriceEpisodeIdentifier    = item.period.PriceEpisodeIdentifier,
                SfaContributionPercentage = item.period.SfaContributionPercentage,
                EarningEventId            = source.EventId
            })
                             );
            return(periods);
        }
Пример #13
0
 private static bool IncludeEverythingPredicate(EarningEventModel _) => true;
Пример #14
0
 private void CompareLearnerDetails(EarningEvents.Messages.Events.EarningEvent earningEvent, EarningEventModel earningEventModel)
 {
     earningEventModel.LearnerReferenceNumber.Should().Be(earningEvent.Learner.ReferenceNumber);
     earningEventModel.LearnerUln.Should().Be(earningEvent.Learner.Uln);
 }
Пример #15
0
 private static bool FilterInMainAim(EarningEventModel e) =>
 e.LearningAimReference == "ZPROG001";
Пример #16
0
 private void CompareCommonProperties(EarningEvents.Messages.Events.EarningEvent earningEvent, EarningEventModel earningEventModel)
 {
     earningEventModel.EventId.Should().Be(earningEvent.EventId);
     earningEventModel.EventTime.Should().Be(earningEvent.EventTime);
     earningEventModel.JobId.Should().Be(earningEvent.JobId);
     earningEventModel.IlrFileName.Should().Be(earningEvent.IlrFileName);
     earningEventModel.IlrSubmissionDateTime.Should().Be(earningEvent.IlrSubmissionDateTime);
     earningEventModel.AcademicYear.Should().Be(earningEvent.CollectionPeriod.AcademicYear);
     earningEventModel.CollectionPeriod.Should().Be(earningEvent.CollectionPeriod.Period);
     CompareCourseDetails(earningEvent, earningEventModel);
     CompareLearnerDetails(earningEvent, earningEventModel);
 }
Пример #17
0
 private static List <DataLock> ToDataLocks(this IEnumerable <DataLockEventModel> locks, EarningEventModel earning) =>
 locks
 .Where(l => l.Ukprn == earning.Ukprn && l.AcademicYear == earning.AcademicYear && l.CollectionPeriod == earning.CollectionPeriod)
 .SelectMany(l => l.NonPayablePeriods)
 .SelectMany(l => l.DataLockEventNonPayablePeriodFailures)
 .Select(l => (DataLock)l.DataLockFailure)
 .Distinct()
 .OrderBy(x => x)
 .ToList();
 public EarningEventModel Map(EarningEventModel earningEventModel)
 {
     return(mapper.Map <EarningEventModel, EarningEventModel>(earningEventModel));
 }
        public List <EarningEventPeriodModel> Resolve(ApprenticeshipContractTypeEarningsEvent source, EarningEventModel destination, List <EarningEventPeriodModel> destMember, ResolutionContext context)
        {
            var periods = destination.Periods ?? new List <EarningEventPeriodModel>();

            periods.AddRange(source.OnProgrammeEarnings?
                             .SelectMany(onProgEarning => onProgEarning.Periods, (onProgEarning, period) => new { onProgEarning, period })
                             .Select(item => new EarningEventPeriodModel
            {
                TransactionType           = (TransactionType)item.onProgEarning.Type,
                DeliveryPeriod            = item.period.Period,
                Amount                    = item.period.Amount,
                PriceEpisodeIdentifier    = item.period.PriceEpisodeIdentifier,
                SfaContributionPercentage = item.period.SfaContributionPercentage,
                EarningEventId            = source.EventId,
                CensusDate                = item.onProgEarning.CensusDate
            }) ?? new List <EarningEventPeriodModel>()
                             );

            periods.AddRange(source.IncentiveEarnings?
                             .SelectMany(incentiveEarning => incentiveEarning.Periods, (incentiveEarning, period) => new { incentiveEarning, period })
                             .Select(item => new EarningEventPeriodModel
            {
                TransactionType        = (TransactionType)item.incentiveEarning.Type,
                DeliveryPeriod         = item.period.Period,
                Amount                 = item.period.Amount,
                PriceEpisodeIdentifier = item.period.PriceEpisodeIdentifier,
                EarningEventId         = source.EventId,
                CensusDate             = item.incentiveEarning.CensusDate
            }) ?? new List <EarningEventPeriodModel>()
                             );
            return(periods);
        }
Пример #20
0
        public void CanMapEarningEventModelToApprenticeshipContractType1EarningEvent()
        {
            var earningEventModel = new EarningEventModel
            {
                AgreementId               = "1",
                Ukprn                     = 100,
                AcademicYear              = 1819,
                EventId                   = Guid.NewGuid(),
                EventTime                 = DateTime.Today,
                IlrSubmissionDateTime     = DateTime.Today,
                JobId                     = 1,
                IlrFileName               = "100.xml",
                SfaContributionPercentage = 0.5m,
                CollectionPeriod          = 1,
                PriceEpisodes             = new List <EarningEventPriceEpisodeModel>
                {
                    new EarningEventPriceEpisodeModel
                    {
                        PriceEpisodeIdentifier = "1",
                        TotalNegotiatedPrice1  = 10m,
                        TotalNegotiatedPrice2  = 20m,
                        TotalNegotiatedPrice3  = 30m,
                        TotalNegotiatedPrice4  = 40m,
                        AgreedPrice            = 100m,
                        CourseStartDate        = DateTime.Today,
                        StartDate                       = DateTime.Today,
                        PlannedEndDate                  = DateTime.Today,
                        ActualEndDate                   = DateTime.Today,
                        NumberOfInstalments             = 1,
                        InstalmentAmount                = 100m,
                        CompletionAmount                = 20m,
                        Completed                       = true,
                        EmployerContribution            = 10m,
                        CompletionHoldBackExemptionCode = 10
                    }
                },
                LearnerReferenceNumber     = "20",
                LearnerUln                 = 1000,
                LearningAimReference       = "30",
                LearningAimProgrammeType   = (int)ProgrammeType.Standard,
                LearningAimStandardCode    = 25,
                LearningAimFrameworkCode   = 402,
                LearningAimPathwayCode     = 103,
                LearningAimFundingLineType = "18-19",
                LearningAimSequenceNumber  = 1
            };

            var act1EarningEvent = Mapper.Map <ApprenticeshipContractType1EarningEvent>(earningEventModel);

            act1EarningEvent.Learner     = Mapper.Map <Learner>(earningEventModel);
            act1EarningEvent.LearningAim = Mapper.Map <LearningAim>(earningEventModel);

            act1EarningEvent.AgreementId.Should().Be(earningEventModel.AgreementId);
            act1EarningEvent.Ukprn.Should().Be(earningEventModel.Ukprn);
            act1EarningEvent.CollectionPeriod.Period.Should().Be(earningEventModel.CollectionPeriod);
            act1EarningEvent.CollectionPeriod.AcademicYear.Should().Be(earningEventModel.AcademicYear);
            act1EarningEvent.CollectionYear.Should().Be(earningEventModel.AcademicYear);
            act1EarningEvent.EventId.Should().Be(earningEventModel.EventId);
            act1EarningEvent.EventTime.Should().Be(earningEventModel.EventTime);
            act1EarningEvent.IlrSubmissionDateTime.Should().Be(earningEventModel.IlrSubmissionDateTime);
            act1EarningEvent.JobId.Should().Be(earningEventModel.JobId);
            act1EarningEvent.IlrFileName.Should().Be(earningEventModel.IlrFileName);
            act1EarningEvent.SfaContributionPercentage.Should().Be(earningEventModel.SfaContributionPercentage);

            act1EarningEvent.PriceEpisodes[0].Identifier.Should().Be(earningEventModel.PriceEpisodes[0].PriceEpisodeIdentifier);
            act1EarningEvent.PriceEpisodes[0].TotalNegotiatedPrice1.Should().Be(earningEventModel.PriceEpisodes[0].TotalNegotiatedPrice1);
            act1EarningEvent.PriceEpisodes[0].TotalNegotiatedPrice2.Should().Be(earningEventModel.PriceEpisodes[0].TotalNegotiatedPrice2);
            act1EarningEvent.PriceEpisodes[0].TotalNegotiatedPrice3.Should().Be(earningEventModel.PriceEpisodes[0].TotalNegotiatedPrice3);
            act1EarningEvent.PriceEpisodes[0].TotalNegotiatedPrice4.Should().Be(earningEventModel.PriceEpisodes[0].TotalNegotiatedPrice4);
            act1EarningEvent.PriceEpisodes[0].AgreedPrice.Should().Be(earningEventModel.PriceEpisodes[0].AgreedPrice);
            act1EarningEvent.PriceEpisodes[0].CourseStartDate.Should().Be(earningEventModel.PriceEpisodes[0].CourseStartDate);
            act1EarningEvent.PriceEpisodes[0].PlannedEndDate.Should().Be(earningEventModel.PriceEpisodes[0].PlannedEndDate);
            act1EarningEvent.PriceEpisodes[0].ActualEndDate.Should().Be(earningEventModel.PriceEpisodes[0].ActualEndDate);
            act1EarningEvent.PriceEpisodes[0].NumberOfInstalments.Should().Be(earningEventModel.PriceEpisodes[0].NumberOfInstalments);
            act1EarningEvent.PriceEpisodes[0].InstalmentAmount.Should().Be(earningEventModel.PriceEpisodes[0].InstalmentAmount);
            act1EarningEvent.PriceEpisodes[0].CompletionAmount.Should().Be(earningEventModel.PriceEpisodes[0].CompletionAmount);
            act1EarningEvent.PriceEpisodes[0].Completed.Should().Be(earningEventModel.PriceEpisodes[0].Completed);
            act1EarningEvent.PriceEpisodes[0].EmployerContribution.Should().Be(earningEventModel.PriceEpisodes[0].EmployerContribution);
            act1EarningEvent.PriceEpisodes[0].CompletionHoldBackExemptionCode.Should().Be(earningEventModel.PriceEpisodes[0].CompletionHoldBackExemptionCode);

            act1EarningEvent.Learner.Uln.Should().Be(earningEventModel.LearnerUln);
            act1EarningEvent.Learner.ReferenceNumber.Should().Be(earningEventModel.LearnerReferenceNumber);

            act1EarningEvent.LearningAim.Reference.Should().Be(earningEventModel.LearningAimReference);
            act1EarningEvent.LearningAim.ProgrammeType.Should().Be(earningEventModel.LearningAimProgrammeType);
            act1EarningEvent.LearningAim.StandardCode.Should().Be(earningEventModel.LearningAimStandardCode);
            act1EarningEvent.LearningAim.FrameworkCode.Should().Be(earningEventModel.LearningAimFrameworkCode);
            act1EarningEvent.LearningAim.PathwayCode.Should().Be(earningEventModel.LearningAimPathwayCode);
            act1EarningEvent.LearningAim.FundingLineType.Should().Be(earningEventModel.LearningAimFundingLineType);
            act1EarningEvent.LearningAim.SequenceNumber.Should().Be(earningEventModel.LearningAimSequenceNumber);
        }