D31: схема v2 — валюта у денежных величин + display_currency
- Transaction/RecurringCashflow/Asset/Liability получили поле currency (пусто = наследование: у операции — от счёта, у актива/обязательства — от базовой валюты модели); - Account.currency больше не по умолчанию USD: пусто = базовая валюта модели (новый счёт в рублёвой модели не становился долларовым); - FinancialModel.display_currency — валюта вывода по умолчанию, свойство output_currency; SCHEMA_VERSION 1 → 2, миграция v0/v1; - resolve_currency() в domain/currency.py — единое правило «явный → базовый»; - тесты: контракт схемы обновлён на v2, добавлены тесты миграции v1, display_currency и наследования валюты; - попутно: 3 теста были не платформонезависимы (Windows: разделитель пути в дефолте экспорта и cp1252 в subprocess-декодинге) — исправлены.
This commit is contained in:
1 parent
e26ed28068
commit
4bd19abbe9
12 files changed
+175
-21
No files matched your search
+8
-1
@@ -1,6 +1,12 @@
|
||||
from domain.account import Account
|
||||
from domain.asset import Asset
|
||||
from domain.currency import CURRENCY_SYMBOLS, CurrencyConverter, CurrencyError, ExchangeRate
|
||||
from domain.currency import (
|
||||
CURRENCY_SYMBOLS,
|
||||
CurrencyConverter,
|
||||
CurrencyError,
|
||||
ExchangeRate,
|
||||
resolve_currency,
|
||||
)
|
||||
from domain.liability import Liability
|
||||
from domain.model import FinancialModel
|
||||
from domain.recurring import RecurringCashflow
|
||||
@@ -19,4 +25,5 @@ __all__ = [
|
||||
"CurrencyConverter",
|
||||
"CurrencyError",
|
||||
"CURRENCY_SYMBOLS",
|
||||
"resolve_currency",
|
||||
]
|
||||
Reference in new issue
Block a user