import 'package:krow_core/core.dart';
import 'package:krow_domain/krow_domain.dart';
import '../arguments/get_my_shifts_arguments.dart';
import '../repositories/shifts_repository_interface.dart';

/// Use case for retrieving the user's assigned shifts.
///
/// This use case delegates to [ShiftsRepositoryInterface].
class GetMyShiftsUseCase extends UseCase<GetMyShiftsArguments, List<Shift>> {
  final ShiftsRepositoryInterface repository;

  GetMyShiftsUseCase(this.repository);

  @override
  Future<List<Shift>> call(GetMyShiftsArguments arguments) async {
    return repository.getMyShifts(
      start: arguments.start,
      end: arguments.end,
    );
  }
}
