import 'package:dartz/dartz.dart';
import '../../repositories/equipment_repository.dart';
import '../../../data/models/equipment/equipment_dto.dart';
import '../../../core/errors/failures.dart';
import '../base_usecase.dart';

/// 장비 복구 UseCase
class RestoreEquipmentUseCase extends UseCase<EquipmentDto, int> {
  final EquipmentRepository _equipmentRepository;

  RestoreEquipmentUseCase(this._equipmentRepository);

  @override
  Future<Either<Failure, EquipmentDto>> call(int equipmentId) async {
    if (equipmentId <= 0) {
      return Left(ValidationFailure(message: '유효하지 않은 장비 ID입니다.'));
    }
    
    return await _equipmentRepository.restoreEquipment(equipmentId);
  }
}