import 'package:krow_core/core.dart';
import '../repositories/clock_in_repository_interface.dart';
import '../arguments/clock_in_arguments.dart';

/// Use case for clocking in a user.
class ClockInUseCase implements UseCase<ClockInArguments, Map<String, dynamic>> {
  final ClockInRepositoryInterface _repository;

  ClockInUseCase(this._repository);

  @override
  Future<Map<String, dynamic>> call(ClockInArguments arguments) {
    return _repository.clockIn(
      shiftId: arguments.shiftId,
      notes: arguments.notes,
    );
  }
}
