Example #1
0
        public Case(CaseStateHistory history,
                    Origination origination,
                    Account account,
                    KeyFactsIllustration kfi,
                    PropertyVisit visit,
                    AddressSelection address) : this(history, origination, account, kfi)
        {
            ValuationDate = visit?.DateOfSurvey;

            PoR = BuildPoRLabel(address);

            FullAddress = BuildAddressLabel(address);

            PostCode = address?.PostCode;
        }
Example #2
0
        public Case(CaseStateHistory history, Origination origination, Account account, KeyFactsIllustration kfi)
        {
            if (origination != null)
            {
                CustomerId              = origination.CustomerNumber;
                KfiId                   = origination.KfiId;
                ApplicationNumber       = origination.ApplicationNumber;
                CreatedDate             = PhoebusMinDateToNull(origination.DateKfiCreated);
                DeclinedDate            = origination.PrimaryStatusChar == OriginationStatus.Rejected ? PhoebusMinDateToNull(origination.StatusChangeDate) : null;
                OfferDate               = PhoebusMinDateToNull(origination.OfferDate);
                SubmittedDate           = PhoebusMinDateToNull(origination.DateApplicationReceived);
                WithdrawnDate           = origination.PrimaryStatusChar == OriginationStatus.Withdrawn ? PhoebusMinDateToNull(origination.StatusChangeDate) : null;
                OfferNumber             = origination.OfferNumber;
                PrimaryStatus           = origination.PrimaryStatus;
                DateApplicationReceived = origination.DateApplicationReceived;
            }

            if (origination != null && account != null)
            {
                CompletionDate = origination.PrimaryStatusChar == OriginationStatus.Complete ? PhoebusMinDateToNull(account.CompletionDate) : null;
            }

            if (kfi != null)
            {
                CustomerSurname    = kfi.Customer1Surname;
                KfiId              = kfi.KfiId;
                ExpiredDate        = PhoebusMinDateToNull(kfi.ExpiryDate);
                KfiDate            = PhoebusMinDateToNull(kfi.KfiDate);
                PackagerMortgageId = kfi.PackagerMortgageId;
                KfiType            = kfi.KfiType;
                Division           = kfi.Division;

                if (origination == null && account == null)
                {
                    ClientOne = new Person {
                        DateOfBirth = kfi.Customer1DateOfBirth
                    };
                    ClientTwo = new Person {
                        DateOfBirth = kfi.Customer2DateOfBirth
                    };

                    ClientOneContact = new Contact {
                        Title = kfi.Customer1Title, Forename = kfi.Customer1Forename, Surname = kfi.Customer1Surname
                    };
                    ClientTwoContact = new Contact {
                        Title = kfi.Customer2Title, Forename = kfi.Customer2Forename, Surname = kfi.Customer2Surname
                    };

                    KfiOnly = true;
                }
            }

            if (history != null)
            {
                KfiId     = history.KfiId;
                StateId   = history.CaseStateId;
                CaseState = history.CaseState;
            }
        }