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

@@ -0,0 +1,25 @@
-- +goose Up
-- Replay follows the generic record's 24-hour retention. Expired records are
-- removed by bounded opportunistic purges, so physical deletion may happen
-- later; this foreign key removes the snapshot with its record. The snapshot
-- is separate from the live organization so later profile edits cannot change
-- a replay. It contains bounded profile and owner-membership data, never a
-- request key.
CREATE TABLE organization_creation_results (
scope_hash bytea NOT NULL,
snapshot jsonb NOT NULL,
CONSTRAINT organization_creation_results_pkey PRIMARY KEY (scope_hash),
CONSTRAINT organization_creation_results_idempotency_fkey FOREIGN KEY (
scope_hash
) REFERENCES idempotency_records (scope_hash) ON DELETE CASCADE,
CONSTRAINT organization_creation_results_scope_hash_sha256 CHECK (
octet_length(scope_hash) = 32
),
CONSTRAINT organization_creation_results_snapshot_bounded CHECK (
jsonb_typeof(snapshot) = 'object'
AND octet_length(snapshot::text) <= 65536
)
);
-- +goose Down
DROP TABLE organization_creation_results;