import 'package:dartz/dartz.dart';
import '../../repositories/model_repository.dart';
import '../../../data/models/model/model_dto.dart';
import '../../../core/errors/failures.dart';
import '../base_usecase.dart';

/// 모델 수정 파라미터
class UpdateModelParams {
  final int id;
  final UpdateModelRequest request;

  const UpdateModelParams({
    required this.id,
    required this.request,
  });
}

/// 모델 수정 UseCase
class UpdateModelUseCase extends UseCase<ModelDto, UpdateModelParams> {
  final ModelRepository _modelRepository;

  UpdateModelUseCase(this._modelRepository);

  @override
  Future<Either<Failure, ModelDto>> call(UpdateModelParams params) async {
    return await _modelRepository.updateModel(params.id, params.request);
  }
}