slack5-1770574304/services/preferences-api/internal/port/preferences.go
rdev-worker 5fa5a77bfb
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature user-preferences
2026-02-08 18:36:52 +00:00

19 lines
646 B
Go

package port
import (
"context"
"git.threesix.ai/jordan/slack5-1770574304/services/preferences-api/internal/domain"
)
// PreferenceRepository defines the interface for user preference persistence.
// Implementations may use databases, in-memory storage, or external services.
type PreferenceRepository interface {
// Get returns the preferences for a user by ID.
// Returns nil, nil when no preferences exist (service applies defaults).
Get(ctx context.Context, userID string) (*domain.UserPreferences, error)
// Upsert creates or replaces the preferences for a user.
Upsert(ctx context.Context, prefs *domain.UserPreferences) error
}