diff --git a/src/main/java/org/folio/models/claiming/ClaimingError.java b/src/main/java/org/folio/models/claiming/ClaimingError.java index 7664ee5c6..5dd6c4b06 100644 --- a/src/main/java/org/folio/models/claiming/ClaimingError.java +++ b/src/main/java/org/folio/models/claiming/ClaimingError.java @@ -7,11 +7,11 @@ @AllArgsConstructor public enum ClaimingError { CANNOT_SEND_CLAIMS_PIECE_IDS_ARE_EMPTY("Cannot send claims, piece ids are empty"), + CANNOT_FIND_PIECES_WITH_LATE_STATUS_TO_PROCESS("Cannot find pieces with LATE status to process"), CANNOT_RETRIEVE_CONFIG_ENTRIES("Cannot retrieve config entries"), CANNOT_GROUP_PIECES_BY_VENDOR_MESSAGE("Cannot group pieces by vendor"), CANNOT_CREATE_JOBS_AND_UPDATE_PIECES("Cannot create jobs and update pieces"), CANNOT_FIND_A_PIECE_BY_ID("Cannot find a piece by '%s' id"), - CANNOT_FIND_PIECES_WITH_LATE_STATUS_TO_PROCESS("Cannot find pieces with LATE status to process"), CANNOT_COMPLETE_REQ("Cannot complete request to an optional module mod-data-export-spring is unreachable"); private final String value; diff --git a/src/main/java/org/folio/service/pieces/PiecesClaimingService.java b/src/main/java/org/folio/service/pieces/PiecesClaimingService.java index 6fe244b30..b1bc4f73d 100644 --- a/src/main/java/org/folio/service/pieces/PiecesClaimingService.java +++ b/src/main/java/org/folio/service/pieces/PiecesClaimingService.java @@ -34,6 +34,7 @@ import static org.folio.models.claiming.ClaimingError.CANNOT_COMPLETE_REQ; import static org.folio.models.claiming.ClaimingError.CANNOT_CREATE_JOBS_AND_UPDATE_PIECES; import static org.folio.models.claiming.ClaimingError.CANNOT_FIND_A_PIECE_BY_ID; +import static org.folio.models.claiming.ClaimingError.CANNOT_FIND_PIECES_WITH_LATE_STATUS_TO_PROCESS; import static org.folio.models.claiming.ClaimingError.CANNOT_GROUP_PIECES_BY_VENDOR_MESSAGE; import static org.folio.models.claiming.ClaimingError.CANNOT_RETRIEVE_CONFIG_ENTRIES; import static org.folio.models.claiming.ClaimingError.CANNOT_SEND_CLAIMS_PIECE_IDS_ARE_EMPTY; @@ -55,7 +56,6 @@ public class PiecesClaimingService { private static final String JOB_STATUS = "status"; private static final String EXPORT_TYPE_CLAIMS = "CLAIMS"; - private static final String CANNOT_FIND_PIECES_WITH_LATE_STATUS_TO_PROCESS = "Cannot find pieces with LATE status to process"; private final ConfigurationEntriesCache configurationEntriesCache; private final PieceStorageService pieceStorageService; @@ -88,7 +88,7 @@ public Future sendClaims(ClaimingCollection claimingCollection, return groupPieceIdsByVendorId(pieceIds, requestContext) .compose(pieceIdsByVendorIds -> { if (CollectionUtils.isEmpty(pieceIdsByVendorIds)) { - return Future.succeededFuture(createEmptyClaimingResults(CANNOT_FIND_PIECES_WITH_LATE_STATUS_TO_PROCESS)); + return Future.succeededFuture(createEmptyClaimingResults(CANNOT_FIND_PIECES_WITH_LATE_STATUS_TO_PROCESS.getValue())); } log.info("sendClaims:: Using pieces by vendor id map, map: {}", pieceIdsByVendorIds); return createJobsByVendor(config, pieceIdsByVendorIds, requestContext);