fix: учитывать инвестсчета как наличные в расчёте капитала

Тип счёта investment не входил в CASH_ACCOUNT_TYPES, из-за чего деньги
на инвестсчёте не попадали ни в блок "Наличные", ни в класс "Инвестиции"
раздела Капитал — просто выпадали из расчёта net worth (issue #14).
This commit is contained in:
ZProger
2026-09-03 23:29:27 +03:00
parent b9c7ecca08
commit c2f59c8773
3 changed files with 11 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
# title, /api/health (which the frontend reads to show it in Settings), and
# embedded in exported backups so an old file can be told apart from a
# current one.
APP_VERSION = "1.1.0"
APP_VERSION = "1.1.1"
class Settings(BaseSettings):

View File

@@ -2,11 +2,15 @@
asset class.
Design note: "Cash" is not stored anywhere — it's derived live from
Account/Transaction data (checking/savings/cash accounts only) so the
Account/Transaction data (checking/savings/cash/investment accounts) so the
Transactions feature stays the single source of truth for liquid money.
Every other class (investments, crypto, real estate, vehicles, precious
metals, other) is tracked manually via Asset/AssetValuation rows. Both are
collapsed into one
Investment accounts count here too: their balance is uninvested/unallocated
money sitting on the account, not the market value of what's actually
invested — that value is still tracked manually via Asset/AssetValuation,
same as every other class (investments, crypto, real estate, vehicles,
precious metals, other). Without this, money deposited into an investment
account but not yet turned into a valued Asset silently disappeared from
net worth. Both halves are collapsed into one
daily, forward-filled series so the chart reads as one continuous line even
though the two halves are updated at very different cadences.
"""
@@ -32,7 +36,7 @@ from app.schemas.net_worth import (
RiskLevelSummary,
)
CASH_ACCOUNT_TYPES = {AccountType.CHECKING, AccountType.SAVINGS, AccountType.CASH}
CASH_ACCOUNT_TYPES = {AccountType.CHECKING, AccountType.SAVINGS, AccountType.CASH, AccountType.INVESTMENT}
RANGE_DAYS = {"30d": 30, "90d": 90, "1y": 365, "5y": 365 * 5}