Files
sure/app/models
samuelcseto cb74856f61 Fix linked account balance currency mismatch (#566)
* Fix linked account balance currency mismatch

When linking accounts from providers (Lunchflow, SimpleFIN, Enable Banking),
the initial sync was creating balances before the correct currency was known.
This caused:
1. Opening anchor entry created with default currency (USD/EUR)
2. First sync created balances with wrong currency
3. Later syncs created balances with correct currency
4. Both currency balances existed, charts showed wrong (zero) values

Changes:
- Add `skip_initial_sync` parameter to `Account.create_and_sync`
- Skip initial sync for linked accounts (provider sync handles it)
- Add currency filter to ChartSeriesBuilder query to only fetch
  balances matching the account's current currency

* Add migration script and add tests

* Update schema.rb

---------

Signed-off-by: soky srm <sokysrm@gmail.com>
Co-authored-by: sokie <sokysrm@gmail.com>
2026-01-08 18:23:34 +01:00
..
2025-10-28 19:32:27 +01:00
2025-03-28 13:08:22 -04:00
2025-10-22 19:14:03 +02:00
2025-12-07 18:11:34 +01:00
2025-11-24 17:54:18 +01:00
2025-09-24 00:19:51 +02:00
2025-11-25 20:21:29 +01:00
2025-11-27 15:24:34 +01:00
2025-10-28 19:32:27 +01:00
2026-01-07 16:16:01 +01:00
2024-10-18 11:26:58 -05:00
2025-10-28 19:32:27 +01:00
2025-11-23 20:43:55 +05:30
2024-10-18 11:26:58 -05:00
2024-11-08 09:58:35 -06:00
2024-08-23 10:06:24 -04:00
2025-05-23 18:58:22 -04:00
2025-11-25 20:21:29 +01:00
2024-08-23 09:33:42 -04:00
2025-11-01 09:12:42 +01:00
2025-10-28 19:32:27 +01:00
2025-11-22 02:14:29 +01:00
2026-01-08 15:20:14 +01:00
2025-12-07 18:11:34 +01:00
2025-11-25 20:21:29 +01:00
2025-03-28 13:08:22 -04:00
2025-07-10 18:40:38 -04:00