Add default_plan_ladder_id with a forward data migration and update the runtime to resolve the ladder's rank-0 tier at use-time. Regenerate sqlc, update auto-provisioning, ReapplyDefaultsForPool, operator UI and tests; add GetTierByLadderRank and pool/provision query helpers. Add a CSP-safe confirm-action modal and wire operator actions to it. Close plan-sole-writer safety gaps and serialize IssueGrant with a FOR UPDATE pool lock to prevent ladder races.
75 lines
5.5 KiB
Go
75 lines
5.5 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.29.0
|
|
|
|
package entitlements
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Querier interface {
|
|
AtomicDecrementUsage(ctx context.Context, arg AtomicDecrementUsageParams) (sql.Result, error)
|
|
AtomicIncrementUsage(ctx context.Context, arg AtomicIncrementUsageParams) (sql.Result, error)
|
|
CountActiveAttachmentsByLadder(ctx context.Context, planLadderID string) (int64, error)
|
|
CountActiveAttachmentsByTier(ctx context.Context, arg CountActiveAttachmentsByTierParams) (int64, error)
|
|
CreateEntitlementSet(ctx context.Context, arg CreateEntitlementSetParams) (EntitlementSet, error)
|
|
CreateEntitlementSetRule(ctx context.Context, arg CreateEntitlementSetRuleParams) (EntitlementSetRule, error)
|
|
CreateGrant(ctx context.Context, arg CreateGrantParams) (Grant, error)
|
|
CreateNumericEntitlement(ctx context.Context, arg CreateNumericEntitlementParams) (NumericEntitlement, error)
|
|
CreateNumericEntitlementContribution(ctx context.Context, arg CreateNumericEntitlementContributionParams) (NumericEntitlementContribution, error)
|
|
CreateNumericEntitlementUsage(ctx context.Context, arg CreateNumericEntitlementUsageParams) (NumericEntitlementUsage, error)
|
|
CreatePoolAssignment(ctx context.Context, arg CreatePoolAssignmentParams) (PoolAssignment, error)
|
|
CreatePoolProvision(ctx context.Context, arg CreatePoolProvisionParams) (PoolProvision, error)
|
|
CreatePoolProvisionLadder(ctx context.Context, arg CreatePoolProvisionLadderParams) (PoolProvisionLadder, error)
|
|
CreatePoolProvisionTransition(ctx context.Context, arg CreatePoolProvisionTransitionParams) (PoolProvisionTransition, error)
|
|
CreateResourcePool(ctx context.Context, arg CreateResourcePoolParams) (ResourcePool, error)
|
|
CreateSubscriptionPoolProvision(ctx context.Context, arg CreateSubscriptionPoolProvisionParams) (PoolProvision, error)
|
|
DeleteContributionsByProvisionID(ctx context.Context, provisionID string) error
|
|
DeleteEntitlementSetRule(ctx context.Context, ruleID string) error
|
|
EndPoolProvisionLadder(ctx context.Context, arg EndPoolProvisionLadderParams) (PoolProvisionLadder, error)
|
|
GetActiveAttachmentsByPool(ctx context.Context, poolID string) ([]PoolProvisionLadder, error)
|
|
GetActiveLadderAttachmentByPoolLadder(ctx context.Context, arg GetActiveLadderAttachmentByPoolLadderParams) (PoolProvisionLadder, error)
|
|
GetActivePoolProvisionsByPoolID(ctx context.Context, poolID string) ([]PoolProvision, error)
|
|
GetActiveRulesBySetID(ctx context.Context, setID string) ([]EntitlementSetRule, error)
|
|
GetDefaultPoolByOrgID(ctx context.Context, orgID string) (ResourcePool, error)
|
|
GetEntitlementSetByID(ctx context.Context, setID string) (EntitlementSet, error)
|
|
GetGrantByID(ctx context.Context, grantID string) (Grant, error)
|
|
// Walks the ancestry chain of the focal grant via extends_grant_id, returning
|
|
// the focal grant first followed by each ancestor (parent, grandparent, ...)
|
|
// in chain-walk order. Revoked or expired ancestors are included; lineage is
|
|
// about who-came-before, not current validity.
|
|
GetGrantLineage(ctx context.Context, grantID string) ([]GetGrantLineageRow, error)
|
|
GetLadderAttachmentsByPool(ctx context.Context, poolID string) ([]PoolProvisionLadder, error)
|
|
GetLadderAttachmentsByProvision(ctx context.Context, provisionID string) ([]PoolProvisionLadder, error)
|
|
GetNumericEntitlementByPoolAndResource(ctx context.Context, arg GetNumericEntitlementByPoolAndResourceParams) (NumericEntitlement, error)
|
|
GetPoolProvisionByGrantID(ctx context.Context, grantID uuid.NullUUID) (PoolProvision, error)
|
|
GetPoolProvisionByProvisionID(ctx context.Context, provisionID string) (PoolProvision, error)
|
|
GetPoolProvisionBySubscriptionID(ctx context.Context, subscriptionID uuid.NullUUID) (PoolProvision, error)
|
|
GetPoolProvisionsByPoolID(ctx context.Context, poolID string) ([]PoolProvision, error)
|
|
GetPrimaryPoolAssignmentByWorkspace(ctx context.Context, workspaceID string) (PoolAssignment, error)
|
|
GetResourcePoolByID(ctx context.Context, poolID string) (ResourcePool, error)
|
|
GetResourcePoolsByOrgID(ctx context.Context, orgID string) ([]ResourcePool, error)
|
|
GetUsageByPoolAndResource(ctx context.Context, arg GetUsageByPoolAndResourceParams) (NumericEntitlementUsage, error)
|
|
ListActiveEntitlementSets(ctx context.Context) ([]EntitlementSet, error)
|
|
ListAllGrants(ctx context.Context) ([]Grant, error)
|
|
ListContributionsByEntitlementID(ctx context.Context, entitlementID string) ([]NumericEntitlementContribution, error)
|
|
ListEntitlementSets(ctx context.Context) ([]EntitlementSet, error)
|
|
ListGrantsByOrgID(ctx context.Context, grantedToOrgID uuid.NullUUID) ([]Grant, error)
|
|
ListNumericEntitlementUsageByPoolID(ctx context.Context, poolID string) ([]NumericEntitlementUsage, error)
|
|
ListNumericEntitlementsByPoolID(ctx context.Context, poolID string) ([]NumericEntitlement, error)
|
|
ListResourceKeys(ctx context.Context) ([]ResourceKey, error)
|
|
ListTransitionsByPool(ctx context.Context, poolID string) ([]PoolProvisionTransition, error)
|
|
ListTransitionsByProvision(ctx context.Context, provisionID uuid.NullUUID) ([]PoolProvisionTransition, error)
|
|
RevokeGrant(ctx context.Context, arg RevokeGrantParams) (Grant, error)
|
|
UpdateEntitlementSet(ctx context.Context, arg UpdateEntitlementSetParams) (EntitlementSet, error)
|
|
UpdateEntitlementSetRule(ctx context.Context, arg UpdateEntitlementSetRuleParams) (EntitlementSetRule, error)
|
|
UpdateNumericEntitlementLimit(ctx context.Context, arg UpdateNumericEntitlementLimitParams) (NumericEntitlement, error)
|
|
UpdatePoolProvisionStatus(ctx context.Context, arg UpdatePoolProvisionStatusParams) (PoolProvision, error)
|
|
}
|
|
|
|
var _ Querier = (*Queries)(nil)
|