From 227e9dd006c5bf02e9aa4cc5e2160a7440a56a4c Mon Sep 17 00:00:00 2001 From: AJ Date: Thu, 9 Oct 2025 18:42:40 -0400 Subject: [PATCH] Fix double-counting issue and refactor category mapping forms. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Transaction Filtering: - Add TransactionFilters helper class to exclude transfer categories from spending reports - Exclude "Credit Card Payment" and "Banking" categories from dashboard top spending - Add ExcludeTransfers() extension method for reusable filtering - Update dashboard header to indicate transfers are excluded Category Mappings Refactor: - Split form models into separate AddMappingModel and UpdateMappingModel - Remove [BindProperty] attributes and use parameter binding instead - Eliminate cross-validation issues between add/edit forms - Simplify validation logic by removing manual ModelState cleanup This fixes the issue where credit card payments were counted as spending even though they're just transfers between accounts, causing inflated spending totals on the dashboard. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- MoneyMap/Pages/CategoryMappings.cshtml | 32 ++++++------- MoneyMap/Pages/CategoryMappings.cshtml.cs | 56 +++++++++++------------ MoneyMap/Pages/Index.cshtml | 5 +- MoneyMap/Pages/Index.cshtml.cs | 3 +- MoneyMap/Services/TransactionFilters.cs | 37 +++++++++++++++ 5 files changed, 84 insertions(+), 49 deletions(-) create mode 100644 MoneyMap/Services/TransactionFilters.cs diff --git a/MoneyMap/Pages/CategoryMappings.cshtml b/MoneyMap/Pages/CategoryMappings.cshtml index 7df633c..e91eed0 100644 --- a/MoneyMap/Pages/CategoryMappings.cshtml +++ b/MoneyMap/Pages/CategoryMappings.cshtml @@ -146,9 +146,9 @@ else