Skip to content

Commit 491fe2e

Browse files
authored
Merge pull request #442 from easygap/feat/dashboard-v2-actions
feat: 대시보드 v2 — 웹 입금 기록 + UI 전면 개편
2 parents a699e3f + 2d1acbb commit 491fe2e

4 files changed

Lines changed: 690 additions & 352 deletions

File tree

database/repositories.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,30 @@ def get_cash_flows(account_key: str = "") -> list:
834834
session.close()
835835

836836

837+
@with_retry
838+
def get_recent_cash_flows(account_key: str = "", limit: int = 12) -> list:
839+
"""최근 입금/출금 내역 [{occurred_at, amount, note}...] 최신순 — 대시보드 표시용."""
840+
session = get_session()
841+
try:
842+
rows = (
843+
session.query(CashFlow)
844+
.filter(CashFlow.account_key == (account_key or ""))
845+
.order_by(CashFlow.occurred_at.desc())
846+
.limit(int(limit))
847+
.all()
848+
)
849+
return [
850+
{
851+
"occurred_at": str(r.occurred_at)[:16],
852+
"amount": float(r.amount or 0),
853+
"note": r.note or "",
854+
}
855+
for r in rows
856+
]
857+
finally:
858+
session.close()
859+
860+
837861
@with_retry
838862
def get_cash_flow_total(
839863
account_key: str = "",

0 commit comments

Comments
 (0)