feat(notifications): send product notifications with a rights check right before each send

This commit is contained in:
shira committed 2026-10-09 20:38:39 +03:00
1 parent a856066316
commit 623d41b969
59 files changed
+4125 -1126

No files matched your search

@@ -193,8 +193,26 @@ type DeliveryRetrySnapshot struct {
ManualRetryStartedAt time.Time
}
// ClaimScope names the lane a claim serves. Each lane has its own claim
// statement and partial due index, so an idle poll of one lane never reads
// the backlog of the other.
type ClaimScope int
const (
// ClaimScopeService claims service identity mail: verification and
// password reset, through deliveries_due_idx. It is the zero value, so a
// claim that names no lane is a service claim.
ClaimScopeService ClaimScope = iota
// ClaimScopeNotification claims product notifications, through
// deliveries_product_due_idx.
ClaimScopeNotification
)
// DeliveryClaim selects and leases the next delivery for a sending worker.
type DeliveryClaim struct {
// Scope selects the lane and its claim statement. Kinds must be the kinds
// of that lane.
Scope ClaimScope
// Owner identifies the worker; a lease belongs to it.
Owner uuid.UUID
// Account is the configured provider account. Only deliveries pinned to