From 338374f831e2ef98a5fcda723db3ac3bb3c32321 Mon Sep 17 00:00:00 2001 From: AJ Date: Sat, 11 Oct 2025 20:53:46 -0400 Subject: [PATCH] Enhance card management with account linking and nicknames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added account linking functionality to cards with dropdown selector - Added optional nickname field for easier card identification - Updated Cards list page to show linked accounts with badges - Reorganized card display to show issuer and last4 together - Include account relationship when loading cards This allows cards to be properly associated with their bank accounts, which is essential for the transaction import and categorization flow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- MoneyMap/Pages/Cards.cshtml | 26 ++++++++++++++++++++++---- MoneyMap/Pages/Cards.cshtml.cs | 1 + MoneyMap/Pages/EditCard.cshtml | 29 +++++++++++++++++++++++++++++ MoneyMap/Pages/EditCard.cshtml.cs | 30 ++++++++++++++++++++++++++++-- 4 files changed, 80 insertions(+), 6 deletions(-) diff --git a/MoneyMap/Pages/Cards.cshtml b/MoneyMap/Pages/Cards.cshtml index 1f8b42d..d590113 100644 --- a/MoneyMap/Pages/Cards.cshtml +++ b/MoneyMap/Pages/Cards.cshtml @@ -39,9 +39,9 @@ + - - + @@ -50,9 +50,27 @@ @foreach (var item in Model.Cards) { + - - +
Card OwnerIssuerLast 4Linked Account Transactions Actions
+
+ @item.Card.Issuer •••• @item.Card.Last4 + @if (!string.IsNullOrEmpty(item.Card.Nickname)) + { +
+ @item.Card.Nickname + } +
+
@item.Card.Owner@item.Card.Issuer•••• @item.Card.Last4 + @if (item.Card.Account != null) + { + @item.Card.Account.DisplayLabel + } + else + { + None + } + @item.TransactionCount
diff --git a/MoneyMap/Pages/Cards.cshtml.cs b/MoneyMap/Pages/Cards.cshtml.cs index a75ddb0..5708436 100644 --- a/MoneyMap/Pages/Cards.cshtml.cs +++ b/MoneyMap/Pages/Cards.cshtml.cs @@ -29,6 +29,7 @@ namespace MoneyMap.Pages public async Task OnGetAsync() { var cards = await _db.Cards + .Include(c => c.Account) .OrderBy(c => c.Owner) .ThenBy(c => c.Last4) .ToListAsync(); diff --git a/MoneyMap/Pages/EditCard.cshtml b/MoneyMap/Pages/EditCard.cshtml index cc12bfe..8bfa391 100644 --- a/MoneyMap/Pages/EditCard.cshtml +++ b/MoneyMap/Pages/EditCard.cshtml @@ -40,6 +40,33 @@
The last 4 digits of the card number
+
+ + + +
A friendly name to help identify this card
+
+ +
+ + + +
+ Link this card to the bank account it draws from or pays to + @if (!Model.AvailableAccounts.Any()) + { +
+ No accounts available. Create one first. + } +
+
+