mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 02:56:39 +07:00
Aurum — a self-hosted personal finance operating system: cash flow, net worth tracking, budgets, goals, recurring payments, reports, proactive alerts, and a compound-interest returns calculator, all bilingual (RU/EN) and mobile-first. Ships as a three-container Docker Compose stack (Postgres + FastAPI + nginx-served React frontend). See README.md for setup and CONTRIBUTING.md for development.
20 lines
728 B
Python
20 lines
728 B
Python
from datetime import date
|
|
|
|
from fastapi import APIRouter, Depends, Query
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.api.deps import get_session
|
|
from app.schemas.dashboard import DashboardSummary
|
|
from app.services.dashboard_service import get_dashboard_summary
|
|
|
|
router = APIRouter(prefix="/dashboard", tags=["dashboard"])
|
|
|
|
|
|
@router.get("/summary", response_model=DashboardSummary)
|
|
async def read_dashboard_summary(
|
|
year: int = Query(default_factory=lambda: date.today().year, ge=2000, le=2100),
|
|
month: int = Query(default_factory=lambda: date.today().month, ge=1, le=12),
|
|
session: AsyncSession = Depends(get_session),
|
|
) -> DashboardSummary:
|
|
return await get_dashboard_summary(session, year, month)
|