Update currency handling in models and views: Modify model attributes to specify values in centavos for precision. Adjust CSV export and currency formatting functions to convert centavos to GTQ for accurate display and export.

This commit is contained in:
padreug 2025-07-05 14:59:05 +02:00
parent f32e1bb9ae
commit d2866276a9
3 changed files with 13 additions and 11 deletions

View file

@ -11,11 +11,11 @@ class ClientDashboardSummary(BaseModel):
"""Summary metrics for client dashboard overview"""
user_id: str
total_sats_accumulated: int
total_fiat_invested: int # Confirmed deposits
pending_fiat_deposits: int # Pending deposits awaiting confirmation
current_sats_fiat_value: float # Current fiat value of total sats
total_fiat_invested: int # Confirmed deposits (in centavos)
pending_fiat_deposits: int # Pending deposits awaiting confirmation (in centavos)
current_sats_fiat_value: float # Current fiat value of total sats (in centavos)
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 (in centavos)
total_transactions: int
dca_mode: str # 'flow' or 'fixed'
dca_status: str # 'active' or 'inactive'
@ -27,7 +27,7 @@ class ClientTransaction(BaseModel):
"""Read-only view of client's DCA transactions"""
id: str
amount_sats: int
amount_fiat: int
amount_fiat: int # Stored in centavos (GTQ * 100) for precision
exchange_rate: float
transaction_type: str # 'flow', 'fixed', 'manual'
status: str