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); }
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); }
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) { }
public DateTime LastInstallmentsDate() { return(SysTime.Now().AddYears(LoanNumberOfYears)); }