refactor: agentic comment cleanup

This commit is contained in:
talksik
2026-05-18 10:52:37 -07:00
parent 6f476fe773
commit 4421b8e832
45 changed files with 269 additions and 545 deletions
+8 -12
View File
@@ -6,22 +6,18 @@ import (
"github.com/jackc/pgx/v5/pgxpool"
)
// Service is the full surface for per-device push token storage. HTTP handlers
// use Register/Unregister; the worker's notifier uses ListForHumans and
// DeleteByToken. Both consumers share the same underlying repository.
// Service stores per-device Expo push tokens and exposes the operations
// needed by both the HTTP handlers and the worker-side notifier.
type Service interface {
// Register upserts a token for the given human. Returns ErrInvalidToken /
// ErrInvalidPlatform on bad input.
// Register returns ErrInvalidToken / ErrInvalidPlatform on bad input.
Register(ctx context.Context, humanID string, in RegisterInput) error
// Unregister removes a token, scoped to the calling human so a user can't
// delete another user's token. Returns ErrNotFound if the token doesn't
// belong to humanID (or doesn't exist).
// Unregister is scoped to humanID so a user can't delete another user's
// token. Returns ErrNotFound if the token isn't owned by humanID.
Unregister(ctx context.Context, humanID, token string) error
// ListForHumans returns every push token belonging to any of the given
// human IDs. Returns an empty slice when nothing matches.
// ListForHumans returns an empty slice when nothing matches.
ListForHumans(ctx context.Context, humanIDs []string) ([]*PushToken, error)
// DeleteByToken removes a token regardless of owning human. Used by the
// notifier to clean up after Expo returns DeviceNotRegistered.
// DeleteByToken removes a token regardless of owner — used to prune after
// Expo reports DeviceNotRegistered.
DeleteByToken(ctx context.Context, token string) error
}