Expenses, Bills,a and reporting Improvements on workflows.#7
Merged
Conversation
- refactor bill item category extraction to return all unique categories instead of single - add groupBillItemsByCategory utility to organize bill items by their category ID - implement logic to create individual expense entries for each category in multi-category bills - reorder and improve form validation checks for amount, description, and future expense dates - update bill category error messaging for better clarity
- add real-time budget validation when adding bill items to prevent exceeding bill total - add summary row displaying bill amount, items total and remaining budget with alerts - fix expense page logic: correct boolean check, simplify conditionals and update error messages - clean up redundant code and improve type safety across both pages
Replace the single `categoryId` form state with a `categoryIds` array to support multiple selected categories. Add dynamic UI for toggling categories per bill line item when a bill has multiple unique categories, update validation logic, form effects, and submission handling to create grouped expenses per selected category, and adjust error messages and form reset to match the new structure.
This commit adds full support for multi-category expenses by introducing expense line items: - create the expense_items database table with indexes and foreign keys - add drizzle ORM schema and table relations - extend the expenses API to accept line items in creation requests and add a getItems endpoint - update the frontend Expenses page to use line items instead of multiple single expenses for multi-category bills
Add a resolveLocationFilter utility to validate and resolve allowed business locations for the current user. Switch all report routes to use reportQuery middleware instead of accountManage, update handlers to accept request context, and replace manual input location ID checks with validated business-level filters to ensure reports only access permitted data.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes #(issue)
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Test Configuration:
Checklist:
Screenshots (if appropriate):
Additional context:
Add any other context about the pull request here.