use of org.folio.circulation.domain.validation.UserManualBlocksValidator in project mod-circulation by folio-org.
the class RenewalResource method createManualPatronBlocksValidator.
private Validator<RenewalContext> createManualPatronBlocksValidator(JsonObject request, OkapiPermissions permissions, Clients clients) {
Function<RenewalContext, CompletableFuture<Result<RenewalContext>>> validationFunction = new UserManualBlocksValidator(clients)::refuseWhenUserIsBlocked;
final BlockOverrides blockOverrides = getOverrideBlocks(request);
return blockOverrides.getPatronBlockOverride().isRequested() ? new OverridingBlockValidator<>(PATRON_BLOCK, blockOverrides, permissions) : new BlockValidator<>(USER_IS_BLOCKED_MANUALLY, validationFunction);
}
Aggregations