diff --git a/frontend/src/views/investments/InvestmentsView.vue b/frontend/src/views/investments/InvestmentsView.vue index c9fb05a..e0bb257 100644 --- a/frontend/src/views/investments/InvestmentsView.vue +++ b/frontend/src/views/investments/InvestmentsView.vue @@ -29,90 +29,103 @@ @@ -158,6 +171,11 @@ const investmentAccounts = computed(() => })) ) +const selectedAccountBalance = computed(() => { + const acct = investmentAccounts.value.find(a => a.id === selectedAccountId.value) + return acct?.balance ?? 0 +}) + // --- Allocation Chart --- const allocationChartSeries = computed(() => performance.value?.holdings.map(h => h.marketValue) ?? [] diff --git a/src/Purrse.Api/Services/BankSyncService.cs b/src/Purrse.Api/Services/BankSyncService.cs index a32455f..f212454 100644 --- a/src/Purrse.Api/Services/BankSyncService.cs +++ b/src/Purrse.Api/Services/BankSyncService.cs @@ -424,12 +424,15 @@ public class BankSyncService : IBankSyncService // For SimpleFIN, use the earliest start date across all accounts so the // single API call (cached) returns transactions covering every account. + // Subtract a 7-day overlap buffer because banks may post transactions with + // dates earlier than when they appear in the SimpleFIN feed. Duplicate + // detection (FitId + fingerprint) ensures re-fetched transactions are skipped. var endDate = DateTime.UtcNow; DateTime? simpleFinStartDate = null; if (connection.Provider == SyncProvider.SimpleFIN) { simpleFinStartDate = enabledAccounts - .Select(la => la.LastSyncAt ?? endDate.AddDays(-90)) + .Select(la => la.LastSyncAt?.AddDays(-7) ?? endDate.AddDays(-90)) .Min(); } @@ -447,7 +450,7 @@ public class BankSyncService : IBankSyncService try { - var startDate = simpleFinStartDate ?? linkedAccount.LastSyncAt ?? endDate.AddDays(-90); + var startDate = simpleFinStartDate ?? linkedAccount.LastSyncAt?.AddDays(-7) ?? endDate.AddDays(-90); var provider = connection.Provider == SyncProvider.Plaid ? (Purrse.Plugins.Abstractions.IAccountSyncProvider)_plaid