fix(transfers): show consistent source target and prevent same-account edits (U11)

This commit is contained in:
2026-11-02 19:27:54 +01:00
parent 1686f5769c
commit 4d0d5c8d88
5 changed files with 68 additions and 1 deletions
@@ -270,6 +270,11 @@ public class EntryService : IEntryService
var otherEntry = await db.Entries.FindAsync(otherEntryId)
?? throw new InvalidOperationException($"Gegeneintrag {otherEntryId} nicht gefunden.");
if (newLinkedAccountId == entry.AccountId)
throw new InvalidOperationException("Umbuchung innerhalb desselben Kontos ist nicht möglich.");
if (!await db.Accounts.AnyAsync(a => a.Id == newLinkedAccountId))
throw new InvalidOperationException("Das gewählte Konto ist nicht mehr vorhanden.");
// Update date, title, amount on both sides
entry.Date = date;
entry.Title = title.Trim();