WBS-9 진행: API 에러 수정 및 DB 스키마 정규화
- snapshot_admin_store_v1.py: summarize_workspace에서 account_snapshot의 captured_at 사용 (updated_at 대신) - account_snapshot 테이블: 올바른 스키마 재정의 (ordinal PK, row_json, 핵심필드, updated_at) - settings 테이블: 올바른 스키마 재정의 (ordinal PK, key, value_json, note, updated_at) - initialize_snapshot_admin_db.py: XLSX에서 settings, account_snapshot을 올바른 스키마로 로드 - load_from_xlsx_correct.py: account_snapshot을 특별 처리해서 스키마 보존 - /api/settings/save: 정상 작동 (200 응답) - build_ui_state: load_collection_dashboard_state 예외 처리 추가 (진행 중) 데이터 현황: - kis_data_collection.db: 1 테이블 (data_feed), 25행 - snapshot_admin.db: 27 테이블, 7,501행 * settings: 32행 (올바른 스키마) * account_snapshot: 44행 (올바른 스키마) 남은 작업: - /api/state 크래시 원인 진단 및 수정 - /api/export 데이터 검증 - 웹 UI 개선 (백오피스 수준) - T+20 모니터링 활성화 - CI/CD 백업 기능 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -306,7 +306,10 @@ def build_ui_state(db_path: Path | str | None = None) -> dict[str, Any]:
|
||||
snapshot_errors = validate_account_snapshot_rows(account_rows)
|
||||
suggestions = build_validation_suggestions(settings_rows, account_rows)
|
||||
autofix_actions = build_safe_autofix_actions(settings_rows, account_rows)
|
||||
collection = load_collection_dashboard_state(KIS_COLLECTION_DB, KIS_COLLECTION_REPORT)
|
||||
try:
|
||||
collection = load_collection_dashboard_state(KIS_COLLECTION_DB, KIS_COLLECTION_REPORT)
|
||||
except Exception:
|
||||
collection = {}
|
||||
return {
|
||||
"version": {
|
||||
"app": SNAPSHOT_ADMIN_VERSION,
|
||||
|
||||
@@ -723,11 +723,11 @@ def summarize_workspace(db_path: Path | str | None = None) -> dict[str, Any]:
|
||||
snapshot_count = conn.execute(f"SELECT COUNT(*) FROM {SNAPSHOT_TABLE}").fetchone()[0]
|
||||
latest_update = conn.execute(
|
||||
f"""
|
||||
SELECT MAX(updated_at)
|
||||
SELECT MAX(latest_ts)
|
||||
FROM (
|
||||
SELECT updated_at FROM {SETTINGS_TABLE}
|
||||
SELECT updated_at as latest_ts FROM {SETTINGS_TABLE}
|
||||
UNION ALL
|
||||
SELECT updated_at FROM {SNAPSHOT_TABLE}
|
||||
SELECT captured_at FROM {SNAPSHOT_TABLE}
|
||||
)
|
||||
"""
|
||||
).fetchone()[0]
|
||||
|
||||
Reference in New Issue
Block a user