public DebtorAccountSummaryViewModel(BreathingSpaceResponse accountSummary)
        {
            if (accountSummary is null)
            {
                throw new ArgumentNullException(nameof(accountSummary));
            }

            DebtorDetail = new DebtorDetailViewModel(accountSummary);
            DebtDetails  = accountSummary.DebtDetails?
                           .Select(d => new DebtDetailViewModel(
                                       d, accountSummary.DebtorEligibilityReviews
                                       .FirstOrDefault(r => r.CreditorId == d.CreditorId)))
                           .ToList();
            MoneyAdviceOrganisation = new MoneyAdviceOrganisationViewModel(accountSummary.MoneyAdviserOrganization);
            DebtorTransfer          = accountSummary.DebtorTransfer is null ? null:
                                      new DebtorTransferViewModel(DebtorDetail.PersonalDetail, MoneyAdviceOrganisation, accountSummary.DebtorTransfer);
        }
예제 #2
0
        public DebtorTransferViewModel(DebtorPersonalDetailViewModel personalDetail,
                                       MoneyAdviceOrganisationViewModel moneyAdviceOrganisation,
                                       DebtorTransferResponse debtorTransfer)
        {
            if (debtorTransfer is null)
            {
                return;
            }

            Reference  = personalDetail.ReferenceNumber;
            FirstName  = personalDetail.FirstName;
            MiddleName = personalDetail.MiddleName;
            LastName   = personalDetail.Surname;
            ActiveMoratoriumStartDate = personalDetail.ActiveMoratoriumStartDate;
            ActiveMoratoriumEndDate   = personalDetail.ActiveMoratoriumEndDate;
            MoneyAdviceOrganisation   = moneyAdviceOrganisation;
            TransferReason            = debtorTransfer.ReasonForTransfer;
            RequestedOn = debtorTransfer.RequestedOn;
            RequestingMoneyAdviceOrganisation = debtorTransfer.RequestingOrganisation;
            TransferredOn = debtorTransfer.TransferredOn;
            TransferringMoneyAdviserOrganisation = debtorTransfer.TransferringOrganistion;
            Status = debtorTransfer.Status;
        }