Files
member-console/internal/entitlements/queries/entitlement_sets.sql
T
cgalo5758 71818de0bd Add setup checklist and empty-state guidance
Implement the ux-first-run change: a state-derived setup checklist on
/operator/setup with a landing region that recedes once required steps
are done, and empty states that distinguish blocked from empty across
operator and member surfaces. Also add production deployment and
environment reference docs, plus a config-key completeness test.
2026-08-23 03:06:11 -05:00

28 lines
768 B
SQL

-- name: GetEntitlementSetByID :one
SELECT * FROM core.entitlement_sets
WHERE set_id = $1;
-- name: ListEntitlementSets :many
SELECT * FROM core.entitlement_sets
ORDER BY name ASC;
-- name: ListActiveEntitlementSets :many
SELECT * FROM core.entitlement_sets
WHERE is_active = TRUE
ORDER BY name ASC;
-- name: CreateEntitlementSet :one
INSERT INTO core.entitlement_sets (name, description, is_active)
VALUES ($1, $2, $3)
RETURNING *;
-- name: UpdateEntitlementSet :one
UPDATE core.entitlement_sets
SET name = $2, description = $3, is_active = $4
WHERE set_id = $1
RETURNING *;
-- name: AnyActiveEntitlementSet :one
-- Setup-checklist existence probe: the whole-table answer, not a lookup.
SELECT EXISTS(SELECT 1 FROM core.entitlement_sets WHERE is_active = TRUE);