Beispiel #1
0
        public CommitmentModel MapToCommitment(PaymentCreatedMessage paymentCreatedMessage)
        {
            var model = new CommitmentModel
            {
                EmployerAccountId        = paymentCreatedMessage.EmployerAccountId,
                ApprenticeshipId         = paymentCreatedMessage.ApprenticeshipId,
                LearnerId                = paymentCreatedMessage.Uln,
                StartDate                = paymentCreatedMessage.EarningDetails.StartDate,
                PlannedEndDate           = paymentCreatedMessage.EarningDetails.PlannedEndDate,
                ActualEndDate            = null,
                CompletionAmount         = paymentCreatedMessage.EarningDetails.CompletionAmount,
                MonthlyInstallment       = paymentCreatedMessage.EarningDetails.MonthlyInstallment,
                NumberOfInstallments     = (short)paymentCreatedMessage.EarningDetails.TotalInstallments,
                ProviderId               = paymentCreatedMessage.Ukprn,
                ProviderName             = paymentCreatedMessage.ProviderName,
                ApprenticeName           = paymentCreatedMessage.ApprenticeName,
                CourseName               = paymentCreatedMessage.CourseName,
                CourseLevel              = paymentCreatedMessage.CourseLevel,
                SendingEmployerAccountId = paymentCreatedMessage.SendingEmployerAccountId,
                FundingSource            = FundingSourceConverter.ConvertToPaymentsFundingSource(paymentCreatedMessage.FundingSource),
                HasHadPayment            = true,
                UpdatedDateTime          = DateTime.UtcNow
            };

            return(model);
        }
Beispiel #2
0
        public PaymentModel MapToPayment(PaymentCreatedMessage paymentCreatedMessage)
        {
            return(new PaymentModel
            {
                ExternalPaymentId = paymentCreatedMessage.Id,
                EmployerAccountId = paymentCreatedMessage.EmployerAccountId,
                SendingEmployerAccountId = paymentCreatedMessage.SendingEmployerAccountId,
                ProviderId = paymentCreatedMessage.Ukprn,
                LearnerId = paymentCreatedMessage.Uln,
                Amount = paymentCreatedMessage.Amount,
                CollectionPeriod = new Models.Payments.CalendarPeriod
                {
//					Id = paymentCreatedMessage.CollectionPeriod.Id,
                    Month = paymentCreatedMessage.CollectionPeriod.Month,
                    Year = paymentCreatedMessage.CollectionPeriod.Year
                },
                DeliveryPeriod = new Models.Payments.CalendarPeriod
                {
                    Month = paymentCreatedMessage.DeliveryPeriod.Month,
                    Year = paymentCreatedMessage.DeliveryPeriod.Year
                },
                ApprenticeshipId = paymentCreatedMessage.ApprenticeshipId,
                ReceivedTime = DateTime.UtcNow,
                FundingSource = FundingSourceConverter.ConvertToPaymentsFundingSource(paymentCreatedMessage.FundingSource)
            });
        }