Implement BAT-009 manual asset CRUD and snapshot close
This commit is contained in:
+15
-4
@@ -4,8 +4,8 @@
|
||||
- Baseline Seed: `.stage-pilot/bootstrap/baseline.yaml`
|
||||
- Status: draft
|
||||
- Owner: Jarca / project maintainer
|
||||
- Last Updated (KST): 2026-06-30
|
||||
- Source Discovery / Batch: bootstrap-baseline, BAT-008
|
||||
- Last Updated (KST): 2026-07-01
|
||||
- Source Discovery / Batch: bootstrap-baseline, BAT-008, BAT-009
|
||||
|
||||
## Project Summary
|
||||
- Jarca 가계부 전용 MCP 서버와 Streamlit 대시보드로 계좌/카드 거래, 예산, 분류 규칙, import, 현금흐름 분석을 SQLite에 저장하고 운영한다.
|
||||
@@ -62,6 +62,8 @@
|
||||
- Referenced by `asset_snapshots.source_type='manual_asset'` and `source_id` when a month-end valuation is snapshotted.
|
||||
- State Rules:
|
||||
- `manual_assets` is the live authority source for non-transaction assets/liabilities.
|
||||
- Create/update mutation validates name, date, liquidity bucket, source evidence fields, and stores changes additively in the existing row; inactive rows are hidden from default valuation reports.
|
||||
- Soft delete/deactivate (`active=false`) is the default deletion semantic so historical `asset_snapshots.source_id` remains reproducible. Hard delete is exceptional cleanup only.
|
||||
- Missing `valuation_amount` rows are excluded; transaction sums are not used as a substitute.
|
||||
- `loan` bucket values are treated as liabilities and subtracted from asset-bucket totals.
|
||||
|
||||
@@ -78,11 +80,19 @@
|
||||
- `amount` :: integer nullable :: snapshotted valuation amount
|
||||
- `liquidity_bucket` :: text :: bucket copied from the source at capture time
|
||||
- `valuation_source`, `source_note`, `memo` :: text :: evidence and operator context
|
||||
- `snapshot_run_id` :: text :: month-end close run identifier for rows created together
|
||||
- `correction_of_run_id` :: text :: previous close run corrected by this append-only run when applicable
|
||||
- `correction_reason` :: text :: operator reason required for same-date re-close/correction
|
||||
- `is_correction` :: integer/bool :: marks correction close rows
|
||||
- `closed_at` :: text :: close execution timestamp copied across the run
|
||||
- `created_at` :: text :: snapshot row creation timestamp
|
||||
- Relationships:
|
||||
- Represents a historical record of `LedgerAccount.last_balance` or `ManualAsset.valuation_amount` rather than a new primary input source.
|
||||
- State Rules:
|
||||
- Snapshot rows are append-only for BAT-008. Existing rows are not destructively overwritten.
|
||||
- Snapshot rows are append-only. Existing rows are not destructively overwritten.
|
||||
- `preview_asset_snapshot_close` computes the source item list, bucket totals, total assets/liabilities, net worth, and warnings without writing rows.
|
||||
- `close_asset_snapshot` writes one run of item-level rows for a basis date from live authority sources. Same-date re-close requires `correction_reason`, appends a new correction run, and links to the previous `snapshot_run_id` when available.
|
||||
- Read reports choose the latest run for a basis date when run metadata exists, preserving original and correction rows for audit while avoiding double counting.
|
||||
- Basis-date snapshot reports prefer stored `asset_snapshots` rows when rows exist for the date; otherwise read reports can fall back to live authority sources.
|
||||
|
||||
## Entity: Transaction
|
||||
@@ -204,7 +214,7 @@
|
||||
- Formal schema migration documentation should be added before larger DB changes.
|
||||
- Some UI workflows need final E2E verification against real rows.
|
||||
- Statement-unavailable account handling is tracked by REQ-003/BAT-003; future work may add a dedicated reconciliation workbench and persistent review-decision queue.
|
||||
- BAT-008 adds `manual_assets` and `asset_snapshots` with read-only MCP/report support. Future work may add mutation MCP for snapshot creation/manual asset CRUD and automatic market/real-estate valuation.
|
||||
- BAT-009 implements manual asset CRUD mutation and month-end snapshot preview/close/correction service/MCP/dashboard workflow. Future work may add automatic market/real-estate valuation or scheduled month-end close.
|
||||
|
||||
## Change Log
|
||||
- 2026-06-26 22:24 KST: Created by `bootstrap-baseline` from repository observation.
|
||||
@@ -212,3 +222,4 @@
|
||||
- 2026-06-29 KST: REQ-003/BAT-003 기준으로 `accounts.statement_status`와 수동 잔액대조 preview 모델 추가.
|
||||
- 2026-06-29 KST: REQ-005/BAT-005 기준으로 `accounts.liquidity_bucket`, `last_balance` 기반 자산 유동성/부채/순자산 규칙 추가.
|
||||
- 2026-06-30 KST: REQ-009/REQ-010/BAT-008 기준으로 `manual_assets`, `asset_snapshots`, 권위 소스(`accounts.last_balance` + `manual_assets`), 순자산 산식/미평가 제외 정책 추가.
|
||||
- 2026-07-01 KST: REQ-011/REQ-012/BAT-009 기준으로 manual asset CRUD, snapshot preview/close, append-only correction metadata, latest-run read policy 추가.
|
||||
|
||||
Reference in New Issue
Block a user