Welcome to the payments team. The bank in bank/ handles accounts, payments, the top spenders ranking and transfers that wait to be accepted (levels 1 to 3), and its tests pass. Support needs to merge duplicate accounts.…
Welcome to the payments team. The bank in bank/ handles accounts, payments, the top spenders ranking and transfers that wait to be accepted (levels 1 to 3), and its tests pass. Support needs to merge duplicate accounts. The method is stubbed in bank/bank_system.py, and the rules for level 4 are in README.md.
Build level 4 in 35 minutes. The checks are graded one by one, so each part you get working counts even if the rest is not done.
merge_accounts(timestamp, account_id_1, account_id_2) returns False when either account is unknown or both ids are the same.account_id_1 gains the balance and the paid-out total of account_id_2, and account_id_2 is closed: every call treats it as unknown.account_id_2 now come from account_id_1, and pending transfers sent to account_id_2 now go to account_id_1. Accepting, cancelling and expiry all follow.create_account, as a new, empty account with no claim on anything from before.pytest tests/visible. tests/visible/test_level4.py fails until level 4 works.Visible test command
pytest tests/visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
bank-system-merge-accounts
Changes under src/ are evaluated.