22 lines
847 B
Go
22 lines
847 B
Go
// Package port defines interfaces (ports) for external dependencies.
|
|
// These interfaces define the contracts between the application core and
|
|
// infrastructure adapters, enabling testability and flexibility.
|
|
package port
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.threesix.ai/jordan/slack5-1770603014/services/preferences-api/internal/domain"
|
|
)
|
|
|
|
// PreferencesRepository defines the interface for preferences persistence operations.
|
|
// Implementations may use databases, in-memory storage, or external services.
|
|
type PreferencesRepository interface {
|
|
// Get returns preferences for a user by ID.
|
|
// Returns nil, nil if no preferences exist for the user.
|
|
Get(ctx context.Context, userID domain.UserID) (*domain.UserPreferences, error)
|
|
|
|
// Upsert creates or updates preferences for a user.
|
|
Upsert(ctx context.Context, prefs *domain.UserPreferences) error
|
|
}
|