19 lines
611 B
Go
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
|
|
}
|