package mocks

import (
	"actatempus_backend/internal/domain/repository"
	"context"

	E "github.com/IBM/fp-go/either"
)

// MockAuthRepository is a mock implementation of AuthRepository.
type MockAuthRepository struct{}

// NewMockAuthRepository creates a new instance of MockAuthRepository.
func NewMockAuthRepository() repository.AuthRepository {
	return &MockAuthRepository{}
}

// GenerateToken always returns a successful token generation.
func (m *MockAuthRepository) GenerateToken(ctx context.Context) func(userID string) E.Either[error, string] {
	return func(userID string) E.Either[error, string] {
		return E.Right[error]("mocked-token")
	}
}

// ValidateToken always validates a token successfully.
func (m *MockAuthRepository) ValidateToken(ctx context.Context) func(token string) E.Either[error, string] {
	return func(token string) E.Either[error, string] {
		return E.Right[error]("mocked-user-id")
	}
}

// RevokeToken always revokes a token successfully.
func (m *MockAuthRepository) RevokeToken(ctx context.Context) func(token string) E.Either[error, string] {
	return func(token string) E.Either[error, string] {
		return E.Right[error]("mocked-user-id")
	}
}
