slack5-1770606136/services/preferences-api/internal/port/preference.go
rdev-worker a0ff64af5e
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature user-preferences
2026-02-09 03:30:01 +00:00

19 lines
611 B
Go

package port
import (
"context"
"git.threesix.ai/jordan/slack5-1770606136/services/preferences-api/internal/domain"
)
// PreferenceRepository defines the interface for preference persistence operations.
type PreferenceRepository interface {
// Get returns preferences for a user.
// Returns nil, nil when no row exists for the given userID.
Get(ctx context.Context, userID string) (*domain.UserPreferences, error)
// Upsert creates or updates preferences for a user.
// Uses ON CONFLICT to handle both insert and update atomically.
Upsert(ctx context.Context, prefs *domain.UserPreferences) error
}