Add auto-update strategies for current balance on manual accounts #2460

Merged
zachgoll merged 2 commits from zachgoll/maybe-909-intelligent-current-balance-updating into main 2025-07-17 18:49:56 +08:00
zachgoll commented 2025-07-17 00:57:14 +08:00 (Migrated from github.com)

Extracts some of the logic I had in #2449 to provide "intelligent" / "auto update" strategies when a user attempts to update the balance on a manual account.

Manual accounts do not manage the current_anchor valuation (otherwise, user would need to continually update it, which is bad UX). Instead, we use a combination of "auto-update strategies" to set the current balance according to the user's intent.

  1. Value tracking - If the account has a reconciliation already OR is a "non-cash" account, we assume they are tracking the account value primarily with reconciliations, so we append a new one
  2. Opening balance adjustment - If the account doesn't have recons, we assume user is tracking with transactions, so we adjust the opening balance with a delta until it "backs in" to the desired current balance. This ensures we don't append unnecessary reconciliations to the account, which "reset" the value from that date forward (not user's intent).
Extracts some of the logic I had in #2449 to provide "intelligent" / "auto update" strategies when a user attempts to update the balance on a manual account. Manual accounts do not manage the `current_anchor` valuation (otherwise, user would need to continually update it, which is bad UX). Instead, we use a combination of "auto-update strategies" to set the current balance according to the user's intent. 1. **Value tracking** - If the account has a reconciliation already OR is a "non-cash" account, we assume they are tracking the account value primarily with reconciliations, so we append a new one 2. **Opening balance adjustment** - If the account doesn't have recons, we assume user is tracking with transactions, so we adjust the opening balance with a delta until it "backs in" to the desired current balance. This ensures we don't append unnecessary reconciliations to the account, which "reset" the value from that date forward (not user's intent).
v11t commented 2025-07-19 19:57:15 +08:00 (Migrated from github.com)

this seems to have fixed https://github.com/maybe-finance/maybe/issues/2461 for me / cc: @jakubkottnauer

this seems to have fixed https://github.com/maybe-finance/maybe/issues/2461 for me / cc: @jakubkottnauer
Sign in to join this conversation.