import 'package:krow_core/core.dart';
import '../../domain/entities/time_card.dart';
import '../arguments/get_time_cards_arguments.dart';
import '../repositories/time_card_repository.dart';

/// UseCase to retrieve time cards for a given month.
class GetTimeCardsUseCase extends UseCase<GetTimeCardsArguments, List<TimeCard>> {
  final TimeCardRepository repository;

  GetTimeCardsUseCase(this.repository);

  /// Executes the use case.
  ///
  /// Returns a list of [TimeCard]s for the specified month in [arguments].
  @override
  Future<List<TimeCard>> call(GetTimeCardsArguments arguments) {
    return repository.getTimeCards(arguments.month);
  }
}
