import 'package:krow_core/core.dart';
import '../arguments/get_shifts_for_date_arguments.dart';
import '../repositories/coverage_repository.dart';
import 'package:krow_domain/krow_domain.dart';

/// Use case for fetching shifts for a specific date.
///
/// This use case encapsulates the logic for retrieving all shifts scheduled for a given date.
/// It delegates the data retrieval to the [CoverageRepository].
///
/// Follows the KROW Clean Architecture pattern by:
/// - Extending from [UseCase] base class
/// - Using [GetShiftsForDateArguments] for input
/// - Returning domain entities ([CoverageShift])
/// - Delegating to repository abstraction
class GetShiftsForDateUseCase
    implements UseCase<GetShiftsForDateArguments, List<CoverageShift>> {
  /// Creates a [GetShiftsForDateUseCase].
  GetShiftsForDateUseCase(this._repository);

  final CoverageRepository _repository;

  @override
  Future<List<CoverageShift>> call(GetShiftsForDateArguments arguments) {
    return _repository.getShiftsForDate(date: arguments.date);
  }
}
