fix(transfers): show consistent source target and prevent same-account edits (U11)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user