-- name: UpsertPaymentMethodMapping :one
INSERT INTO stripe.payment_method_mappings (payment_method_id, stripe_payment_method_id, sync_status)
VALUES ($1, $2, $3)
ON CONFLICT (payment_method_id) DO UPDATE
SET stripe_payment_method_id = EXCLUDED.stripe_payment_method_id,
    sync_status = EXCLUDED.sync_status,
    updated_at = NOW()
RETURNING *;

-- name: GetPaymentMethodMappingByStripeID :one
SELECT * FROM stripe.payment_method_mappings
WHERE stripe_payment_method_id = $1;

-- name: GetPaymentMethodMappingByPaymentMethodID :one
SELECT * FROM stripe.payment_method_mappings
WHERE payment_method_id = $1;
