feat(invitations): check contact grants on every read, cap pending invitations, and expire them at the deadline
This commit is contained in:
1 parent
676b3c6e24
commit
12a7213d4a
67 files changed
+4255
-149
No files matched your search
@@ -0,0 +1,11 @@
|
||||
-- Counts the invitations of one organization need that wait for an answer:
|
||||
-- delivered, viewed, or the planned counter offer. The send counts them under
|
||||
-- the organization lock, which every send takes first, so no other send can
|
||||
-- add a waiting invitation between the count and its own delivery.
|
||||
-- name: CountPendingNeedInvitations :one
|
||||
SELECT count(*)::bigint AS pending
|
||||
FROM invitations
|
||||
WHERE
|
||||
organization_id = sqlc.arg(organization_id)
|
||||
AND need_id = sqlc.arg(need_id)
|
||||
AND state IN ('delivered', 'viewed', 'counter');
|
||||
Reference in new issue
Block a user