Search in sources :

Example 1 with RequestStatus

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

the class RequestFromRepresentationService method validateStatus.

private Result<Request> validateStatus(Request request) {
    JsonObject representation = request.getRequestRepresentation();
    RequestStatus status = RequestStatus.from(representation);
    if (!status.isValid()) {
        return failed(new BadRequestFailure(RequestStatus.invalidStatusErrorMessage()));
    } else {
        status.writeTo(representation);
        return succeeded(request);
    }
}
Also used : BadRequestFailure(org.folio.circulation.support.BadRequestFailure) JsonObject(io.vertx.core.json.JsonObject) RequestStatus(org.folio.circulation.domain.RequestStatus)

Aggregations

JsonObject (io.vertx.core.json.JsonObject)1 RequestStatus (org.folio.circulation.domain.RequestStatus)1 BadRequestFailure (org.folio.circulation.support.BadRequestFailure)1