UseCaseInputValidator<I> typedef

UseCaseInputValidator<I> = Either<Exception, I> Function(I input)

A function type that validates the input for a use case.

Takes an input of type I and returns an Either containing:

  • a failure (Exception) on the Left if the input is invalid,
  • or the validated input I on the Right if the input is valid.

This validator can be used to enforce preconditions or business rules before executing the use case logic.

Implementation

typedef UseCaseInputValidator<I> = Either<Exception, I> Function(I input);