Public Member Functions | |
get_date (cls, prompt, allow_default=False) | |
get_amount (cls) | |
get_category (cls) | |
Static Public Member Functions | |
get_transaction_id () | |
get_description () | |
Static Public Attributes | |
str | DATE_FORMAT = "%m-%d-%Y" |
dict | CATEGORIES |
Manages user entry for transactions, including date, amount, category, and description. Attributes: DATE_FORMAT (str): The format used for parsing and displaying dates. CATEGORIES (dict): Mapping of input to transaction categories ('I' for Income, 'E' for Expense).
user_entry_manager.UserEntryManager.get_amount | ( | cls | ) |
Prompts the user to input a valid amount for the transaction. Returns: float: A valid transaction amount entered by the user. Raises: ValueError: If the entered amount is less than or equal to zero.
user_entry_manager.UserEntryManager.get_category | ( | cls | ) |
Prompts the user to input a category ('I' for Income, 'E' for Expense). Returns: str: The corresponding category (Income/Expense) based on the user's input. Raises: ValueError: If an invalid category is entered.
user_entry_manager.UserEntryManager.get_date | ( | cls, | |
prompt, | |||
allow_default = False ) |
Prompts the user for a date in the format 'mm-dd-yyyy'. Optionally allows defaulting to today's date. Args: prompt (str): The prompt message for the user. allow_default (bool): If True, the user can leave the date blank to default to today's date. Returns: str: A valid date string in 'mm-dd-yyyy' format.
|
static |
Prompts the user for an optional description of the transaction. Returns: str: The description entered by the user, or an empty string if not provided.
|
static |
Prompts the user to input a transaction ID. Returns: int: The transaction ID entered by the user.
|
static |
|
static |