slack5-1770603014/services/preferences-api/internal/port/preferences.go
rdev-worker e5fc44d10e
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature user-preferences
2026-02-09 02:37:38 +00:00

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
}