def applyForCreditCard(user_dict): # create a service object from user_dict and add it to the requests database request = Service(user_dict["customer"].customer_id, user_dict["customer"].name, user_dict["savings"].balance, user_dict["customer"].creditScore, "CreditCard") # approve or decline based on if they have credit score over 600 decision = request.approve_or_decline_creditCard() # if approved add to serviceHistory if decision == True: request.write_service_to_history() # if declined add it to the request db else: request.write_request_to_db()
def applyForLoan(user_dict): # create a service object from user_dict request = Service(user_dict["customer"].customer_id, user_dict["customer"].name, user_dict["savings"].balance, user_dict["customer"].creditScore, "Loan") # approve or decline based on if they have over 50,000 in savings decision = request.approve_or_decline_loan() # if approved add to serviceHistory if decision == True: request.write_service_to_history() # if declined add it to the requests database else: request.write_request_to_db()