-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MODORDERS -1087 Delete received pieces in bulk #905
base: master
Are you sure you want to change the base?
Conversation
PieceDeletionHolder holder = new PieceDeletionHolder().withDeleteHolding(false); | ||
|
||
List<Future> deleteFutures = ids.stream() | ||
.map(id -> pieceStorageService.getPieceById(id, requestContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of fetching piece one by one, can we get as collections? like getPieces(List pieceIds)..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try it. I see there is a max number of get pieces in batch is 15. I am not sure why. but, I will try it first, and see how it goes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is some constant to prevent long url query size, the max size of url length - 4 kb, historically we use chunks by 15 elems to avoid this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the info, Serhii
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please reformat this file one more time
holder.withPieceToDelete(pieceToDelete); | ||
return null; | ||
}) | ||
.compose(aHolder -> basePieceFlowHolderBuilder.updateHolderWithOrderInformation(holder, requestContext)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same logic also is in deletePiece method. We should avoid code duplication, logic should be in 1 places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you Serhii, I will rewrite this part
…ion for piecesap.java, modify VeryfyDeleteResponse in RestTestsUtils.java
Quality Gate passedIssues Measures |
# Conflicts: # src/main/java/org/folio/service/pieces/flows/delete/PieceDeleteFlowInventoryManager.java # src/main/java/org/folio/service/pieces/flows/delete/PieceDeleteFlowManager.java # src/test/java/org/folio/service/pieces/flows/delete/PieceDeleteFlowManagerTest.java
Purpose: Libraries that use the Receiving app for receipt of print serials may wish to delete pieces that precede a specific date. Currently, FOLIO supports the deletion of pieces, but one at a time. When a library wishes to purge receiving records for multiple years on an ongoing workflow, the ability to delete pieces in bulk will streamline this workflow.
Weeding old journal issues; receiving records no longer necessary since items have been withdrawn
User story statement(s):
As a serials librarian,
I want to delete multiple pieces at one time
so that the continuous addition of pieces does not eventually impact performance of the Receiving app.
Scenarios:
Bulk edit received/expected pieces:
Given user has received multiple piece records for a given receiving title
When expanding received/expected pieces accordion
Then user has option in action menu for Bulk edit
Select one or more pieces:
Given user clicks Bulk edit
When toggles appear in table
Then user can select one or more pieces
Edit pieces:
Given user has selected one or more pieces
When user clicks edit piece button
Then Bulk edit piece form is displayed
Delete all pieces
Given user clicks edit piece button
When Bulk edit piece form is displayed
Then "Delete all" button is active
Delete all pieces confirmation
Given user is viewing Bulk edit piece form
When user clicks "Delete all"
Then confirmation modal is shown
Message: "This will permanently remove all the pieces you have selected. Any related items with a status of "On order" will also be deleted. Would you like to proceed?
AND user can confirm or cancel
Library enhancement suggested by Lafayette College (May 2022 adopter)