Ejemplo n.º 1
0
        internal static List <LearnerResults> SubmitIlrAndRunMonthEndAndCollateResults(List <IlrLearnerReferenceData> ilrLearnerDetails,
                                                                                       DateTime?firstSubmissionDate,
                                                                                       LookupContext lookupContext,
                                                                                       List <EmployerAccountReferenceData> employers,
                                                                                       List <ContractTypeReferenceData> contractTypes,
                                                                                       List <EmploymentStatusReferenceData> employmentStatus,
                                                                                       List <LearningSupportReferenceData> learningSupportStatus,
                                                                                       string[] periodsToSubmitTo = null)
        {
            var results = new List <LearnerResults>();

            if (TestEnvironment.ValidateSpecsOnly)
            {
                return(results);
            }


            var periods          = periodsToSubmitTo ?? ExtractPeriods(ilrLearnerDetails, firstSubmissionDate);
            var providerLearners = GroupLearnersByProvider(ilrLearnerDetails, lookupContext);

            foreach (var period in periods)
            {
                SetEnvironmentToPeriod(period);
                EmployerAccountManager.UpdateAccountBalancesForPeriod(employers, period);

                foreach (var providerDetails in providerLearners)
                {
                    SetupDisadvantagedPostcodeUplift(providerDetails);
                    BuildAndSubmitIlr(providerDetails, period, lookupContext, contractTypes, employmentStatus, learningSupportStatus);
                }
                RunMonthEnd(period);

                EarningsCollector.CollectForPeriod(period, results, lookupContext);
                LevyAccountBalanceCollector.CollectForPeriod(period, results, lookupContext);
                SubmissionDataLockResultCollector.CollectForPeriod(period, results, lookupContext);

                SavedDataCollector.CaptureAccountsDataForScenario();
                SavedDataCollector.CaptureCommitmentsDataForScenario();
            }
            DataLockEventsDataCollector.CollectDataLockEventsForAllPeriods(results, lookupContext);
            PaymentsDataCollector.CollectForPeriod(results, lookupContext);

            return(results);
        }
Ejemplo n.º 2
0
 public static void CaptureDetailsForScenario()
 {
     SavedDataCollector.CaptureEventsDataForScenario();
     SavedDataCollector.CapturePaymentsDataForScenario();
 }