mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 19:16:40 +07:00
TransactionRead inherited TransactionBase's model_validator, so the rules a new row must satisfy were also applied on the way out, to rows already in the database. A row can stop satisfying them through no fault of its own: transactions.transfer_account_id is ON DELETE SET NULL, so deleting an account leaves every transfer that pointed at it without a destination. The result was that deleting an account could 500 the entire transactions list — permanently, and with the list gone there was no way in the UI to find and delete the offending row. The fields move to TransactionFields, which reading uses; TransactionBase keeps the invariants for the write path. The frontend already tolerates a missing destination (TransactionsTable renders the transfer suffix only when transfer_account_id is set, and the edit modal makes you pick a destination before saving), so such a row is now visible, editable and deletable instead of fatal.
5.0 KiB
5.0 KiB