예제 #1
0
 private IncentiveApplication(Guid id, IncentiveApplicationModel model, bool isNew = false) : base(id, model, isNew)
 {
     foreach (var apprenticeshipModel in model.ApprenticeshipModels.ToList())
     {
         _apprenticeships.Add(Apprenticeship.Create(apprenticeshipModel));
     }
 }
예제 #2
0
        private void AddApprenticeship(Apprenticeship apprenticeship)
        {
            var endOfStartMonth = new DateTime(apprenticeship.PlannedStartDate.Year, apprenticeship.PlannedStartDate.Month, DateTime.DaysInMonth(apprenticeship.PlannedStartDate.Year, apprenticeship.PlannedStartDate.Month));

            apprenticeship.SetPlannedStartDate(endOfStartMonth);
            _apprenticeships.Add(apprenticeship);
            Model.ApprenticeshipModels.Add(apprenticeship.GetModel());
        }
        private static List <Apprenticeship> Map(ICollection <ApprenticeshipModel> apprenticeshipModels)
        {
            var apprenticeships = new List <Apprenticeship>();

            foreach (var apprenticeshipModel in apprenticeshipModels.ToList())
            {
                apprenticeships.Add(Apprenticeship.Create(apprenticeshipModel));
            }

            return(apprenticeships);
        }
예제 #4
0
        public void ComplianceWithdrawal(Apprenticeship apprenticeship, ServiceRequest serviceRequest)
        {
            var apprenticeToWithdraw = _apprenticeships.Single(m => m.Id == apprenticeship.Id);

            apprenticeToWithdraw.Withdraw(IncentiveApplicationStatus.ComplianceWithdrawn);

            AddEvent(new ComplianceWithdrawn(
                         Model.AccountId,
                         Model.AccountLegalEntityId,
                         apprenticeToWithdraw.GetModel(),
                         serviceRequest));
        }