Beispiel #1
0
def switch(x):
    cli = Client()
    prod = Product()
    serv = Service()
    dict_options = {
        1: cli.add_client,
        2: prod.add_product,
        3: serv.add_service
    }
    dict_options[x]()
Beispiel #2
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()
Beispiel #3
0
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()