package translation

import (
	"context"
	"tercul/internal/domain"
	"gorm.io/gorm"
)

type mockTranslationRepository struct {
	domain.TranslationRepository
	getByIDFunc               func(ctx context.Context, id uint) (*domain.Translation, error)
	listByWorkIDPaginatedFunc func(ctx context.Context, workID uint, language *string, page, pageSize int) (*domain.PaginatedResult[domain.Translation], error)
}

func (m *mockTranslationRepository) GetByID(ctx context.Context, id uint) (*domain.Translation, error) {
	if m.getByIDFunc != nil {
		return m.getByIDFunc(ctx, id)
	}
	return nil, nil
}

func (m *mockTranslationRepository) ListByWorkIDPaginated(ctx context.Context, workID uint, language *string, page, pageSize int) (*domain.PaginatedResult[domain.Translation], error) {
	if m.listByWorkIDPaginatedFunc != nil {
		return m.listByWorkIDPaginatedFunc(ctx, workID, language, page, pageSize)
	}
	return nil, nil
}

// Implement other methods of the interface if needed for tests, returning nil or default values.
func (m *mockTranslationRepository) Create(ctx context.Context, entity *domain.Translation) error {
	return nil
}
func (m *mockTranslationRepository) CreateInTx(ctx context.Context, tx *gorm.DB, entity *domain.Translation) error {
	return nil
}
func (m *mockTranslationRepository) GetByIDWithOptions(ctx context.Context, id uint, options *domain.QueryOptions) (*domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) Update(ctx context.Context, entity *domain.Translation) error {
	return nil
}
func (m *mockTranslationRepository) UpdateInTx(ctx context.Context, tx *gorm.DB, entity *domain.Translation) error {
	return nil
}
func (m *mockTranslationRepository) Delete(ctx context.Context, id uint) error {
	return nil
}
func (m *mockTranslationRepository) DeleteInTx(ctx context.Context, tx *gorm.DB, id uint) error {
	return nil
}
func (m *mockTranslationRepository) List(ctx context.Context, page, pageSize int) (*domain.PaginatedResult[domain.Translation], error) {
	return nil, nil
}
func (m *mockTranslationRepository) ListWithOptions(ctx context.Context, options *domain.QueryOptions) ([]domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) ListAll(ctx context.Context) ([]domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) Count(ctx context.Context) (int64, error) {
	return 0, nil
}
func (m *mockTranslationRepository) CountWithOptions(ctx context.Context, options *domain.QueryOptions) (int64, error) {
	return 0, nil
}
func (m *mockTranslationRepository) FindWithPreload(ctx context.Context, preloads []string, id uint) (*domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) GetAllForSync(ctx context.Context, batchSize, offset int) ([]domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) Exists(ctx context.Context, id uint) (bool, error) {
	return false, nil
}
func (m *mockTranslationRepository) BeginTx(ctx context.Context) (*gorm.DB, error) {
	return nil, nil
}
func (m *mockTranslationRepository) WithTx(ctx context.Context, fn func(tx *gorm.DB) error) error {
	return nil
}
func (m *mockTranslationRepository) ListByWorkID(ctx context.Context, workID uint) ([]domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) ListByEntity(ctx context.Context, entityType string, entityID uint) ([]domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) ListByTranslatorID(ctx context.Context, translatorID uint) ([]domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) ListByStatus(ctx context.Context, status domain.TranslationStatus) ([]domain.Translation, error) {
	return nil, nil
}
func (m *mockTranslationRepository) Upsert(ctx context.Context, translation *domain.Translation) error {
	return nil
}