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.
This commit is contained in:
parent
9ea8c37940
commit
e05404fcab
3 changed files with 19 additions and 1 deletions
1
crud.py
1
crud.py
|
|
@ -99,6 +99,7 @@ async def get_client_dashboard_summary(user_id: str) -> Optional[ClientDashboard
|
||||||
user_id=user_id,
|
user_id=user_id,
|
||||||
total_sats_accumulated=total_sats,
|
total_sats_accumulated=total_sats,
|
||||||
total_fiat_invested=total_invested, # Sum of confirmed deposits
|
total_fiat_invested=total_invested, # Sum of confirmed deposits
|
||||||
|
pending_fiat_deposits=pending_deposits, # Sum of pending deposits
|
||||||
average_cost_basis=avg_cost_basis,
|
average_cost_basis=avg_cost_basis,
|
||||||
current_fiat_balance=remaining_balance, # Confirmed deposits - DCA spent
|
current_fiat_balance=remaining_balance, # Confirmed deposits - DCA spent
|
||||||
total_transactions=tx_stats["tx_count"] if tx_stats else 0,
|
total_transactions=tx_stats["tx_count"] if tx_stats else 0,
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ class ClientDashboardSummary(BaseModel):
|
||||||
"""Summary metrics for client dashboard overview"""
|
"""Summary metrics for client dashboard overview"""
|
||||||
user_id: str
|
user_id: str
|
||||||
total_sats_accumulated: int
|
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
|
average_cost_basis: float # Average sats per fiat unit
|
||||||
current_fiat_balance: int # Available balance for DCA
|
current_fiat_balance: int # Available balance for DCA
|
||||||
total_transactions: int
|
total_transactions: int
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,22 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Pending Deposits Row -->
|
||||||
|
<div v-if="dashboardData.pending_fiat_deposits > 0" class="row q-col-gutter-md q-mt-sm">
|
||||||
|
<div class="col-12">
|
||||||
|
<q-banner inline-actions class="bg-orange-1 text-orange-9">
|
||||||
|
<template v-slot:avatar>
|
||||||
|
<q-icon name="schedule" color="orange" />
|
||||||
|
</template>
|
||||||
|
<div class="text-subtitle2">
|
||||||
|
<strong>${formatCurrency(dashboardData.pending_fiat_deposits)}</strong> pending deposit
|
||||||
|
</div>
|
||||||
|
<div class="text-caption">
|
||||||
|
Cash waiting to be inserted into ATM for DCA processing
|
||||||
|
</div>
|
||||||
|
</q-banner>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue