-- name: CreateDirectDeposit :one
INSERT INTO direct_deposits (
    customer_id,
    wallet_id,
    amount,
    bank_reference,
    sender_account,
    status
) VALUES (
    $1, $2, $3, $4, $5, $6
) RETURNING *;

-- name: GetDirectDeposit :one
SELECT * FROM direct_deposits WHERE id = $1;

-- name: UpdateDirectDeposit :one
UPDATE direct_deposits
SET
    status = $2,
    verified_by = $3,
    verification_notes = $4,
    verified_at = $5
WHERE id = $1
RETURNING *;

-- name: GetDirectDepositsByStatus :many
SELECT * FROM direct_deposits WHERE status = $1 ORDER BY created_at DESC;

-- name: GetCustomerDirectDeposits :many
SELECT * FROM direct_deposits WHERE customer_id = $1 ORDER BY created_at DESC;