UseCaseInputValidator<I> typedef
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
Leftif the input is invalid, - or the validated input
Ion theRightif 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);