An example package
Project description
Introduction:
The banking633
system is divided into 2 subpackage Admin
with modules view
, action
, card
and User
with modules account
, transaction
.
main
is the main menu, data.json
is for storing all action data though store
.
Running the Application
Execution: The application can be started by running main import banking633
and import banking633.main
directly, then select role depending on the desired mode (admin or user).
We general "account: 1, password: 1" for admin, user should have account created at the first time.
MainView Class
Purpose: Serves as the entry point for the application, allowing users to choose between admin and user modes. Methods: run_admin: Executes the admin view. run_user: Executes the user view. choice_user_type: Displays welcome message and lets users choose their role (admin or user).
Admin
Store Class
Purpose: Handles data storage and retrieval. Attributes: data_file_path (path to the data file), users (dictionary of users). Methods: save_all_data: Saves all user data to a file. read_users_from_file: Reads users from a file and converts them to User objects.
action Class
Purpose: Handles user actions such as creating or removing users. Methods: createUser: Registers a new user after validating inputs. randomCardId: Generates a unique card ID. killUser: Deletes a user based on card number after validation. checkPasswd: Validates a password.
Card Class
Purpose: Represents a bank card. Attributes: cardId, cardPasswd, cardMoney, cardLock. Method: to_dict: Converts card attributes to a dictionary.
User Class
-Purpose: Represents a user. Attributes: name, idCard, phone, card. Method: to_dict: Converts user attributes to a dictionary.
AdminView Class (Inherits from Store)
Purpose: Provides the admin interface for managing users. Methods: quit: Saves data and exits. login: Handles admin login. admin_view: Displays admin options and handles user interactions.
User
UserView Class (Inherits from Store)
Purpose: Provides the user interface for banking transactions. Methods: menu: Displays the user menu. user_view: Handles user interactions based on menu choices. quit: Saves data and exits.
transaction Class
Purpose: Handles banking transactions like balance check, withdrawal, deposit, and transfer. Methods: balance: Displays the user's current balance. withdraw: Processes a withdrawal after validation. deposit: Processes a deposit. transfer: Handles fund transfers between accounts. checkPasswd: Validates the password with a maximum of three attempts.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for banking633-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e83a59eb951e92ccc1a8cb29259e2990ed07701f4c4138ef60f434d5e2bcf7e5 |
|
MD5 | 51e6394219a21585d4cbcf963707c33b |
|
BLAKE2b-256 | 8db37b71cccc62b22756a60e6e9d2837ab9d3a3754fc0040b8e49bb402323426 |