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.
19 lines
570 B
SQL
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;
|