feat: backend service

This commit is contained in:
Ilia Denisov
2026-05-06 10:14:55 +03:00
committed by GitHub
parent 3e2622757e
commit f446c6a2ac
1486 changed files with 49720 additions and 266401 deletions
+22
View File
@@ -0,0 +1,22 @@
package notification
import "errors"
// ErrNotificationNotFound is returned by AdminGetNotification when no
// row matches the supplied identifier. Handlers map it to HTTP 404.
var ErrNotificationNotFound = errors.New("notification: notification not found")
// ErrUnknownKind is returned by Submit when the intent's Kind is not in
// the catalog (`backend/README.md` §10). Submit does not surface it to
// the producer — it persists a malformed-intent record and returns nil.
// The exported sentinel exists so the package internals can branch on it.
var ErrUnknownKind = errors.New("notification: unknown kind")
// ErrEmptyIdempotencyKey is returned by Submit when the intent does not
// carry an idempotency_key. Same surface treatment as ErrUnknownKind.
var ErrEmptyIdempotencyKey = errors.New("notification: idempotency_key must be non-empty")
// ErrNoRecipients is returned by Submit when a kind that requires user
// recipients arrives without any. Same surface treatment as
// ErrUnknownKind.
var ErrNoRecipients = errors.New("notification: at least one recipient is required")