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)
}
