Add transaction_time field to DCA payments: Updated the database schema to include a new transaction_time column in the dca_payments table, modified the CreateDcaPaymentData model to accept transaction_time, and adjusted the create_dca_payment function to store the original ATM transaction time. Updated transaction processing to capture this new field.

This commit is contained in:
padreug 2025-06-22 16:50:27 +02:00
parent 18323dc0c8
commit 3a2f10f949
4 changed files with 20 additions and 4 deletions

View file

@ -160,9 +160,9 @@ async def create_dca_payment(data: CreateDcaPaymentData) -> DcaPayment:
"""
INSERT INTO satmachineadmin.dca_payments
(id, client_id, amount_sats, amount_fiat, exchange_rate, transaction_type,
lamassu_transaction_id, payment_hash, status, created_at)
lamassu_transaction_id, payment_hash, status, created_at, transaction_time)
VALUES (:id, :client_id, :amount_sats, :amount_fiat, :exchange_rate, :transaction_type,
:lamassu_transaction_id, :payment_hash, :status, :created_at)
:lamassu_transaction_id, :payment_hash, :status, :created_at, :transaction_time)
""",
{
"id": payment_id,
@ -174,7 +174,8 @@ async def create_dca_payment(data: CreateDcaPaymentData) -> DcaPayment:
"lamassu_transaction_id": data.lamassu_transaction_id,
"payment_hash": data.payment_hash,
"status": "pending",
"created_at": datetime.now()
"created_at": datetime.now(),
"transaction_time": data.transaction_time
}
)
return await get_dca_payment(payment_id)