mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-05-19 11:28:49 +02:00
Add accounts expansion, analytics, exchange rates, API tokens, PWA support, and UI overhaul
All checks were successful
Deploy to VPS / deploy (push) Successful in 45s
All checks were successful
Deploy to VPS / deploy (push) Successful in 45s
- Expand Account model with account_type (pension, savings, liability, crypto), new banks/currencies (BTC, XMR, FCL, ROP, VOL, MEMP, MPAT, MORTGAGE), and next_payment field - Add exchange rate endpoint (BCCR integration), analytics endpoint, paste-import for transactions, and API token management - Add PWA manifest, service worker, and app icons - Redesign dashboard, transactions, transfers, and login pages with theme support - Add billing cycle selector, confirm dialog, and paste import modal components - One-time DB reset in deploy workflow for schema migration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
29
backend/app/api/v1/endpoints/exchange_rate.py
Normal file
29
backend/app/api/v1/endpoints/exchange_rate.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from sqlmodel import Session
|
||||
|
||||
from app.auth import get_current_user
|
||||
from app.db import get_session
|
||||
from app.models.models import ExchangeRateRead
|
||||
from app.services.exchange_rate import get_current_rate, get_rate_history
|
||||
|
||||
router = APIRouter(prefix="/exchange-rate", tags=["exchange-rate"])
|
||||
|
||||
|
||||
@router.get("/", response_model=ExchangeRateRead)
|
||||
def current_rate(
|
||||
session: Session = Depends(get_session),
|
||||
_user: str = Depends(get_current_user),
|
||||
):
|
||||
rate = get_current_rate(session)
|
||||
if not rate:
|
||||
raise HTTPException(status_code=503, detail="Exchange rate unavailable")
|
||||
return rate
|
||||
|
||||
|
||||
@router.get("/history", response_model=list[ExchangeRateRead])
|
||||
def rate_history(
|
||||
days: int = 30,
|
||||
session: Session = Depends(get_session),
|
||||
_user: str = Depends(get_current_user),
|
||||
):
|
||||
return get_rate_history(session, days)
|
||||
Reference in New Issue
Block a user