import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart';
import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/repositories/counter_repository.dart';
import 'package:wyatt_architecture/wyatt_architecture.dart';

class Increment extends AsyncUseCase<int, Integer> {
  Increment({
    required CounterRepository counterRepository,
  }) : _counterRepository = counterRepository;

  final CounterRepository _counterRepository;

  @override
  FutureOrResult<Integer> execute(int? params) async {
    final step = Integer(params ?? 1);

    return _counterRepository.increment(by: step);
  }
}
