Enhance transaction history display: Update SQL query and model to include transaction time
This commit is contained in:
parent
3d0fc9c910
commit
79d29f52a1
3 changed files with 4 additions and 2 deletions
3
crud.py
3
crud.py
|
|
@ -169,7 +169,7 @@ async def get_client_transactions(
|
||||||
transactions = await db.fetchall(
|
transactions = await db.fetchall(
|
||||||
f"""
|
f"""
|
||||||
SELECT id, amount_sats, amount_fiat, exchange_rate, transaction_type,
|
SELECT id, amount_sats, amount_fiat, exchange_rate, transaction_type,
|
||||||
status, created_at, lamassu_transaction_id
|
status, created_at, transaction_time, lamassu_transaction_id
|
||||||
FROM satmachineadmin.dca_payments
|
FROM satmachineadmin.dca_payments
|
||||||
WHERE {where_clause}
|
WHERE {where_clause}
|
||||||
ORDER BY created_at DESC
|
ORDER BY created_at DESC
|
||||||
|
|
@ -187,6 +187,7 @@ async def get_client_transactions(
|
||||||
transaction_type=tx["transaction_type"],
|
transaction_type=tx["transaction_type"],
|
||||||
status=tx["status"],
|
status=tx["status"],
|
||||||
created_at=tx["created_at"],
|
created_at=tx["created_at"],
|
||||||
|
transaction_time=tx["transaction_time"],
|
||||||
lamassu_transaction_id=tx["lamassu_transaction_id"]
|
lamassu_transaction_id=tx["lamassu_transaction_id"]
|
||||||
)
|
)
|
||||||
for tx in transactions
|
for tx in transactions
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ class ClientTransaction(BaseModel):
|
||||||
transaction_type: str # 'flow', 'fixed', 'manual'
|
transaction_type: str # 'flow', 'fixed', 'manual'
|
||||||
status: str
|
status: str
|
||||||
created_at: datetime
|
created_at: datetime
|
||||||
|
transaction_time: Optional[datetime] = None # Original ATM transaction time
|
||||||
lamassu_transaction_id: Optional[str] = None
|
lamassu_transaction_id: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@
|
||||||
<q-item v-for="tx in transactions" :key="tx.id">
|
<q-item v-for="tx in transactions" :key="tx.id">
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>${formatSats(tx.amount_sats)}</q-item-label>
|
<q-item-label>${formatSats(tx.amount_sats)}</q-item-label>
|
||||||
<q-item-label caption>${formatCurrency(tx.amount_fiat)} • ${formatDate(tx.created_at)}</q-item-label>
|
<q-item-label caption>${formatCurrency(tx.amount_fiat)} • ${formatDate(tx.transaction_time || tx.created_at)}</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<q-chip
|
<q-chip
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue