diff --git a/src/Purrse.Api/Program.cs b/src/Purrse.Api/Program.cs index a3fb05c..764f17e 100644 --- a/src/Purrse.Api/Program.cs +++ b/src/Purrse.Api/Program.cs @@ -131,7 +131,7 @@ using (var scope = app.Services.CreateScope()) if (!applied) { var count = await db.Database.ExecuteSqlRawAsync( - "UPDATE \"Transactions\" SET \"Status\" = 1 WHERE \"FitId\" IS NOT NULL AND \"Status\" = 0"); + "UPDATE transactions SET \"Status\" = 1 WHERE \"FitId\" IS NOT NULL AND \"Status\" = 0"); if (count > 0) app.Services.GetRequiredService>().LogInformation("Marked {Count} bank-synced transactions as Cleared", count); await db.Database.ExecuteSqlRawAsync( diff --git a/src/Purrse.Api/Services/BankSyncService.cs b/src/Purrse.Api/Services/BankSyncService.cs index 0062b2d..20ad8a4 100644 --- a/src/Purrse.Api/Services/BankSyncService.cs +++ b/src/Purrse.Api/Services/BankSyncService.cs @@ -462,6 +462,16 @@ public class BankSyncService : IBankSyncService if (duplicate != null) { + // Update memo if the existing transaction has no memo + if (!string.IsNullOrEmpty(parsed.Memo)) + { + var existing = await _db.Transactions.FindAsync(duplicate.ExistingTransactionId); + if (existing != null && string.IsNullOrEmpty(existing.Memo)) + { + existing.Memo = parsed.Memo; + } + } + skipped++; continue; }