feat(invitations): accept invitations with C4 consent and contact grants; share the E0 quota across holdings

This commit is contained in:
shira committed 2026-10-09 18:03:35 +03:00
1 parent a5990d3fc6
commit 676b3c6e24
59 files changed
+4926 -194

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
-- Stores the holding of a founder account unless the account already has one.
-- A concurrent creation of the same account waits on the founder key until the
-- other transaction ends; then this insert does nothing, and the caller reads
-- the stored holding with GetHoldingIDByFounder.
-- name: InsertHoldingIfAbsent :exec
INSERT INTO holdings (
id,
founder_account_id,
created_at
) VALUES (
sqlc.arg(id),
sqlc.arg(founder_account_id),
sqlc.arg(created_at)
)
ON CONFLICT (founder_account_id) DO NOTHING;
-- name: GetHoldingIDByFounder :one
SELECT id
FROM holdings
WHERE founder_account_id = sqlc.arg(founder_account_id);