import 'package:krow_core/core.dart';
import '../arguments/save_experience_arguments.dart';
import '../repositories/experience_repository_interface.dart';

/// Use case for saving staff experience details.
///
/// Delegates the saving logic to [ExperienceRepositoryInterface].
class SaveExperienceUseCase extends UseCase<SaveExperienceArguments, void> {
  final ExperienceRepositoryInterface repository;

  /// Creates a [SaveExperienceUseCase].
  SaveExperienceUseCase(this.repository);

  @override
  Future<void> call(SaveExperienceArguments params) {
    return repository.saveExperience(
      params.staffId,
      params.industries,
      params.skills,
    );
  }
}
