feat(kol): marketplace and admin subscription repo queries
This commit is contained in:
@@ -151,6 +151,31 @@ func (q *Queries) GetKolSubscriptionByID(ctx context.Context, arg GetKolSubscrip
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getKolSubscriptionByIDAny = `-- name: GetKolSubscriptionByIDAny :one
|
||||
SELECT id, tenant_id, package_id, status, approved_by, start_at, end_at, created_at, updated_at
|
||||
FROM kol_subscriptions
|
||||
WHERE id = $1
|
||||
`
|
||||
|
||||
// Cross-tenant read: V1 tenant-admin endpoints temporarily manage subscriptions here
|
||||
// until a dedicated platform-api exists.
|
||||
func (q *Queries) GetKolSubscriptionByIDAny(ctx context.Context, id int64) (KolSubscription, error) {
|
||||
row := q.db.QueryRow(ctx, getKolSubscriptionByIDAny, id)
|
||||
var i KolSubscription
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.TenantID,
|
||||
&i.PackageID,
|
||||
&i.Status,
|
||||
&i.ApprovedBy,
|
||||
&i.StartAt,
|
||||
&i.EndAt,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getSubscriptionPromptByID = `-- name: GetSubscriptionPromptByID :one
|
||||
SELECT sp.id, sp.tenant_id, sp.subscription_id, sp.package_id, sp.prompt_id,
|
||||
sp.status, sp.granted_at, sp.revoked_at,
|
||||
|
||||
Reference in New Issue
Block a user