Beispiel #1
0
        public void Reject(Operator decisionBy)
        {
            if (Status != LoanApplicationStatus.New)
            {
                throw new ApplicationException("Cannot reject application that is already accepted or rejected");
            }

            Status   = LoanApplicationStatus.Rejected;
            Decision = new Decision(SysTime.Now(), decisionBy);
        }
Beispiel #2
0
        public void Accept(Operator decisionBy)
        {
            if (Status != LoanApplicationStatus.New)
            {
                throw new ApplicationException("Cannot accept application that is already accepted or rejected");
            }

            if (Score == null)
            {
                throw new ApplicationException("Cannot accept application before scoring");
            }

            if (!decisionBy.CanAccept(this.Loan.LoanAmount))
            {
                throw new ApplicationException("Operator does not have required competence level to accept application");
            }

            Status   = LoanApplicationStatus.Accepted;
            Decision = new Decision(SysTime.Now(), decisionBy);
        }
Beispiel #3
0
 public LoanApplication(string number, Customer customer, Property property, Loan loan, Operator registeredBy)
     : this(number, LoanApplicationStatus.New, customer, property, loan, null, new Registration(SysTime.Now(), registeredBy), null)
 {
 }
Beispiel #4
0
 public DateTime LastInstallmentsDate()
 {
     return(SysTime.Now().AddYears(LoanNumberOfYears));
 }