Skip to content

Commit

Permalink
[MODORDERS-1159-2]. Add validation for pieces without item, add missi…
Browse files Browse the repository at this point in the history
…ng delete permission (#997)
  • Loading branch information
BKadirkhodjaev authored Aug 16, 2024
1 parent 9d3ebce commit fd15c05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@
"inventory.items.collection.get",
"inventory.items.item.put",
"inventory.items.item.post",
"inventory.items.item.delete",
"inventory-storage.holdings.collection.get",
"inventory-storage.holdings-sources.collection.get",
"inventory-storage.holdings.item.post",
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/folio/helper/CheckinHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.vertx.core.Promise;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import java.util.Objects;
import one.util.streamex.StreamEx;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -96,7 +97,7 @@ private Future<Map<String, List<Piece>>> createItemsWithPieceUpdate(CheckinColle
.map(PoLineCommonUtil::convertToCompositePoLine)
.compose(compPol -> pieceCreateFlowInventoryManager.processInventory(compPol, piece, checkInPiece.getCreateItem(), requestContext))
.map(voidResult -> new PiecesHolder.PiecePoLineDto(poLineId, piece)));
} else if (checkInPiece.getId().equals(piece.getId()) && InventoryUtils.allowItemRecreate(srcTenantId, dstTenantId)) {
} else if (checkInPiece.getId().equals(piece.getId()) && InventoryUtils.allowItemRecreate(srcTenantId, dstTenantId) && Objects.nonNull(piece.getItemId())) {
pieceFutures.add(purchaseOrderLineService.getOrderLineById(poLineId, requestContext)
.map(PoLineCommonUtil::convertToCompositePoLine)
.map(compPol -> new PiecesHolder.PiecePoLineDto(compPol, piece, checkInPiece)));
Expand Down

0 comments on commit fd15c05

Please sign in to comment.