Files
member-console/internal/entitlements/queries/resource_pools.sql
Christian Galo 8f6a93f74d Add operator enrollment UI and plan docs
Introduce operator enrollment partials and handlers that route plan-tier
granting and revocation through entitlements.Transition(). Add
member-facing
tier labels, plan architecture and grant-plan-safety documentation, plus
unit and e2e tests. Also add small querier helpers and wire Temporal
client
hooks for trial expiration scheduling.
2026-04-24 12:28:00 -05:00

19 lines
570 B
SQL

-- name: CreateResourcePool :one
INSERT INTO entitlements.resource_pools (org_id, name, slug, pool_type, is_auto_managed)
VALUES ($1, $2, $3, $4, $5)
RETURNING *;
-- name: GetResourcePoolByID :one
SELECT * FROM entitlements.resource_pools
WHERE pool_id = $1;
-- name: GetDefaultPoolByOrgID :one
SELECT * FROM entitlements.resource_pools
WHERE org_id = $1 AND pool_type = 'default' AND status = 'active'
LIMIT 1;
-- name: GetResourcePoolsByOrgID :many
SELECT * FROM entitlements.resource_pools
WHERE org_id = $1 AND status = 'active'
ORDER BY pool_type ASC, name ASC;