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

@@ -416,8 +416,13 @@ func TestCandidatePrivacyStorage(t *testing.T) {
}
defer func() { _ = tx.Rollback(ctx) }()
if _, err := tx.Exec(ctx, `
INSERT INTO organizations (id, name, verification_level, verification_basis, verification_changed_at, version, created_at, updated_at)
SELECT gen_random_uuid(), 'Bulk ' || n, 'e0', 'confirmed_email', $1, 1, $1, $1 FROM generate_series(1, $2::int) AS n`, now, limit+1); err != nil {
INSERT INTO holdings (id, founder_account_id, created_at) VALUES (gen_random_uuid(), $1, $2)`, employer.ID, now); err != nil {
t.Fatalf("create holding: %v", err)
}
if _, err := tx.Exec(ctx, `
INSERT INTO organizations (id, name, verification_level, verification_basis, verification_changed_at, version, created_at, updated_at, holding_id)
SELECT gen_random_uuid(), 'Bulk ' || n, 'e0', 'confirmed_email', $1, 1, $1, $1, (SELECT id FROM holdings WHERE founder_account_id = $3)
FROM generate_series(1, $2::int) AS n`, now, limit+1, employer.ID); err != nil {
t.Fatalf("create organizations: %v", err)
}
if _, err := tx.Exec(ctx, `
@@ -696,8 +701,13 @@ func TestCandidatePrivacyStorage(t *testing.T) {
t.Fatalf("begin: %v", err)
}
if _, err := tx.Exec(ctx, `
INSERT INTO organizations (id, name, verification_level, verification_basis, verification_changed_at, version, created_at, updated_at)
SELECT gen_random_uuid(), 'Bulk ' || n, 'e0', 'confirmed_email', $1, 1, $1, $1 FROM generate_series(1, $2::int) AS n`, now, limit-1+parallel); err != nil {
INSERT INTO holdings (id, founder_account_id, created_at) VALUES (gen_random_uuid(), $1, $2)`, employer.ID, now); err != nil {
t.Fatalf("create holding: %v", err)
}
if _, err := tx.Exec(ctx, `
INSERT INTO organizations (id, name, verification_level, verification_basis, verification_changed_at, version, created_at, updated_at, holding_id)
SELECT gen_random_uuid(), 'Bulk ' || n, 'e0', 'confirmed_email', $1, 1, $1, $1, (SELECT id FROM holdings WHERE founder_account_id = $3)
FROM generate_series(1, $2::int) AS n`, now, limit-1+parallel, employer.ID); err != nil {
t.Fatalf("create organizations: %v", err)
}
if _, err := tx.Exec(ctx, `