Files
member-console/internal/instance/instance_settings.sql.go
T
cgalo5758 8608c871de Apply the acceptance fixes and archive the change (10k.4)
Six review rounds on the September walk's 40 findings, executed as the
acceptance-fixes change (design D1 to D31) and archived as
openspec/changes/archive/2026-09-03-acceptance-fixes/ with its 20
deltas synced into openspec/specs.

Shell and conventions: the location trail on every page rooted at the
surface; click-opened help popovers; buttons by role with the pressed
rule retired and tertiary openers with a rotating plus; the code chip
and white card headers; Remove versus Delete on row actions.

Operator surface: three overview tiles, one Integrations card, the
getting-started banner as the first instance setting
(core.instance_settings, migration 00015); record creation on its own
page for products, entitlement sets, and plan ladders; Visibility as
one Public checkbox; the Stripe provider page; the plan ladder
validation page retired and ranks ascending; org-types default change
with dispositions, Discard, and the settle-cloning fix; the rebuilt
composite billing card; hints instead of placeholders; the person page's
identity-provider glyph on its field labels; non-UUID ids answer 404.

Found by review and fixed: a session now ends when its person no longer
exists (the foreign-key failure on a ladder reorder after a snapshot
rebuild); the CSRF cookie lives as long as the session and its toast
says the page is out of date; htmx's settle delay is 0 app-wide.

Verification: unit suites, browser walkthroughs, the screens baseline
(31 screens, accepted), and Lighthouse at 100 on both widths, recorded
in docs/operator-a11y-baseline.md. Three stale issue entries archived.
2026-09-03 17:00:14 -05:00

49 lines
1.2 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.29.0
// source: instance_settings.sql
package instance
import (
"context"
"database/sql"
"encoding/json"
)
const getInstanceSetting = `-- name: GetInstanceSetting :one
SELECT key, value, updated_at, updated_by
FROM core.instance_settings
WHERE key = $1
`
func (q *Queries) GetInstanceSetting(ctx context.Context, key string) (CoreInstanceSetting, error) {
row := q.db.QueryRowContext(ctx, getInstanceSetting, key)
var i CoreInstanceSetting
err := row.Scan(
&i.Key,
&i.Value,
&i.UpdatedAt,
&i.UpdatedBy,
)
return i, err
}
const upsertInstanceSetting = `-- name: UpsertInstanceSetting :exec
INSERT INTO core.instance_settings (key, value, updated_by)
VALUES ($1, $2, $3)
ON CONFLICT (key) DO UPDATE
SET value = EXCLUDED.value, updated_by = EXCLUDED.updated_by, updated_at = NOW()
`
type UpsertInstanceSettingParams struct {
Key string `json:"key"`
Value json.RawMessage `json:"value"`
UpdatedBy sql.NullString `json:"updated_by"`
}
func (q *Queries) UpsertInstanceSetting(ctx context.Context, arg UpsertInstanceSettingParams) error {
_, err := q.db.ExecContext(ctx, upsertInstanceSetting, arg.Key, arg.Value, arg.UpdatedBy)
return err
}