public ClientNamesSummaryViewModel(DebtorDetailsResponse debtorDetails)
        {
            CurrentName.FirstName  = debtorDetails.FirstName;
            CurrentName.MiddleName = debtorDetails.MiddleName;
            CurrentName.LastName   = debtorDetails.LastName;
            CurrentNameDisplay     = CurrentName.GetFullName();

            if (debtorDetails.PreviousNames != null && debtorDetails.PreviousNames.Any())
            {
                PreviousNames = debtorDetails.PreviousNames.Select(x => new ClientName
                {
                    FirstName  = x.FirstName,
                    MiddleName = x.MiddleName,
                    LastName   = x.LastName,
                    NameId     = x.Id
                });

                PreviousNamesDisplay = PreviousNames.Select(x => x.GetFullName());
            }
        }
Esempio n. 2
0
 public DebtorPersonalDetailViewModel(DebtorDetailsResponse debtorDetails)
 {
     FirstName     = debtorDetails.FirstName;
     MiddleName    = debtorDetails.MiddleName;
     Surname       = debtorDetails.LastName;
     PreviousNames = debtorDetails.PreviousNames?.Select(x => new ClientName
     {
         NameId     = x.Id,
         FirstName  = x.FirstName,
         MiddleName = x.MiddleName,
         LastName   = x.LastName
     });
     DateOfBirth = debtorDetails?.DateOfBirth ?? default;
     IsInMentalHealthMoratorium = debtorDetails.IsInMentalHealthMoratorium ?? false;
     ActiveMoratoriumEndDate    = debtorDetails.MoratoriumStatus == Insolvency.Common.Enums.MoratoriumStatus.Cancelled ? debtorDetails.CancellationDate : debtorDetails.EndsOn;
     ActiveMoratoriumStartDate  = debtorDetails.StartsOn;
     MoratoriumStatus           = SetMoratoriumStatus(debtorDetails.MoratoriumStatus);
     IsActive           = debtorDetails.MoratoriumStatus == Insolvency.Common.Enums.MoratoriumStatus.Active;
     IsEnded            = debtorDetails.MoratoriumStatus == Insolvency.Common.Enums.MoratoriumStatus.Cancelled || debtorDetails.MoratoriumStatus == Insolvency.Common.Enums.MoratoriumStatus.Expired;
     ReferenceNumber    = debtorDetails.ReferenceNumber;
     DisplayExpiryDate  = IsActive && debtorDetails.EndsOn.HasValue;
     CancellationReason = debtorDetails.CancellationReason;
 }
 public DebtorNotificationPartialViewModel(DebtorDetailsResponse model)
 {
     PreferenceType      = model.ContactPreference;
     PreferenceTypeLabel = model.ContactPreferenceLabel;
     EmailAddress        = model.NotificationEmailAddress;
 }