This repository was archived by the owner on Dec 6, 2025. It is now read-only.
Merged
Conversation
added 3 commits
May 28, 2025 16:09
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds full support for category management by extending the data handler, updating front-end routes/templates, and expanding test coverage.
- Refactor data handler: improved
read_database, addedadd_category/get_categories, revisedget_users - Enhance front-end: session-based user selection, new
/select_userand/submit_categoryroutes with validation - Expand tests: isolated test DB fixture, new tests for category methods and edge cases
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tests/test_data_handler.py | Extend fixture for isolated DB; add tests for execute_sql, read_database, add_category, get_categories, and edge cases |
| src/front/home.py | Update home_page to use session data; add select_user & submit_category routes with validation and feedback |
| src/data_handler.py | Remove old read_database; add new read_database signature; implement add_category, get_categories; update get_users |
Files not reviewed (1)
- src/front/templates/home.html: Language not supported
Comments suppressed due to low confidence (2)
src/front/home.py:57
- [nitpick] Inconsistent message casing: consider capitalizing the first letter (e.g., "User name saved!") for consistency with other flash messages.
flash("user name saved! Now select the user from the dropdown to continue.", "success")
src/data_handler.py:163
- [nitpick] This public method lacks a docstring. Adding a brief description of its behavior and return format will improve clarity.
def get_users(self) -> list:
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Jake-Pullen
previously requested changes
May 29, 2025
Owner
Jake-Pullen
left a comment
There was a problem hiding this comment.
Overall amazing progress. There is some comments to address and overall i'd like to see more logging and some minor formatting cleanup (suggest letting a linter change files on save, will fix whitespace on blank lines | trailing whitespace | blank lines count between functions)
added 3 commits
May 31, 2025 17:10
…ature/add-category-support
…mprove database methods and tests
* Some initial changes based on feedback * More additions * Resolved most comments from Pull Request 8 * Moved convert to universal currency to its own module. * Working towards adding default rows, need to add system user? * feat: ✨We now add an internal master category per user that is hidden Will be useful for various key restraints. * fix: 🩹 Fixed a test failure --------- Co-authored-by: Jake Pullen <hello@jake-is.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant updates to the
data_handlermodule, the front-end logic for user and category management, and the associated test cases. Key changes include refactoring the database interaction methods, adding support for category management, enhancing the front-end to handle user and category selection, and expanding test coverage. Below are the most important changes grouped by theme:Database Interaction Enhancements:
read_databaseto support parameterized queries and return results as a list. This method was moved and improved to handle SQL execution more robustly.add_categoryandget_categoriesmethods to manage categories in the database, including support for optional budget values and parent categories.Front-End Updates:
home.htmltemplate to include forms for selecting users, adding categories, and displaying categories. Added dynamic dropdowns and validation for user and category inputs.home_pagefunction to fetch categories for the selected user and pass them to the template for rendering./select_userand/submit_category) to handle user selection and category creation, with appropriate session management and error handling.Code Refactoring:
read_databasemethod and replaced its usage with the new implementation. Simplified logging and error handling inadd_user_name.Test Coverage Improvements:
add_category,get_categories) and enhanced existing tests to validate database interactions, including parameterized queries and edge cases.These changes collectively improve the maintainability, functionality, and testability of the application while introducing new features for category management.