Search in sources :

Example 1 with RequestQueue

use of org.folio.circulation.domain.RequestQueue in project mod-circulation by folio-org.

the class LogCheckInServiceTest method checkInProcessRecords.

private CheckInContext checkInProcessRecords() {
    JsonObject requestRepresentation = new JsonObject().put("servicePointId", UUID.randomUUID().toString()).put("itemBarcode", "barcode").put("checkInDate", ClockUtil.getZonedDateTime().toString());
    JsonObject itemRepresentation = new JsonObject().put("id", UUID.randomUUID().toString()).put("status", new JsonObject().put("name", "Available"));
    return new CheckInContext(CheckInByBarcodeRequest.from(requestRepresentation).value()).withItem(Item.from(itemRepresentation)).withRequestQueue(new RequestQueue(Collections.emptyList())).withLoggedInUserId(UUID.randomUUID().toString());
}
Also used : CheckInContext(org.folio.circulation.domain.CheckInContext) RequestQueue(org.folio.circulation.domain.RequestQueue) JsonObject(io.vertx.core.json.JsonObject)

Example 2 with RequestQueue

use of org.folio.circulation.domain.RequestQueue in project mod-circulation by folio-org.

the class RequestByInstanceIdResource method validateRequester.

private Result<Collection<Item>> validateRequester(Map<Item, RequestQueue> itemRequestQueueMap, InstanceRequestRelatedRecords requestPackage) {
    if (!itemRequestQueueMap.isEmpty()) {
        Collection<RequestQueue> requestQueues = itemRequestQueueMap.values();
        String requesterId = requestPackage.getInstanceLevelRequest().getRequesterId().toString();
        for (RequestQueue queue : requestQueues) {
            final Optional<Request> matchingRequest = queue.getRequests().stream().filter(request -> request.isOpen() && Objects.equals(request.getUserId(), requesterId)).findFirst();
            if (matchingRequest.isPresent()) {
                Map<String, String> parameters = new HashMap<>();
                parameters.put(REQUESTER_ID, requesterId);
                parameters.put(ITEM_ID, matchingRequest.get().getItemId());
                parameters.put("instanceId", requestPackage.getInstanceLevelRequest().getInstanceId().toString());
                String message = "This requester already has an open request for an item of this instance";
                return failedValidation(new ValidationError(message, parameters));
            }
        }
    }
    return of(itemRequestQueueMap::keySet);
}
Also used : HOLD(org.folio.circulation.domain.RequestType.HOLD) UserRepository(org.folio.circulation.infrastructure.storage.users.UserRepository) UpdateRequestQueue(org.folio.circulation.domain.UpdateRequestQueue) CreateRequestService(org.folio.circulation.domain.CreateRequestService) LoanRepository(org.folio.circulation.infrastructure.storage.loans.LoanRepository) ConfigurationRepository(org.folio.circulation.infrastructure.storage.ConfigurationRepository) InstanceRequestRelatedRecords(org.folio.circulation.domain.InstanceRequestRelatedRecords) ZonedDateTime(java.time.ZonedDateTime) RequestQueueRepository(org.folio.circulation.infrastructure.storage.requests.RequestQueueRepository) LoanPolicyRepository(org.folio.circulation.infrastructure.storage.loans.LoanPolicyRepository) ServerErrorResponse(org.folio.circulation.support.http.server.ServerErrorResponse) Router(io.vertx.ext.web.Router) ValidationErrorFailure.singleValidationError(org.folio.circulation.support.ValidationErrorFailure.singleValidationError) UpdateItem(org.folio.circulation.domain.UpdateItem) RoutingContext(io.vertx.ext.web.RoutingContext) JsonPropertyWriter.write(org.folio.circulation.support.json.JsonPropertyWriter.write) Item(org.folio.circulation.domain.Item) REQUEST_LEVEL(org.folio.circulation.domain.representations.RequestProperties.REQUEST_LEVEL) ServicePointRepository(org.folio.circulation.infrastructure.storage.ServicePointRepository) HttpFailure(org.folio.circulation.support.HttpFailure) Map(java.util.Map) CommonFailures.failedDueToServerError(org.folio.circulation.support.results.CommonFailures.failedDueToServerError) JsonObject(io.vertx.core.json.JsonObject) ItemRepository(org.folio.circulation.infrastructure.storage.inventory.ItemRepository) RequestRepresentation(org.folio.circulation.domain.RequestRepresentation) RequestBlockValidators.regularRequestBlockValidators(org.folio.circulation.resources.RequestBlockValidators.regularRequestBlockValidators) Result.of(org.folio.circulation.support.results.Result.of) Result.succeeded(org.folio.circulation.support.results.Result.succeeded) MethodHandles(java.lang.invoke.MethodHandles) Collection(java.util.Collection) Loan(org.folio.circulation.domain.Loan) RequestLoanValidator(org.folio.circulation.domain.validation.RequestLoanValidator) RequestPolicyRepository(org.folio.circulation.infrastructure.storage.requests.RequestPolicyRepository) UUID(java.util.UUID) ValidationError(org.folio.circulation.support.http.server.ValidationError) Result(org.folio.circulation.support.results.Result) Collectors(java.util.stream.Collectors) EventPublisher(org.folio.circulation.services.EventPublisher) Objects(java.util.Objects) PROXY_USER_ID(org.folio.circulation.domain.representations.RequestProperties.PROXY_USER_ID) ServicePointPickupLocationValidator(org.folio.circulation.domain.validation.ServicePointPickupLocationValidator) RouteRegistration(org.folio.circulation.support.RouteRegistration) List(java.util.List) PAGE(org.folio.circulation.domain.RequestType.PAGE) Logger(org.apache.logging.log4j.Logger) RECALL(org.folio.circulation.domain.RequestType.RECALL) HOLD_SHELF(org.folio.circulation.domain.RequestFulfilmentPreference.HOLD_SHELF) InstanceRepository(org.folio.circulation.infrastructure.storage.inventory.InstanceRepository) REQUEST_TYPE(org.folio.circulation.domain.representations.RequestProperties.REQUEST_TYPE) Optional(java.util.Optional) BadRequestFailure(org.folio.circulation.support.BadRequestFailure) FULFILMENT_PREFERENCE(org.folio.circulation.domain.representations.RequestProperties.FULFILMENT_PREFERENCE) CreateRequestRepositories(org.folio.circulation.domain.CreateRequestRepositories) RequestRepository(org.folio.circulation.infrastructure.storage.requests.RequestRepository) HttpClient(io.vertx.core.http.HttpClient) Clients(org.folio.circulation.support.Clients) WebContext(org.folio.circulation.support.http.server.WebContext) Request(org.folio.circulation.domain.Request) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) FailFastErrorHandler(org.folio.circulation.resources.handlers.error.FailFastErrorHandler) JsonHttpResponse(org.folio.circulation.support.http.server.JsonHttpResponse) UpdateUponRequest(org.folio.circulation.domain.UpdateUponRequest) ArrayList(java.util.ArrayList) TlrSettingsConfiguration(org.folio.circulation.domain.configuration.TlrSettingsConfiguration) ForwardOnFailure(org.folio.circulation.support.ForwardOnFailure) RequestAndRelatedRecords(org.folio.circulation.domain.RequestAndRelatedRecords) RequestQueue(org.folio.circulation.domain.RequestQueue) REQUESTER_ID(org.folio.circulation.domain.representations.RequestProperties.REQUESTER_ID) LinkedList(java.util.LinkedList) RequestType(org.folio.circulation.domain.RequestType) RequestFulfilmentPreference(org.folio.circulation.domain.RequestFulfilmentPreference) ItemByInstanceIdFinder(org.folio.circulation.storage.ItemByInstanceIdFinder) ValidationErrorFailure(org.folio.circulation.support.ValidationErrorFailure) ServerErrorFailure(org.folio.circulation.support.ServerErrorFailure) Result.ofAsync(org.folio.circulation.support.results.Result.ofAsync) ITEM_ID(org.folio.circulation.domain.representations.RequestProperties.ITEM_ID) ValidationErrorFailure.failedValidation(org.folio.circulation.support.ValidationErrorFailure.failedValidation) InstanceRequestItemsComparer.sortRequestQueues(org.folio.circulation.domain.InstanceRequestItemsComparer.sortRequestQueues) UpdateLoan(org.folio.circulation.domain.UpdateLoan) Collectors.toList(java.util.stream.Collectors.toList) RequestLevel(org.folio.circulation.domain.RequestLevel) ProxyRelationshipValidator(org.folio.circulation.domain.validation.ProxyRelationshipValidator) RequestByInstanceIdRequest(org.folio.circulation.domain.representations.RequestByInstanceIdRequest) LogManager(org.apache.logging.log4j.LogManager) HashMap(java.util.HashMap) UpdateRequestQueue(org.folio.circulation.domain.UpdateRequestQueue) RequestQueue(org.folio.circulation.domain.RequestQueue) Request(org.folio.circulation.domain.Request) UpdateUponRequest(org.folio.circulation.domain.UpdateUponRequest) RequestByInstanceIdRequest(org.folio.circulation.domain.representations.RequestByInstanceIdRequest) ValidationErrorFailure.singleValidationError(org.folio.circulation.support.ValidationErrorFailure.singleValidationError) ValidationError(org.folio.circulation.support.http.server.ValidationError)

Example 3 with RequestQueue

use of org.folio.circulation.domain.RequestQueue in project mod-circulation by folio-org.

the class RequestQueueResource method getQueue.

private void getQueue(RoutingContext routingContext, RequestQueueType requestQueueType) {
    final var context = new WebContext(routingContext);
    final var clients = Clients.create(context, client);
    final var itemRepository = new ItemRepository(clients);
    final var userRepository = new UserRepository(clients);
    final var loanRepository = new LoanRepository(clients, itemRepository, userRepository);
    final var requestQueueRepository = new RequestQueueRepository(RequestRepository.using(clients, itemRepository, userRepository, loanRepository));
    final RequestRepresentation requestRepresentation = new RequestRepresentation();
    CompletableFuture<Result<RequestQueue>> requestQueue = getRequestQueueByType(routingContext, requestQueueType, requestQueueRepository);
    requestQueue.thenApply(r -> r.map(queue -> new MultipleRecords<>(queue.getRequests(), queue.size()))).thenApply(r -> r.map(requests -> requests.asJson(requestRepresentation::extendedRepresentation, "requests"))).thenApply(r -> r.map(JsonHttpResponse::ok)).thenAccept(context::writeResultToHttpResponse);
}
Also used : FOR_INSTANCE(org.folio.circulation.resources.context.RequestQueueType.FOR_INSTANCE) UserRepository(org.folio.circulation.infrastructure.storage.users.UserRepository) Clients(org.folio.circulation.support.Clients) UpdateRequestQueue(org.folio.circulation.domain.UpdateRequestQueue) LoanRepository(org.folio.circulation.infrastructure.storage.loans.LoanRepository) ConfigurationRepository(org.folio.circulation.infrastructure.storage.ConfigurationRepository) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) WebContext(org.folio.circulation.support.http.server.WebContext) Request(org.folio.circulation.domain.Request) RequestQueueRepository(org.folio.circulation.infrastructure.storage.requests.RequestQueueRepository) Router(io.vertx.ext.web.Router) CompletableFuture(java.util.concurrent.CompletableFuture) ValidationErrorFailure.singleValidationError(org.folio.circulation.support.ValidationErrorFailure.singleValidationError) RoutingContext(io.vertx.ext.web.RoutingContext) ReorderRequestContext(org.folio.circulation.resources.context.ReorderRequestContext) JsonHttpResponse(org.folio.circulation.support.http.server.JsonHttpResponse) TlrSettingsConfiguration(org.folio.circulation.domain.configuration.TlrSettingsConfiguration) RequestUpdateLogEventMapper.mapToRequestLogEventJson(org.folio.circulation.domain.representations.logs.RequestUpdateLogEventMapper.mapToRequestLogEventJson) ServicePointRepository(org.folio.circulation.infrastructure.storage.ServicePointRepository) RequestQueueType(org.folio.circulation.resources.context.RequestQueueType) RequestQueueValidation(org.folio.circulation.domain.validation.RequestQueueValidation) JsonObject(io.vertx.core.json.JsonObject) RequestQueue(org.folio.circulation.domain.RequestQueue) ItemRepository(org.folio.circulation.infrastructure.storage.inventory.ItemRepository) RequestRepresentation(org.folio.circulation.domain.RequestRepresentation) LogEventType(org.folio.circulation.domain.representations.logs.LogEventType) MultipleRecords(org.folio.circulation.domain.MultipleRecords) Result.succeeded(org.folio.circulation.support.results.Result.succeeded) Result(org.folio.circulation.support.results.Result) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) EventPublisher(org.folio.circulation.services.EventPublisher) FOR_ITEM(org.folio.circulation.resources.context.RequestQueueType.FOR_ITEM) RouteRegistration(org.folio.circulation.support.RouteRegistration) List(java.util.List) ReorderQueueRequest(org.folio.circulation.domain.reorder.ReorderQueueRequest) RequestRepository(org.folio.circulation.infrastructure.storage.requests.RequestRepository) HttpClient(io.vertx.core.http.HttpClient) WebContext(org.folio.circulation.support.http.server.WebContext) JsonHttpResponse(org.folio.circulation.support.http.server.JsonHttpResponse) RequestRepresentation(org.folio.circulation.domain.RequestRepresentation) LoanRepository(org.folio.circulation.infrastructure.storage.loans.LoanRepository) Result(org.folio.circulation.support.results.Result) ItemRepository(org.folio.circulation.infrastructure.storage.inventory.ItemRepository) UserRepository(org.folio.circulation.infrastructure.storage.users.UserRepository) RequestQueueRepository(org.folio.circulation.infrastructure.storage.requests.RequestQueueRepository)

Example 4 with RequestQueue

use of org.folio.circulation.domain.RequestQueue in project mod-circulation by folio-org.

the class RenewalResource method unsetDueDateChangedByRecallIfNoOpenRecallsInQueue.

private RenewalContext unsetDueDateChangedByRecallIfNoOpenRecallsInQueue(RenewalContext renewalContext) {
    Loan loan = renewalContext.getLoan();
    RequestQueue queue = renewalContext.getRequestQueue();
    if (loan.wasDueDateChangedByRecall() && !queue.hasOpenRecalls()) {
        return renewalContext.withLoan(loan.unsetDueDateChangedByRecall());
    } else {
        return renewalContext;
    }
}
Also used : Loan(org.folio.circulation.domain.Loan) RequestQueue(org.folio.circulation.domain.RequestQueue)

Example 5 with RequestQueue

use of org.folio.circulation.domain.RequestQueue in project mod-circulation by folio-org.

the class RenewalResource method renew.

private Result<RenewalContext> renew(RenewalContext context, ZonedDateTime renewDate) {
    final var loan = context.getLoan();
    final var requestQueue = context.getRequestQueue();
    final var loanPolicy = loan.getLoanPolicy();
    final Result<ZonedDateTime> proposedDueDateResult = calculateNewDueDate(loan, requestQueue, renewDate);
    final List<ValidationError> errors = new ArrayList<>();
    addErrorsIfDueDateResultFailed(loan, errors, proposedDueDateResult);
    if (errors.isEmpty()) {
        final BlockOverrides blockOverrides = BlockOverrides.from(getObjectProperty(context.getRenewalRequest(), "overrideBlocks"));
        if (!blockOverrides.getPatronBlockOverride().isRequested() && !blockOverrides.getRenewalBlockOverride().isRequested()) {
            return proposedDueDateResult.map(dueDate -> loan.renew(dueDate, loanPolicy.getId())).map(l -> context);
        }
        return proposedDueDateResult.map(dueDate -> loan.overrideRenewal(dueDate, loanPolicy.getId(), blockOverrides.getComment())).map(l -> context);
    }
    return failedValidation(errors);
}
Also used : RenewalContext(org.folio.circulation.resources.context.RenewalContext) LoanRepository(org.folio.circulation.infrastructure.storage.loans.LoanRepository) JsonPropertyFetcher.getDateTimeProperty(org.folio.circulation.support.json.JsonPropertyFetcher.getDateTimeProperty) ZonedDateTime(java.time.ZonedDateTime) RequestQueueRepository(org.folio.circulation.infrastructure.storage.requests.RequestQueueRepository) StringUtils(org.apache.commons.lang3.StringUtils) RENEWAL_IS_NOT_POSSIBLE(org.folio.circulation.resources.handlers.error.CirculationErrorType.RENEWAL_IS_NOT_POSSIBLE) CommonFailures.failedDueToServerError(org.folio.circulation.support.results.CommonFailures.failedDueToServerError) FeeFineOwnerRepository(org.folio.circulation.infrastructure.storage.feesandfines.FeeFineOwnerRepository) JsonObject(io.vertx.core.json.JsonObject) RenewalValidator.loanPolicyValidationError(org.folio.circulation.resources.RenewalValidator.loanPolicyValidationError) CLAIMED_RETURNED(org.folio.circulation.domain.ItemStatus.CLAIMED_RETURNED) EnumSet(java.util.EnumSet) Loan(org.folio.circulation.domain.Loan) ValidationError(org.folio.circulation.support.http.server.ValidationError) Result(org.folio.circulation.support.results.Result) RenewalValidator.errorForDueDate(org.folio.circulation.resources.RenewalValidator.errorForDueDate) LoanPolicy(org.folio.circulation.domain.policy.LoanPolicy) InactiveUserRenewalValidator(org.folio.circulation.domain.validation.InactiveUserRenewalValidator) FeeFineScheduledNoticeService(org.folio.circulation.domain.notice.schedule.FeeFineScheduledNoticeService) RouteRegistration(org.folio.circulation.support.RouteRegistration) LoanRepresentation(org.folio.circulation.domain.LoanRepresentation) PATRON_BLOCK(org.folio.circulation.domain.override.OverridableBlockType.PATRON_BLOCK) OverduePeriodCalculatorService(org.folio.circulation.domain.OverduePeriodCalculatorService) JsonPropertyFetcher.getObjectProperty(org.folio.circulation.support.json.JsonPropertyFetcher.getObjectProperty) ITEM_DOES_NOT_EXIST(org.folio.circulation.resources.handlers.error.CirculationErrorType.ITEM_DOES_NOT_EXIST) RequestRepository(org.folio.circulation.infrastructure.storage.requests.RequestRepository) INSUFFICIENT_OVERRIDE_PERMISSIONS(org.folio.circulation.resources.handlers.error.CirculationErrorType.INSUFFICIENT_OVERRIDE_PERMISSIONS) FeeFineRepository(org.folio.circulation.infrastructure.storage.feesandfines.FeeFineRepository) BlockValidator(org.folio.circulation.domain.validation.overriding.BlockValidator) OverdueFinePolicyRepository(org.folio.circulation.infrastructure.storage.loans.OverdueFinePolicyRepository) FeeFineFacade(org.folio.circulation.services.FeeFineFacade) WebContext(org.folio.circulation.support.http.server.WebContext) RenewalValidator.errorForNotMatchingOverrideCases(org.folio.circulation.resources.RenewalValidator.errorForNotMatchingOverrideCases) Resource(org.folio.circulation.resources.Resource) FIXED_POLICY_HAS_ALTERNATE_RENEWAL_PERIOD_FOR_HOLDS(org.folio.circulation.resources.RenewalValidator.FIXED_POLICY_HAS_ALTERNATE_RENEWAL_PERIOD_FOR_HOLDS) ArrayList(java.util.ArrayList) Validator(org.folio.circulation.domain.validation.Validator) RENEWAL_IS_BLOCKED(org.folio.circulation.resources.handlers.error.CirculationErrorType.RENEWAL_IS_BLOCKED) RenewalValidator.itemByIdValidationError(org.folio.circulation.resources.RenewalValidator.itemByIdValidationError) DECLARED_LOST(org.folio.circulation.domain.ItemStatus.DECLARED_LOST) USER_IS_BLOCKED_MANUALLY(org.folio.circulation.resources.handlers.error.CirculationErrorType.USER_IS_BLOCKED_MANUALLY) ScheduledNoticesRepository(org.folio.circulation.infrastructure.storage.notices.ScheduledNoticesRepository) RenewalValidator.errorForRecallRequest(org.folio.circulation.resources.RenewalValidator.errorForRecallRequest) RequestType(org.folio.circulation.domain.RequestType) AutomatedPatronBlocksRepository(org.folio.circulation.infrastructure.storage.AutomatedPatronBlocksRepository) OverdueFineService(org.folio.circulation.domain.OverdueFineService) UserManualBlocksValidator(org.folio.circulation.domain.validation.UserManualBlocksValidator) RENEWAL_VALIDATION_ERROR(org.folio.circulation.resources.handlers.error.CirculationErrorType.RENEWAL_VALIDATION_ERROR) CirculationErrorHandler(org.folio.circulation.resources.handlers.error.CirculationErrorHandler) StoreLoanAndItem(org.folio.circulation.StoreLoanAndItem) CHECKED_OUT(org.folio.circulation.domain.ItemStatus.CHECKED_OUT) HOLD(org.folio.circulation.domain.RequestType.HOLD) RENEWAL_BLOCK(org.folio.circulation.domain.override.OverridableBlockType.RENEWAL_BLOCK) UserRepository(org.folio.circulation.infrastructure.storage.users.UserRepository) ResultBinding.mapResult(org.folio.circulation.support.results.ResultBinding.mapResult) ConfigurationRepository(org.folio.circulation.infrastructure.storage.ConfigurationRepository) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) LoanPolicyRepository(org.folio.circulation.infrastructure.storage.loans.LoanPolicyRepository) Router(io.vertx.ext.web.Router) RoutingContext(io.vertx.ext.web.RoutingContext) ItemStatus(org.folio.circulation.domain.ItemStatus) ClosedLibraryStrategyService(org.folio.circulation.domain.policy.library.ClosedLibraryStrategyService) CalendarRepository(org.folio.circulation.infrastructure.storage.CalendarRepository) LoanScheduledNoticeService(org.folio.circulation.domain.notice.schedule.LoanScheduledNoticeService) DateTimeUtil.isAfterMillis(org.folio.circulation.support.utils.DateTimeUtil.isAfterMillis) ItemRepository(org.folio.circulation.infrastructure.storage.inventory.ItemRepository) LostItemFeeRefundService(org.folio.circulation.services.LostItemFeeRefundService) Result.succeeded(org.folio.circulation.support.results.Result.succeeded) LoanNoticeSender(org.folio.circulation.resources.LoanNoticeSender) BlockOverrides(org.folio.circulation.domain.override.BlockOverrides) EventPublisher(org.folio.circulation.services.EventPublisher) FIXED_POLICY_HAS_ALTERNATE_RENEWAL_PERIOD(org.folio.circulation.resources.RenewalValidator.FIXED_POLICY_HAS_ALTERNATE_RENEWAL_PERIOD) List(java.util.List) RECALL(org.folio.circulation.domain.RequestType.RECALL) CAN_NOT_RENEW_ITEM_ERROR(org.folio.circulation.resources.RenewalValidator.CAN_NOT_RENEW_ITEM_ERROR) ClockUtil(org.folio.circulation.support.utils.ClockUtil) CirculationErrorType(org.folio.circulation.resources.handlers.error.CirculationErrorType) HttpClient(io.vertx.core.http.HttpClient) Clients(org.folio.circulation.support.Clients) Request(org.folio.circulation.domain.Request) CompletableFuture(java.util.concurrent.CompletableFuture) RenewalValidator.errorWhenEarlierOrSameDueDate(org.folio.circulation.resources.RenewalValidator.errorWhenEarlierOrSameDueDate) HttpResponse(org.folio.circulation.support.http.server.HttpResponse) Function(java.util.function.Function) JsonHttpResponse(org.folio.circulation.support.http.server.JsonHttpResponse) USER_IS_INACTIVE(org.folio.circulation.resources.handlers.error.CirculationErrorType.USER_IS_INACTIVE) AutomatedPatronBlocksValidator(org.folio.circulation.domain.validation.AutomatedPatronBlocksValidator) OkapiPermissions(org.folio.circulation.support.http.OkapiPermissions) AGED_TO_LOST(org.folio.circulation.domain.ItemStatus.AGED_TO_LOST) RequestQueue(org.folio.circulation.domain.RequestQueue) OverridingErrorHandler(org.folio.circulation.resources.handlers.error.OverridingErrorHandler) ValidationErrorFailure(org.folio.circulation.support.ValidationErrorFailure) FAILED_TO_FETCH_USER(org.folio.circulation.resources.handlers.error.CirculationErrorType.FAILED_TO_FETCH_USER) RENEWAL_DUE_DATE_REQUIRED_IS_BLOCKED(org.folio.circulation.resources.handlers.error.CirculationErrorType.RENEWAL_DUE_DATE_REQUIRED_IS_BLOCKED) FAILED_TO_FIND_SINGLE_OPEN_LOAN(org.folio.circulation.resources.handlers.error.CirculationErrorType.FAILED_TO_FIND_SINGLE_OPEN_LOAN) ValidationErrorFailure.failedValidation(org.folio.circulation.support.ValidationErrorFailure.failedValidation) RenewalValidator.overrideDueDateIsRequiredError(org.folio.circulation.resources.RenewalValidator.overrideDueDateIsRequiredError) OverridingBlockValidator(org.folio.circulation.domain.validation.overriding.OverridingBlockValidator) USER_IS_BLOCKED_AUTOMATICALLY(org.folio.circulation.resources.handlers.error.CirculationErrorType.USER_IS_BLOCKED_AUTOMATICALLY) JsonPropertyFetcher.getProperty(org.folio.circulation.support.json.JsonPropertyFetcher.getProperty) ZonedDateTime(java.time.ZonedDateTime) BlockOverrides(org.folio.circulation.domain.override.BlockOverrides) ArrayList(java.util.ArrayList) RenewalValidator.loanPolicyValidationError(org.folio.circulation.resources.RenewalValidator.loanPolicyValidationError) ValidationError(org.folio.circulation.support.http.server.ValidationError) RenewalValidator.itemByIdValidationError(org.folio.circulation.resources.RenewalValidator.itemByIdValidationError)

Aggregations

RequestQueue (org.folio.circulation.domain.RequestQueue)53 Loan (org.folio.circulation.domain.Loan)45 ZonedDateTime (java.time.ZonedDateTime)39 LoanPolicyBuilder (api.support.builders.LoanPolicyBuilder)37 OverridingErrorHandler (org.folio.circulation.resources.handlers.error.OverridingErrorHandler)37 Test (org.junit.jupiter.api.Test)31 CirculationErrorHandler (org.folio.circulation.resources.handlers.error.CirculationErrorHandler)27 FixedDueDateSchedulesBuilder (api.support.builders.FixedDueDateSchedulesBuilder)23 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)18 ClockUtil.getZonedDateTime (org.folio.circulation.support.utils.ClockUtil.getZonedDateTime)17 JsonObject (io.vertx.core.json.JsonObject)16 LoanBuilder (api.support.builders.LoanBuilder)11 Result (org.folio.circulation.support.results.Result)8 FixedDueDateSchedule (api.support.builders.FixedDueDateSchedule)6 Item (org.folio.circulation.domain.Item)6 Request (org.folio.circulation.domain.Request)6 UpdateRequestQueue (org.folio.circulation.domain.UpdateRequestQueue)6 ValueSource (org.junit.jupiter.params.provider.ValueSource)6 CompletableFuture (java.util.concurrent.CompletableFuture)5 ValidationErrorFailure (org.folio.circulation.support.ValidationErrorFailure)5