<jupyter_start><jupyter_text>Project  Project Description This project is used to create virtual bank objects that contain various type of accounts (checking, savings, credit), and simulate behavior across these objects (transactions, transfer, autopay) Users of this program proceed by creating Banks objects, then customer Accounts in banks, and then associated DetailAccount with each customer Account. After creating all these objects, users should feel free to use methods implemented in each of these objects since each of them are fairly equivalent and capable of achieving same purpose. Methods that are implemented for the Bank objects include:    1. Print bank info    2. Summarize bank account balances    3. Open new customer account    4. Adding multiple detail accounts    5. Adding checking, savings, credit account    6. Adding transactions to specific account    7. Intra Bank Transfer    8. Inter Bank Transfer  Methods that are implemented for Account objects include:    1. Print customer account info    2. Summarize associated bank accounts balances    3. Add transaction to a assocated detail account    4. Retreive detail account Methods that are implemented for any DetailAccount objects include:    1. Adding transaction to its ledger    2. Transfer to account (same owner, different owner, different bank)    3. Pay off credit account    4. Summarize balance    5. Printing out list of transactions This project is available on Github under user dflin96. The link to the repository is https://github.com/dflin96/COGS18-Python-Project<jupyter_code>from my_module.classes import *<jupyter_output><empty_output><jupyter_text>Project Code Following is a sample rundown or example of usage of the code. Note that none of the entities created are actual information or scenarios of real life entities. Any equivalent information are simply coincidence.<jupyter_code>wells_fargo_bank = Bank("<NAME>", "3810 Nobel Dr", "08:00", "18:00")
wells_fargo_bank.print_bank_info()<jupyter_output><empty_output><jupyter_text>In the case that users enter faulty input:<jupyter_code>tom_account = wells_fargo_bank.open_accounts("Tom", ["Whatever account"], [-1000])
wells_fargo_bank.accounts<jupyter_output><empty_output><jupyter_text>Unable to recognize the parameter entered, so no action is performed<jupyter_code>wells_fargo_bank.all_detail_accounts
wells_fargo_bank.add_checking_account(tom_account, -10)
tom_checking_account = wells_fargo_bank.get_detail_account_of_type("CHECKING", tom_account)<jupyter_output><empty_output><jupyter_text>DetailAccount are still created with default parameters<jupyter_code>print(tom_checking_account)
print(tom_checking_account.balance)
tom_account.detail_accounts
wells_fargo_bank.all_detail_accounts<jupyter_output><empty_output><jupyter_text>In the cases that the program is provided with valid parameters<jupyter_code>wells_fargo_bank.add_savings_account(tom_account, 300)
wells_fargo_bank.add_credit_account(tom_account, 1000)
wells_fargo_bank.add_credit_account(tom_account, 500)<jupyter_output><empty_output><jupyter_text>Everything would look safe and sound<jupyter_code>tom_account.summarize_account_balance()
tom_savings_account = tom_account.get_detail_account_of_type("Savings")
tom_savings_account.print_statement()
Transaction.used_transaction_id<jupyter_output><empty_output><jupyter_text>Time to make more banks and accounts!<jupyter_code>bank_of_america = Bank("America", "Chicago", "09:00", "20:00")
# Attempting to make multiple checking accounts since he's rich
trump_account = bank_of_america.open_accounts("Trump", 
                                              ["checking", "Checking", "SaVings", "CREDIT"],
                                              [10000, 518100, 999999])<jupyter_output><empty_output><jupyter_text>Unfortunately, one customer can only have one CheckingAccount and SavingsAccount, and I hope one create some CreditAccount for at least some credit limit<jupyter_code>trump_account.summarize_account_balance()
trump_savings_account = trump_account.get_detail_account_of_type("savings")
trump_checking_account = trump_account.get_detail_account_of_type("checking")
trump_checking_account.print_statement()
trump_savings_account.print_statement()<jupyter_output><empty_output><jupyter_text>Banks knows everything<jupyter_code>bank_of_america.processed_transaction_id<jupyter_output><empty_output><jupyter_text>And more accounts with nice parameters given<jupyter_code>daril_account = wells_fargo_bank.open_accounts("Daril", ["checking", "SAVINGS", "Credit"], [500, 1000, 200])
daril_checking_account = daril_account.get_detail_account_of_type("checking")
daril_savings_account = daril_account.get_detail_account_of_type("savings")
daril_checking_account.print_statement()
daril_savings_account.print_statement()
wells_fargo_bank.processed_transaction_id<jupyter_output><empty_output><jupyter_text>The main function for banks are to create transactions, transfer money, and pay people<jupyter_code>daril_checking_account.add_transaction(Transaction(date(2018, 12, 28), "Christmas gift", -300))
daril_account.summarize_account_balance()
daril_checking_account.add_transaction(Transaction(date(2018, 12, 30), "More gifts", -1000))<jupyter_output><empty_output><jupyter_text>But too bad you need to have enough money to afford more stuff<jupyter_code>daril_checking_account.print_statement()<jupyter_output><empty_output><jupyter_text>Time to transfer in more money<jupyter_code>daril_savings_account.transfer_to_account(daril_checking_account, 
                                          Transaction(date(2018, 12, 29), "Enough to buy gifts", -900))
daril_account.summarize_account_balance()
daril_checking_account.print_statement()
daril_savings_account.print_statement()<jupyter_output><empty_output><jupyter_text>Here we go again buying but with enough money<jupyter_code>daril_checking_account.add_transaction(Transaction(date(2018, 12, 30), "More gifts", -1000))
daril_account.summarize_account_balance()
daril_checking_account.print_statement()
daril_credit_account = daril_account.get_detail_account_of_type("credit")<jupyter_output><empty_output><jupyter_text>Time to put the credit card to use to not pay right away<jupyter_code>daril_credit_account.add_transaction(Transaction(date(2018, 1, 1), "Pay off rent", 200))
daril_account.summarize_account_balance()<jupyter_output><empty_output><jupyter_text>But still need to pay those credits off at some point<jupyter_code>wells_fargo_bank.transfer_to_account(daril_checking_account, daril_credit_account, 
                                     date(2018, 1, 3), "Paying off credits", 100)
daril_account.summarize_account_balance()
wells_fargo_bank.transfer_to_account(daril_savings_account, daril_credit_account, 
                                     date(2018, 1, 3), "Paying off credits", 100)
daril_account.summarize_account_balance()
trump_account.summarize_account_balance()<jupyter_output><empty_output><jupyter_text>Maybe a good samaritan will help you out from somewhere else too.<jupyter_code>trump_checking_account.transfer_to_account(daril_checking_account,
                                          Transaction(date(2018, 1, 15), "Free Money", -2000))
trump_account.summarize_account_balance()
daril_account.summarize_account_balance()<jupyter_output><empty_output><jupyter_text>Finally, it is always good to make sure that transactions are valid, and accounts are real<jupyter_code>fake_transaction = Transaction(date(1991, 10, 1), "This is fake", 1000)
fake_transaction in wells_fargo_bank.processed_transaction_id
fake_transaction in bank_of_america.processed_transaction_id
basic_fake_customer_account = Account("Fake person", 12345678)
is_real_account_in_bank(basic_fake_customer_account)
mediocre_fake_customer_account = Account("Avg Fake", 15910, wells_fargo_bank)
is_real_account_in_bank(mediocre_fake_customer_account)
professional_fake_customer_account = Account("Pro Fake", 61942, 
                                             Bank("Fake name", "Fake address", "08:00", "16:00"))
is_real_account_in_bank(professional_fake_customer_account)<jupyter_output><empty_output><jupyter_text>Similar goes to DetailAccounts, which should be real<jupyter_code>Transaction.used_transaction_id
basic_fake_checking_account = CheckingAccount(basic_fake_customer_account, 100)
Transaction.used_transaction_id
is_real_account_in_bank(basic_fake_checking_account)
mediocre_fake_savings_account = SavingsAccount(mediocre_fake_customer_account, 10000,
                                               mediocre_fake_customer_account._bank)
Transaction.used_transaction_id
is_real_account_in_bank(mediocre_fake_savings_account)<jupyter_output><empty_output>