mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
refactor: 抽离 AI pipeline 与调度共享能力逻辑
This commit is contained in:
@@ -146,7 +146,7 @@ impl WalletReadRepository for InMemoryWalletRepository {
|
||||
total_adjusted: wallet.total_adjusted,
|
||||
user_name: None,
|
||||
api_key_name: None,
|
||||
created_at_unix_secs: None,
|
||||
created_at_unix_ms: None,
|
||||
updated_at_unix_secs: Some(wallet.updated_at_unix_secs),
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
@@ -299,7 +299,7 @@ impl WalletWriteRepository for InMemoryWalletRepository {
|
||||
gateway_order_id: Some(input.gateway_order_id),
|
||||
gateway_response: Some(input.gateway_response),
|
||||
status: "pending".to_string(),
|
||||
created_at_unix_secs: 0,
|
||||
created_at_unix_ms: 0,
|
||||
paid_at_unix_secs: None,
|
||||
credited_at_unix_secs: None,
|
||||
expires_at_unix_secs: Some(input.expires_at_unix_secs),
|
||||
@@ -343,7 +343,7 @@ impl WalletWriteRepository for InMemoryWalletRepository {
|
||||
requested_by: None,
|
||||
approved_by: None,
|
||||
processed_by: None,
|
||||
created_at_unix_secs: 0,
|
||||
created_at_unix_ms: 0,
|
||||
updated_at_unix_secs: 0,
|
||||
processed_at_unix_secs: None,
|
||||
completed_at_unix_secs: None,
|
||||
|
||||
@@ -151,7 +151,7 @@ SELECT
|
||||
CAST(w.total_adjusted AS DOUBLE PRECISION) AS total_adjusted,
|
||||
users.username AS user_name,
|
||||
api_keys.name AS api_key_name,
|
||||
CAST(EXTRACT(EPOCH FROM w.created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM w.created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM w.updated_at) AS BIGINT) AS updated_at_unix_secs
|
||||
FROM wallets w
|
||||
LEFT JOIN users ON users.id = w.user_id
|
||||
@@ -204,7 +204,7 @@ SELECT
|
||||
api_keys.name AS api_key_name,
|
||||
operator_users.username AS operator_name,
|
||||
operator_users.email AS operator_email,
|
||||
CAST(EXTRACT(EPOCH FROM tx.created_at) AS BIGINT) AS created_at_unix_secs
|
||||
CAST(EXTRACT(EPOCH FROM tx.created_at) AS BIGINT) AS created_at_unix_ms
|
||||
FROM wallet_transactions tx
|
||||
JOIN wallets w ON w.id = tx.wallet_id
|
||||
LEFT JOIN users wallet_users ON wallet_users.id = w.user_id
|
||||
@@ -256,7 +256,7 @@ SELECT
|
||||
w.status AS wallet_status,
|
||||
wallet_users.username AS wallet_user_name,
|
||||
api_keys.name AS api_key_name,
|
||||
CAST(EXTRACT(EPOCH FROM rr.created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM rr.created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM rr.updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM rr.processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM rr.completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -296,7 +296,7 @@ SELECT
|
||||
tx.description,
|
||||
operator_users.username AS operator_name,
|
||||
operator_users.email AS operator_email,
|
||||
CAST(EXTRACT(EPOCH FROM tx.created_at) AS BIGINT) AS created_at_unix_secs
|
||||
CAST(EXTRACT(EPOCH FROM tx.created_at) AS BIGINT) AS created_at_unix_ms
|
||||
FROM wallet_transactions tx
|
||||
LEFT JOIN users operator_users
|
||||
ON operator_users.id = tx.operator_id
|
||||
@@ -384,7 +384,7 @@ SELECT
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -426,7 +426,7 @@ SELECT
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -462,7 +462,7 @@ SELECT
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -496,7 +496,7 @@ SELECT
|
||||
WHEN status = 'pending' AND expires_at IS NOT NULL AND expires_at < now() THEN 'expired'
|
||||
ELSE status
|
||||
END AS status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -526,7 +526,7 @@ SELECT
|
||||
WHEN status = 'pending' AND expires_at IS NOT NULL AND expires_at < now() THEN 'expired'
|
||||
ELSE status
|
||||
END AS status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -557,7 +557,7 @@ SELECT
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -586,7 +586,7 @@ SELECT
|
||||
status,
|
||||
payload,
|
||||
error_message,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs
|
||||
FROM payment_callbacks
|
||||
WHERE ($1::TEXT IS NULL OR payment_method = $1)
|
||||
@@ -1110,7 +1110,7 @@ RETURNING
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -1307,7 +1307,7 @@ RETURNING
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -1357,7 +1357,7 @@ SELECT
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -1509,7 +1509,7 @@ SELECT
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -1541,7 +1541,7 @@ SELECT
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -1803,7 +1803,7 @@ RETURNING
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -2020,7 +2020,7 @@ VALUES (
|
||||
operator_name: None,
|
||||
operator_email: None,
|
||||
description: Some(description),
|
||||
created_at_unix_secs: Some(created_at),
|
||||
created_at_unix_ms: Some(created_at),
|
||||
},
|
||||
)))
|
||||
})
|
||||
@@ -2238,7 +2238,7 @@ SELECT
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -2293,7 +2293,7 @@ SELECT
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -2434,7 +2434,7 @@ RETURNING
|
||||
let wallet = map_wallet_row(&wallet_row)?;
|
||||
|
||||
let transaction_id = Uuid::new_v4().to_string();
|
||||
let created_at_unix_secs = Utc::now().timestamp().max(0) as u64;
|
||||
let created_at_unix_ms = Utc::now().timestamp().max(0) as u64;
|
||||
sqlx::query(
|
||||
r#"
|
||||
INSERT INTO wallet_transactions (
|
||||
@@ -2520,7 +2520,7 @@ RETURNING
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -2553,7 +2553,7 @@ RETURNING
|
||||
operator_name: None,
|
||||
operator_email: None,
|
||||
description: Some("退款占款".to_string()),
|
||||
created_at_unix_secs: Some(created_at_unix_secs),
|
||||
created_at_unix_ms: Some(created_at_unix_ms),
|
||||
},
|
||||
)))
|
||||
})
|
||||
@@ -2622,7 +2622,7 @@ RETURNING
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -2680,7 +2680,7 @@ SELECT
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -2728,7 +2728,7 @@ RETURNING
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -2847,7 +2847,7 @@ RETURNING
|
||||
let wallet = map_wallet_row(&wallet_row)?;
|
||||
|
||||
let transaction_id = Uuid::new_v4().to_string();
|
||||
let created_at_unix_secs = Utc::now().timestamp().max(0) as u64;
|
||||
let created_at_unix_ms = Utc::now().timestamp().max(0) as u64;
|
||||
sqlx::query(
|
||||
r#"
|
||||
INSERT INTO wallet_transactions (
|
||||
@@ -2948,7 +2948,7 @@ RETURNING
|
||||
requested_by,
|
||||
approved_by,
|
||||
processed_by,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM updated_at) AS BIGINT) AS updated_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM processed_at) AS BIGINT) AS processed_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM completed_at) AS BIGINT) AS completed_at_unix_secs
|
||||
@@ -2981,7 +2981,7 @@ RETURNING
|
||||
operator_name: None,
|
||||
operator_email: None,
|
||||
description: Some("退款失败回补".to_string()),
|
||||
created_at_unix_secs: Some(created_at_unix_secs),
|
||||
created_at_unix_ms: Some(created_at_unix_ms),
|
||||
}),
|
||||
)))
|
||||
})
|
||||
@@ -3014,7 +3014,7 @@ SELECT
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -3077,7 +3077,7 @@ RETURNING
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -3122,7 +3122,7 @@ SELECT
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -3176,7 +3176,7 @@ RETURNING
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -3219,7 +3219,7 @@ SELECT
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -3412,7 +3412,7 @@ RETURNING
|
||||
gateway_order_id,
|
||||
gateway_response,
|
||||
status,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM created_at) AS BIGINT) AS created_at_unix_ms,
|
||||
CAST(EXTRACT(EPOCH FROM paid_at) AS BIGINT) AS paid_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM credited_at) AS BIGINT) AS credited_at_unix_secs,
|
||||
CAST(EXTRACT(EPOCH FROM expires_at) AS BIGINT) AS expires_at_unix_secs
|
||||
@@ -3574,8 +3574,8 @@ fn map_admin_wallet_list_item_row(
|
||||
total_adjusted: row_get(row, "total_adjusted")?,
|
||||
user_name: row_get(row, "user_name")?,
|
||||
api_key_name: row_get(row, "api_key_name")?,
|
||||
created_at_unix_secs: parse_optional_timestamp(
|
||||
row_get(row, "created_at_unix_secs")?,
|
||||
created_at_unix_ms: parse_optional_timestamp(
|
||||
row_get(row, "created_at_unix_ms")?,
|
||||
"wallets.created_at",
|
||||
)?,
|
||||
updated_at_unix_secs: parse_optional_timestamp(
|
||||
@@ -3611,8 +3611,8 @@ fn map_admin_wallet_ledger_item_row(
|
||||
wallet_api_key_id: row_get(row, "api_key_id")?,
|
||||
api_key_name: row_get(row, "api_key_name")?,
|
||||
wallet_status: row_get(row, "wallet_status")?,
|
||||
created_at_unix_secs: parse_optional_timestamp(
|
||||
row_get(row, "created_at_unix_secs")?,
|
||||
created_at_unix_ms: parse_optional_timestamp(
|
||||
row_get(row, "created_at_unix_ms")?,
|
||||
"wallet_transactions.created_at",
|
||||
)?,
|
||||
})
|
||||
@@ -3646,8 +3646,8 @@ fn map_admin_wallet_refund_request_item_row(
|
||||
wallet_api_key_id: row_get(row, "wallet_api_key_id")?,
|
||||
api_key_name: row_get(row, "api_key_name")?,
|
||||
wallet_status: row_get(row, "wallet_status")?,
|
||||
created_at_unix_secs: parse_optional_timestamp(
|
||||
row_get(row, "created_at_unix_secs")?,
|
||||
created_at_unix_ms: parse_optional_timestamp(
|
||||
row_get(row, "created_at_unix_ms")?,
|
||||
"refund_requests.created_at",
|
||||
)?,
|
||||
updated_at_unix_secs: parse_optional_timestamp(
|
||||
@@ -3686,8 +3686,8 @@ fn map_admin_wallet_transaction_row(
|
||||
operator_name: row_get(row, "operator_name")?,
|
||||
operator_email: row_get(row, "operator_email")?,
|
||||
description: row_get(row, "description")?,
|
||||
created_at_unix_secs: parse_optional_timestamp(
|
||||
row_get(row, "created_at_unix_secs")?,
|
||||
created_at_unix_ms: parse_optional_timestamp(
|
||||
row_get(row, "created_at_unix_ms")?,
|
||||
"wallet_transactions.created_at",
|
||||
)?,
|
||||
})
|
||||
@@ -3740,8 +3740,8 @@ fn map_admin_wallet_refund_row(row: &PgRow) -> Result<StoredAdminWalletRefund, D
|
||||
requested_by: row_get(row, "requested_by")?,
|
||||
approved_by: row_get(row, "approved_by")?,
|
||||
processed_by: row_get(row, "processed_by")?,
|
||||
created_at_unix_secs: parse_timestamp(
|
||||
row_get(row, "created_at_unix_secs")?,
|
||||
created_at_unix_ms: parse_timestamp(
|
||||
row_get(row, "created_at_unix_ms")?,
|
||||
"refund_requests.created_at",
|
||||
)?,
|
||||
updated_at_unix_secs: parse_timestamp(
|
||||
@@ -3774,8 +3774,8 @@ fn map_admin_payment_callback_row(
|
||||
status: row_get(row, "status")?,
|
||||
payload: row_get(row, "payload")?,
|
||||
error_message: row_get(row, "error_message")?,
|
||||
created_at_unix_secs: parse_timestamp(
|
||||
row_get(row, "created_at_unix_secs")?,
|
||||
created_at_unix_ms: parse_timestamp(
|
||||
row_get(row, "created_at_unix_ms")?,
|
||||
"payment_callbacks.created_at",
|
||||
)?,
|
||||
processed_at_unix_secs: parse_optional_timestamp(
|
||||
@@ -3801,8 +3801,8 @@ fn map_admin_payment_order_row(row: &PgRow) -> Result<StoredAdminPaymentOrder, D
|
||||
gateway_order_id: row_get(row, "gateway_order_id")?,
|
||||
gateway_response: row_get(row, "gateway_response")?,
|
||||
status: row_get(row, "status")?,
|
||||
created_at_unix_secs: parse_timestamp(
|
||||
row_get(row, "created_at_unix_secs")?,
|
||||
created_at_unix_ms: parse_timestamp(
|
||||
row_get(row, "created_at_unix_ms")?,
|
||||
"payment_orders.created_at",
|
||||
)?,
|
||||
paid_at_unix_secs: parse_optional_timestamp(
|
||||
|
||||
@@ -118,7 +118,7 @@ pub struct StoredAdminWalletListItem {
|
||||
pub total_adjusted: f64,
|
||||
pub user_name: Option<String>,
|
||||
pub api_key_name: Option<String>,
|
||||
pub created_at_unix_secs: Option<u64>,
|
||||
pub created_at_unix_ms: Option<u64>,
|
||||
pub updated_at_unix_secs: Option<u64>,
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ pub struct StoredAdminWalletLedgerItem {
|
||||
pub wallet_api_key_id: Option<String>,
|
||||
pub api_key_name: Option<String>,
|
||||
pub wallet_status: String,
|
||||
pub created_at_unix_secs: Option<u64>,
|
||||
pub created_at_unix_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)]
|
||||
@@ -203,7 +203,7 @@ pub struct StoredAdminWalletRefundRequestItem {
|
||||
pub wallet_api_key_id: Option<String>,
|
||||
pub api_key_name: Option<String>,
|
||||
pub wallet_status: String,
|
||||
pub created_at_unix_secs: Option<u64>,
|
||||
pub created_at_unix_ms: Option<u64>,
|
||||
pub updated_at_unix_secs: Option<u64>,
|
||||
pub processed_at_unix_secs: Option<u64>,
|
||||
pub completed_at_unix_secs: Option<u64>,
|
||||
@@ -234,7 +234,7 @@ pub struct StoredAdminWalletTransaction {
|
||||
pub operator_name: Option<String>,
|
||||
pub operator_email: Option<String>,
|
||||
pub description: Option<String>,
|
||||
pub created_at_unix_secs: Option<u64>,
|
||||
pub created_at_unix_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
@@ -254,7 +254,7 @@ pub struct AdminWalletTransactionRecord {
|
||||
pub link_id: Option<String>,
|
||||
pub operator_id: Option<String>,
|
||||
pub description: Option<String>,
|
||||
pub created_at_unix_secs: u64,
|
||||
pub created_at_unix_ms: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)]
|
||||
@@ -306,7 +306,7 @@ pub struct StoredAdminWalletRefund {
|
||||
pub requested_by: Option<String>,
|
||||
pub approved_by: Option<String>,
|
||||
pub processed_by: Option<String>,
|
||||
pub created_at_unix_secs: u64,
|
||||
pub created_at_unix_ms: u64,
|
||||
pub updated_at_unix_secs: u64,
|
||||
pub processed_at_unix_secs: Option<u64>,
|
||||
pub completed_at_unix_secs: Option<u64>,
|
||||
@@ -333,7 +333,7 @@ pub struct AdminWalletRefundRecord {
|
||||
pub requested_by: Option<String>,
|
||||
pub approved_by: Option<String>,
|
||||
pub processed_by: Option<String>,
|
||||
pub created_at_unix_secs: u64,
|
||||
pub created_at_unix_ms: u64,
|
||||
pub updated_at_unix_secs: u64,
|
||||
pub processed_at_unix_secs: Option<u64>,
|
||||
pub completed_at_unix_secs: Option<u64>,
|
||||
@@ -369,7 +369,7 @@ pub struct StoredAdminPaymentOrder {
|
||||
pub gateway_order_id: Option<String>,
|
||||
pub gateway_response: Option<serde_json::Value>,
|
||||
pub status: String,
|
||||
pub created_at_unix_secs: u64,
|
||||
pub created_at_unix_ms: u64,
|
||||
pub paid_at_unix_secs: Option<u64>,
|
||||
pub credited_at_unix_secs: Option<u64>,
|
||||
pub expires_at_unix_secs: Option<u64>,
|
||||
@@ -391,7 +391,7 @@ pub struct AdminWalletPaymentOrderRecord {
|
||||
pub gateway_order_id: Option<String>,
|
||||
pub status: String,
|
||||
pub gateway_response: Option<serde_json::Value>,
|
||||
pub created_at_unix_secs: u64,
|
||||
pub created_at_unix_ms: u64,
|
||||
pub paid_at_unix_secs: Option<u64>,
|
||||
pub credited_at_unix_secs: Option<u64>,
|
||||
pub expires_at_unix_secs: Option<u64>,
|
||||
@@ -416,7 +416,7 @@ pub struct StoredAdminPaymentCallback {
|
||||
pub status: String,
|
||||
pub payload: Option<serde_json::Value>,
|
||||
pub error_message: Option<String>,
|
||||
pub created_at_unix_secs: u64,
|
||||
pub created_at_unix_ms: u64,
|
||||
pub processed_at_unix_secs: Option<u64>,
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ pub struct AdminPaymentCallbackRecord {
|
||||
pub status: String,
|
||||
pub payload: Option<serde_json::Value>,
|
||||
pub error_message: Option<String>,
|
||||
pub created_at_unix_secs: u64,
|
||||
pub created_at_unix_ms: u64,
|
||||
pub processed_at_unix_secs: Option<u64>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user