import 'package:dartz/dartz.dart';
import '../../repositories/company_repository.dart';
import '../../../models/company_model.dart';
import '../../../core/errors/failures.dart';
import '../base_usecase.dart';

/// 회사 복구 UseCase
class RestoreCompanyUseCase extends UseCase<Company, int> {
  final CompanyRepository _companyRepository;

  RestoreCompanyUseCase(this._companyRepository);

  @override
  Future<Either<Failure, Company>> call(int companyId) async {
    if (companyId <= 0) {
      return Left(ValidationFailure(message: '유효하지 않은 회사 ID입니다.'));
    }
    
    return await _companyRepository.restoreCompany(companyId);
  }
}