From e05404fcab2cc499821f99e8689b385620ded555 Mon Sep 17 00:00:00 2001 From: padreug Date: Sun, 22 Jun 2025 15:40:56 +0200 Subject: [PATCH] Enhance client dashboard summary: Add pending fiat deposits to the summary metrics and update the model and frontend to display pending deposits, improving visibility of cash awaiting confirmation for DCA processing. --- crud.py | 1 + models.py | 3 ++- templates/satmachineclient/index.html | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/crud.py b/crud.py index 4bd4502..aeb7c81 100644 --- a/crud.py +++ b/crud.py @@ -99,6 +99,7 @@ async def get_client_dashboard_summary(user_id: str) -> Optional[ClientDashboard user_id=user_id, total_sats_accumulated=total_sats, total_fiat_invested=total_invested, # Sum of confirmed deposits + pending_fiat_deposits=pending_deposits, # Sum of pending deposits average_cost_basis=avg_cost_basis, current_fiat_balance=remaining_balance, # Confirmed deposits - DCA spent total_transactions=tx_stats["tx_count"] if tx_stats else 0, diff --git a/models.py b/models.py index 59b683f..3104ead 100644 --- a/models.py +++ b/models.py @@ -11,7 +11,8 @@ class ClientDashboardSummary(BaseModel): """Summary metrics for client dashboard overview""" user_id: str total_sats_accumulated: int - total_fiat_invested: int # In centavos + total_fiat_invested: int # Confirmed deposits + pending_fiat_deposits: int # Pending deposits awaiting confirmation average_cost_basis: float # Average sats per fiat unit current_fiat_balance: int # Available balance for DCA total_transactions: int diff --git a/templates/satmachineclient/index.html b/templates/satmachineclient/index.html index 7da2cd3..40f2a05 100644 --- a/templates/satmachineclient/index.html +++ b/templates/satmachineclient/index.html @@ -57,6 +57,22 @@ + +
+
+ + +
+ ${formatCurrency(dashboardData.pending_fiat_deposits)} pending deposit +
+
+ Cash waiting to be inserted into ATM for DCA processing +
+
+
+