mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-05-19 12:28:47 +02:00
Fix analytics case() bug, add privacy mode, add prod DB sync script
All checks were successful
Deploy to VPS / deploy (push) Successful in 28s
All checks were successful
Deploy to VPS / deploy (push) Successful in 28s
Fix SQLAlchemy case() import in monthly-trend endpoint. Add data-sensitive attributes to Analytics charts and tables for privacy blur. Add scripts/sync-db.sh for one-click prod-to-local PostgreSQL sync. Remove SQLite artifacts from gitignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,12 +3,13 @@ from typing import Optional
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
from pydantic import BaseModel
|
||||
from sqlalchemy import case
|
||||
from sqlmodel import Session, func, select
|
||||
|
||||
from app.auth import get_current_user
|
||||
from app.db import get_session
|
||||
from app.models.models import Category, Transaction
|
||||
from app.api.v1.endpoints.transactions import get_cycle_range
|
||||
from app.services.budget_projection import get_cycle_range
|
||||
|
||||
router = APIRouter(prefix="/analytics", tags=["analytics"])
|
||||
|
||||
@@ -104,7 +105,7 @@ def monthly_trend(
|
||||
func.count(),
|
||||
func.coalesce(
|
||||
func.sum(
|
||||
func.case(
|
||||
case(
|
||||
(Transaction.currency == "CRC", Transaction.amount),
|
||||
else_=0,
|
||||
)
|
||||
@@ -113,7 +114,7 @@ def monthly_trend(
|
||||
),
|
||||
func.coalesce(
|
||||
func.sum(
|
||||
func.case(
|
||||
case(
|
||||
(Transaction.currency == "USD", Transaction.amount),
|
||||
else_=0,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user