Esempio n. 1
0
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()