feat: add IBAN foundation for accounts and merchants
GF
4h ago+2353+2353+0123456789012345678901234567890123456789-13-13-01234567890123456789
What this PR does
Adds an IBAN field to the user's own accounts (depository, credit card, investment, loan). The form field is a plain text field (autocomplete off, so password managers do not fill it). It stays empty on edit and only shows the last four characters of a stored IBAN in its placeholder. The value is normalized on save and encrypted at rest with Active Record Encryption (non-deterministic). It is the base for the rest of the IBAN series.
- Enable Banking fills the IBAN of the linked account automatically and moves it along when the link moves to another account.
- The IBAN is part of the family data export and import.
- The encryption backfill manifest gets the new column (backfill version 14; 12 and 13 are taken on main by #5357 and #5225).
What changed after the review
The first version also stored merchant IBANs and enforced one IBAN per family and currency with a deterministic ciphertext. Equal ciphertexts would allow linking families that share an IBAN, so this PR now only keeps accounts.iban:
- No deterministic encryption and no uniqueness rule. One IBAN can back two products (see #4062), so several accounts may carry the same IBAN.
- The merchant IBAN moved to the merchant PR of this series.
- Encrypting the plain IBAN on
enable_banking_accounts(#5357, merged) and replacing redelivered Enable Banking rows (#5358) are split into separate small PRs. - The IBAN input is no longer a password field, so a password manager cannot save the login password as the IBAN.
Validation
- Tests for the changed parts green locally, full suite green in CI.
- Migration is rerun-safe (
column_exists?guard).
Summary by CodeRabbit
-
New Features
- Add bank account identifiers and bank details to supported account types, with options to add, replace, or remove them.
- Automatically sync eligible identifiers from linked bank accounts and carry them over when accounts are relinked.
- Import account identification details while preserving existing values when import data omits them.
- Provide localized identification fields in supported languages.
-
Security
- Keep saved identifiers and bank details out of form fields, showing only the last four characters as a hint.