Beispiel #1
0
 def __find_monthly_payment(self, loan: Loan, monthly_saving):
     tax = self.__get_tax_percentages(loan.person_score)
     desired_terms_payment = self.__calculate_pmt(loan.amount, loan.terms,
                                                  tax[str(loan.terms)])
     if desired_terms_payment > monthly_saving:
         del tax[str(loan.terms)]
         for key in tax:
             terms = int(key)
             other_term_payment = self.__calculate_pmt(
                 loan.amount, terms, tax[key])
             if other_term_payment < monthly_saving:
                 loan.terms = terms
                 return
         raise PolicyException('commitment')
Beispiel #2
0
 def __deny_loan(self, loan: Loan, policy):
     loan.refused_policy = policy
     loan.terms = None
     loan.result = 'refused'
     loan.status = 'completed'
     loan.amount = None