public async Task GivenTheRemainingTransferAllowanceForIs(string employerIdentifier, decimal remainingTransferAllowance) { var employer = TestSession.GetEmployer(employerIdentifier); employer.TransferAllowance = remainingTransferAllowance; await SaveLevyAccount(employer).ConfigureAwait(false); }
public async Task GivenTheIsLevyPayerFlagIsFalse(string employerIdentifier, bool isLevyFlag) { var employer = TestSession.GetEmployer(employerIdentifier); employer.IsLevyPayer = isLevyFlag; await SaveLevyAccount(employer).ConfigureAwait(false); }
public async Task GivenTheSpecificEmployerLevyAccountBalanceInCollectionPeriodIs(string employerIdentifier, string collectionPeriodText, decimal levyAmount) { var employer = TestSession.GetEmployer(employerIdentifier); employer.Balance = levyAmount; employer.IsLevyPayer = true; await SaveLevyAccount(employer).ConfigureAwait(false); SetCollectionPeriod(collectionPeriodText); }
public static ApprenticeshipModel CreateApprenticeshipModel(Apprenticeship apprenticeshipSpec, TestSession testSession) { if (apprenticeshipSpec.ApprenticeshipId == default(long)) { apprenticeshipSpec.ApprenticeshipId = testSession.GenerateId(); } if (apprenticeshipSpec.Ukprn == default(long)) { if (string.IsNullOrWhiteSpace(apprenticeshipSpec.Provider)) { apprenticeshipSpec.Ukprn = testSession.Ukprn; } else { apprenticeshipSpec.Ukprn = testSession.GetProviderByIdentifier(apprenticeshipSpec.Provider).Ukprn; } } var employer = testSession.GetEmployer(apprenticeshipSpec.Employer); if (apprenticeshipSpec.AccountId == default(long)) { apprenticeshipSpec.AccountId = employer.AccountId; } if (!string.IsNullOrEmpty(apprenticeshipSpec.SendingEmployer) && !apprenticeshipSpec.SenderAccountId.HasValue) { apprenticeshipSpec.SenderAccountId = testSession.GetEmployer(apprenticeshipSpec.SendingEmployer).AccountId; } if (apprenticeshipSpec.Uln == default(long)) { var learnerId = string.IsNullOrWhiteSpace(apprenticeshipSpec.Identifier) ? testSession.Learner.LearnerIdentifier : apprenticeshipSpec.LearnerId; apprenticeshipSpec.Uln = testSession.GetLearner(apprenticeshipSpec.Ukprn, learnerId).Uln; } var apprenticeshipModel = new ApprenticeshipModel { Id = apprenticeshipSpec.ApprenticeshipId, Ukprn = apprenticeshipSpec.Ukprn, AccountId = apprenticeshipSpec.AccountId, TransferSendingEmployerAccountId = apprenticeshipSpec.SenderAccountId, Uln = apprenticeshipSpec.Uln, FrameworkCode = apprenticeshipSpec.FrameworkCode ?? 0, //TODO change when app bug is fixed ProgrammeType = apprenticeshipSpec.ProgrammeType ?? 0, PathwayCode = apprenticeshipSpec.PathwayCode ?? 0, StandardCode = apprenticeshipSpec.StandardCode ?? 0, Priority = apprenticeshipSpec.Priority, Status = apprenticeshipSpec.Status.ToApprenticeshipPaymentStatus(), LegalEntityName = "Test SFA", EstimatedStartDate = apprenticeshipSpec.StartDate.ToDate(), EstimatedEndDate = apprenticeshipSpec.EndDate.ToDate(), AgreedOnDate = string.IsNullOrWhiteSpace(apprenticeshipSpec.AgreedOnDate) ? DateTime.UtcNow : apprenticeshipSpec.AgreedOnDate.ToDate(), StopDate = string.IsNullOrWhiteSpace(apprenticeshipSpec.StopEffectiveFrom) ? default(DateTime?) : apprenticeshipSpec.StopEffectiveFrom.ToDate(), IsLevyPayer = employer.IsLevyPayer, ApprenticeshipEmployerType = GetApprenticeshipEmployerType(apprenticeshipSpec.EmployerType) }; return(apprenticeshipModel); }