feat(notification): add Resend quota gate and waiting-for-reset state

This commit is contained in:
shira committed 2026-10-06 11:50:38 +03:00
1 parent 3b917befa9
commit b856d4ff54
40 files changed
+4116 -48

No files matched your search

+18
View File
@@ -201,3 +201,21 @@ FOR UPDATE;
-- name: DeleteMailRequest :execrows
DELETE FROM mail_requests
WHERE id = sqlc.arg(id);
-- Reads the status of the newest delivery of a kind addressed to an account,
-- for the account's own view of its mail. It selects no address and no
-- content. The recipient index narrows the scan to the account's rows.
-- name: GetLatestDeliveryStatus :one
SELECT
id,
kind,
status,
next_attempt_at,
created_at,
updated_at
FROM deliveries
WHERE
recipient_user_id = sqlc.arg(recipient_user_id)
AND kind = sqlc.arg(kind)
ORDER BY created_at DESC, id DESC
LIMIT 1;