fix: address account valuation review findings
This commit is contained in:
+10
-1
@@ -24,6 +24,7 @@
|
||||
| `type` | TEXT | 필수 | `bank` | bank/card/cash/investment/loan/other | enum | 아니오 |
|
||||
| `currency` | TEXT | 필수 | `KRW` | supported currency | ISO code | 아니오 |
|
||||
| `last_balance` | INTEGER | 선택 | NULL | exact integer | currency unit | 아니오 |
|
||||
| `last_balance_basis_date` | TEXT | 선택 | `''` | YYYY-MM-DD or unknown | date of the evidence represented by `last_balance`; empty/unknown is explicit | 아니오 |
|
||||
| `last_synced_at` | TEXT | 선택 | `''` | ISO date/time | timestamp | 아니오 |
|
||||
| `statement_status` | TEXT | 필수 | `unknown` | existing status enum | 없음 | 아니오 |
|
||||
| `liquidity_bucket` | TEXT | 필수 | `other` | cash/deposit/investment/real_estate/other/loan | enum | 아니오 |
|
||||
@@ -119,6 +120,14 @@
|
||||
|
||||
기존 필드와 관계를 보존한다. import는 거래를 기록할 수 있지만 balance valuation candidate는 dated `unverified` row만 추가한다. reconciliation은 calculated balance provenance와 `VALUATION_MANAGED` 상태를 보존하며 investment valuation 때문에 transaction을 생성하지 않는다. `schema_meta.schema_version`은 12다.
|
||||
|
||||
### 현재 계좌 잔액 캐시와 기준일
|
||||
|
||||
- `last_balance` is the current cache value: it is the latest current balance observed by an import or account write, not a historical valuation and not opening evidence.
|
||||
- `last_balance_basis_date` is the basis field for the evidence represented by that cache. It is a date when known; legacy or date-less writes store unknown/NULL and must not be inferred from `last_synced_at` or a valuation row.
|
||||
- `last_synced_at` is the execution/sync timestamp: when the import or account write advanced the cache, not the evidence basis date.
|
||||
- imports and account writes advance the account cache; they may also append a dated `account_valuations` candidate, but updating the cache does not rewrite historical rows.
|
||||
- `account_valuations` is the historical authority. A dated valuation remains append-only evidence even when it is older than the current cache; older evidence never rolls back the current cache.
|
||||
|
||||
## 관계와 불변조건
|
||||
|
||||
### 관계
|
||||
@@ -146,7 +155,7 @@
|
||||
- 저장 위치: resolved SQLite path from `jarca_ledger_mcp.infrastructure.sqlite.connection`
|
||||
- 직렬화 형식: SQLite tables; evidence arrays JSON UTF-8
|
||||
- 스키마 버전: schema 11 → schema 12 additive
|
||||
- 기존 데이터 처리: `migrate_db()` creates missing tables/columns/indexes; no guessed migration or deletion
|
||||
- 기존 데이터 처리: `migrate_db()` creates missing tables/columns/indexes; this is an additive migration with no guessed migration or deletion. legacy rows with unknown basis remain unknown; no inference is permitted.
|
||||
- 하위 호환성: existing ledger/auth/menu/MCP contracts and legacy rows remain readable
|
||||
- 롤백 조건: pre-migration backup restore boundary; do not down-migrate or delete valuation history in application code
|
||||
|
||||
|
||||
Reference in New Issue
Block a user