feat(budget): 가희 증권 자산 후잉·결산 반영 (securities_balance v2)

- send_balance_to_budget.py: 본인+가희 계좌 소유자별(by_owner) 집계, schema v1→v2
- inbox_handler.py: OWNER_ASSET 맵으로 소유자별 reconcile(self→증권(효원)/gahee→증권(가희)),
  asset_name 기반 출력, v2 payload 검증 추가(v1 하위호환 유지)
- monthly_settlement.py: 텔레그램 reconcile 라인 소유자별 라벨
- INBOX_TOPICS.md / CLAUDE.md: v2 스키마 문서화

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hyowons
2026-07-02 18:51:15 +09:00
parent 213c0e0797
commit 300a4c9ca9
5 changed files with 148 additions and 80 deletions
@@ -238,19 +238,20 @@ def format_inbox_telegram_line(summary: dict) -> str:
for r in summary.get("reconcile", {}).get("securities_balance", []):
action = r.get("action")
delta = r.get("delta") or 0
label = r.get("asset_name", "증권(효원)")
if action == "aligned":
parts.append("증권 일치")
parts.append(f"{label} 일치")
elif action == "journaled":
sign = "차익" if delta > 0 else "차손"
parts.append(f"증권 평가{sign} {abs(delta):,}원 분개")
parts.append(f"{label} 평가{sign} {abs(delta):,}원 분개")
elif action == "noise":
parts.append(f"증권 차액 {delta:+,}원 (노이즈)")
parts.append(f"{label} 차액 {delta:+,}원 (노이즈)")
elif action == "rejected":
parts.append(f"⚠️ 증권 차액 {delta:+,}원 거부")
parts.append(f"⚠️ {label} 차액 {delta:+,}원 거부")
elif action == "journal_failed":
parts.append("⚠️ 증권 분개 실패")
parts.append(f"⚠️ {label} 분개 실패")
elif action == "skipped":
parts.append("증권 reconcile skip")
parts.append(f"{label} reconcile skip")
# rejected/journal_failed 는 위 reconcile 라인에서 이미 표시됨 — 중복 카운트 방지
reconcile_failed = sum(
1 for r in summary.get("reconcile", {}).get("securities_balance", [])