19 lines
622 B
Go
19 lines
622 B
Go
package port
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.threesix.ai/jordan/slack5-1770541397/services/preferences-api/internal/domain"
|
|
)
|
|
|
|
// PreferencesRepository defines the interface for user preferences persistence.
|
|
// Implementations may use databases or in-memory storage.
|
|
type PreferencesRepository interface {
|
|
// Get returns the preferences for a user.
|
|
// Returns domain.ErrPreferencesNotFound if no preferences exist.
|
|
Get(ctx context.Context, userID domain.UserID) (*domain.UserPreferences, error)
|
|
|
|
// Upsert creates or replaces the preferences for a user.
|
|
Upsert(ctx context.Context, prefs *domain.UserPreferences) error
|
|
}
|