public DebtDetailResponse ToDebtDetail(DynamicsGatewayOptions options) { return(new DebtDetailResponse { Id = Id, Amount = decimal.Parse(Amount), Reference = CreditorExternalReference, DebtTypeName = Type, NINO = NationalInsuranceNumber, CreatedOn = CreatedOn.ToDateTimeOffset(), ModifiedOn = ModifiedOn.ToDateTimeOffset(), Status = options.DebtStatus[StatusId.ToString()], SoldToCreditorName = ProposedCreditor?.Name, SoldToCreditorId = ProposedCreditor?.Id, PreviouslySold = PreviouslySold, CreditorName = Creditor.Name, CreditorId = Creditor.Id, StartsOn = CommencementDate?.ToDateTimeOffset(), EndsOn = ExpiryDate?.ToDateTimeOffset(), RemovedOn = RemovalDate?.ToDateTimeOffset(), DebtTypeId = TypeId, DebtEligibilityReview = DebtEligibilityReview != null ? DebtEligibilityReview.ToDebtEligibilityReview(options) : null, DebtRemovalReason = DebtRemovalReasonId.HasValue ? options.DebtRemovalReason.First(r => r.Value == DebtRemovalReasonId.ToString()).Key : (DebtRemovalReason?)null }); }