slack5-1770544098/services/preferences-api/internal/port/preferences.go
rdev-worker a31f57382b
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature user-preferences
2026-02-08 10:47:23 +00:00

20 lines
722 B
Go

package port
import (
"context"
"git.threesix.ai/jordan/slack5-1770544098/services/preferences-api/internal/domain"
)
// PreferencesRepository defines the interface for user preferences persistence.
type PreferencesRepository interface {
// Get returns preferences for a user by ID.
// Returns nil (not error) when no preferences exist for the user.
Get(ctx context.Context, userID string) (*domain.UserPreferences, error)
// Upsert creates or updates preferences for a user.
// Only provided keys are changed; omitted keys are preserved (merge behavior).
// Returns the full merged preferences after upsert.
Upsert(ctx context.Context, userID string, prefs map[string]any) (*domain.UserPreferences, error)
}