feat(accounts): add consent settings and organization management

This commit is contained in:
TakuyaYagam1 committed 2026-10-07 13:00:39 +03:00
1 parent 24638d46d2
commit 391af7a1ef
83 files changed
+10198 -613

No files matched your search

+17
View File
@@ -222,3 +222,20 @@ FROM memberships
WHERE
organization_id = sqlc.arg(organization_id)
AND user_id = sqlc.arg(user_id);
-- Stores the immutable domain snapshot of a successful create command. The
-- generic idempotency row and this result are committed with the organization
-- and owner membership. A reused expired scope replaces the snapshot in the
-- same transaction as the new organization.
-- name: SaveOrganizationCreationResult :exec
INSERT INTO organization_creation_results (scope_hash, snapshot)
VALUES (sqlc.arg(scope_hash), sqlc.arg(snapshot))
ON CONFLICT (scope_hash) DO UPDATE
SET snapshot = excluded.snapshot;
-- Reads only the historical result. It intentionally does not join the live
-- organization or membership, whose profile and state may have since changed.
-- name: GetOrganizationCreationResult :one
SELECT snapshot
FROM organization_creation_results
WHERE scope_hash = sqlc.arg(scope_hash);