slack-auth-1770277926/services/auth-api/internal/port/user.go
rdev-worker fd9bf961bb
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature auth-system --requirements 'User model with email/...
2026-02-05 07:59:55 +00:00

28 lines
905 B
Go

package port
import (
"context"
"git.threesix.ai/jordan/slack-auth-1770277926/services/auth-api/internal/domain"
)
// UserRepository defines the interface for user persistence operations.
// Implementations may use databases, in-memory storage, or external services.
type UserRepository interface {
// Get returns a user by ID.
// Returns domain.ErrUserNotFound if not found.
Get(ctx context.Context, id domain.UserID) (*domain.User, error)
// GetByEmail returns a user by email address.
// Returns domain.ErrUserNotFound if not found.
GetByEmail(ctx context.Context, email string) (*domain.User, error)
// Create stores a new user.
// The user must have a valid ID set.
Create(ctx context.Context, user *domain.User) error
// ExistsByEmail checks if a user with the given email exists.
// Used for duplicate detection.
ExistsByEmail(ctx context.Context, email string) (bool, error)
}