public DebtDetailViewModel(DebtDetailResponse debtDetail, DebtorEligibilityReviewResponse debtorEligibilityView) { Debt = new DebtViewModel { Id = debtDetail.Id, DebtAmount = debtDetail.Amount?.ToString(Constants.TwoDecimalPointFormat), Reference = debtDetail.Reference, NINO = debtDetail.NINO, SelectedDebtTypeName = debtDetail.DebtTypeName, CreatedOn = debtDetail.CreatedOn.Value, CommencementDate = debtDetail.StartsOn, RemovedOn = debtDetail.RemovedOn, Status = debtDetail.Status, PreviouslySold = debtDetail.PreviouslySold, SoldToCreditorId = debtDetail.SoldToCreditorId, SoldToCreditorName = debtDetail.SoldToCreditorName, RemovalReason = debtDetail.DebtRemovalReason }; Creditor = new CreditorResponse { Name = debtDetail.CreditorName, Id = debtDetail.CreditorId.Value }; DebtEligibilityReview = debtDetail.DebtEligibilityReview != null ? new DebtEligibilityReviewViewModel(debtDetail.DebtEligibilityReview) : null; DebtorClientEligibilityReview = debtorEligibilityView != null ? new DebtorEligibilityReviewViewModel(debtorEligibilityView) : null; }
public CreditorDebtPartialViewModel( DebtDetailResponse debt, DateTimeOffset?breathingSpaceEndDate = null, bool isInMentalHealthBreathingSpace = false) { Id = debt.Id; Status = debt.Status; Amount = debt.Amount?.ToString("0.##"); Reference = debt.Reference; NINO = debt.NINO; Type = debt.DebtTypeName; StartsOn = debt.CreatedOn; EndsOn = debt.EndsOn; BreathingSpaceEndDate = breathingSpaceEndDate; IsInMentalHealthBreathingSpace = isInMentalHealthBreathingSpace; CreditorId = debt.CreditorId; SoldToCreditorId = debt.SoldToCreditorId; PreviouslySold = PreviouslySold; }