Files
member-console/internal/integrations/stripe/store/payment_method_mappings.sql.go
T
cgalo5758 1a8e13f880 Extract integrations into registered trees
Add an explicit registry with capability hooks for migrations, routes,
workflows, config, and UI assets. Move FedWiki fully and Stripe's
separable
store, workflow, and webhook pieces under internal/integrations.

Drive startup wiring from declarations, including config validation,
secret
file pairs, CSRF exemptions, UI composition, and workflow startup. Move
integration DB roles and grants into their owning migration streams, and
route outbox writes through a shared enqueue helper.
2026-07-06 11:01:07 -05:00

77 lines
2.6 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.29.0
// source: payment_method_mappings.sql
package stripe
import (
"context"
"database/sql"
)
const getPaymentMethodMappingByPaymentMethodID = `-- name: GetPaymentMethodMappingByPaymentMethodID :one
SELECT payment_method_id, stripe_payment_method_id, sync_status, created_at, updated_at FROM stripe.payment_method_mappings
WHERE payment_method_id = $1
`
func (q *Queries) GetPaymentMethodMappingByPaymentMethodID(ctx context.Context, paymentMethodID string) (PaymentMethodMapping, error) {
row := q.db.QueryRowContext(ctx, getPaymentMethodMappingByPaymentMethodID, paymentMethodID)
var i PaymentMethodMapping
err := row.Scan(
&i.PaymentMethodID,
&i.StripePaymentMethodID,
&i.SyncStatus,
&i.CreatedAt,
&i.UpdatedAt,
)
return i, err
}
const getPaymentMethodMappingByStripeID = `-- name: GetPaymentMethodMappingByStripeID :one
SELECT payment_method_id, stripe_payment_method_id, sync_status, created_at, updated_at FROM stripe.payment_method_mappings
WHERE stripe_payment_method_id = $1
`
func (q *Queries) GetPaymentMethodMappingByStripeID(ctx context.Context, stripePaymentMethodID sql.NullString) (PaymentMethodMapping, error) {
row := q.db.QueryRowContext(ctx, getPaymentMethodMappingByStripeID, stripePaymentMethodID)
var i PaymentMethodMapping
err := row.Scan(
&i.PaymentMethodID,
&i.StripePaymentMethodID,
&i.SyncStatus,
&i.CreatedAt,
&i.UpdatedAt,
)
return i, err
}
const upsertPaymentMethodMapping = `-- 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 payment_method_id, stripe_payment_method_id, sync_status, created_at, updated_at
`
type UpsertPaymentMethodMappingParams struct {
PaymentMethodID string `json:"payment_method_id"`
StripePaymentMethodID sql.NullString `json:"stripe_payment_method_id"`
SyncStatus string `json:"sync_status"`
}
func (q *Queries) UpsertPaymentMethodMapping(ctx context.Context, arg UpsertPaymentMethodMappingParams) (PaymentMethodMapping, error) {
row := q.db.QueryRowContext(ctx, upsertPaymentMethodMapping, arg.PaymentMethodID, arg.StripePaymentMethodID, arg.SyncStatus)
var i PaymentMethodMapping
err := row.Scan(
&i.PaymentMethodID,
&i.StripePaymentMethodID,
&i.SyncStatus,
&i.CreatedAt,
&i.UpdatedAt,
)
return i, err
}