import 'package:cargocalculaterapp/core/error/failure.dart';
import 'package:cargocalculaterapp/core/usecase/usecase.dart';
import 'package:cargocalculaterapp/features/profile/data/models/profile_update_request.dart';
import 'package:dartz/dartz.dart';

import '../../data/models/profile_response.dart';
import '../repository/profile_repository.dart';

class ProfileUpdateUseCase
    extends UseCase<ProfileResponse, ProfileUpdateRequest> {
  final ProfileRepository repository;

  ProfileUpdateUseCase(this.repository);

  @override
  Future<Either<Failure, ProfileResponse>> call(
    ProfileUpdateRequest params,
  ) async {
    final response = await repository.updateProfile(params);
    return response;
  }
}
