-
Notifications
You must be signed in to change notification settings - Fork 35
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
MAIN - B-22251 Update existing process for approving move and shipment #14702
MAIN - B-22251 Update existing process for approving move and shipment #14702
Conversation
…ment approval and added tests
Bundle StatsHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded
Removed
Bigger No assets were bigger Smaller
Unchanged
|
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.
LGTM!
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.
lgtm
B-22251
INT PR:
#14704
#14728 (This change was to fix a test that got merged in after mine. This change can be added to #14630 if this PR gets merged in first.)
Summary
Issues:
This fixes several production defects that occur when a TOO approves a move or shipment (sending it to Prime). The issues were primarily caused by race conditions between API calls and database updates. Additionally, the 'available to prime' field was being set during the move approval process, but this approach doesn't work because shipment service items are created later—during the shipment approval step, which happens after the move approval.
To address issue 1:
Move was being made available to prime when a move is approved but before service items were created. In between those times, the prime could be pulling in the data without items attached.
approveShipments
GHC api that takes in array of objects containingshipmentID
andeTag
and approve one or more shipments in one api call if allowed.availableToPrimeAt
inMakeAvailableToPrime
and made it it's own function which is now being called in theapproveShipment
andapproveShipments
api. Also moved other related codes.availableToPrimeAt
is now being called and being populated after move and shipment has been approved.To address issues 2 & 3:
Mostly race condition issues with the status getting updated by other db changes.
ApproveOrRequestApproval
func call at the end of creating service items which checks and sets the move status.How to test
APPROVALS REQUESTED
under move object.APPROVED
.availableToPrimeAt
value somewhere in your notes.mto_service_items
in dev tools shown in the screenshot and check all thecreatedAt
timestamp for all the service items and verify thatavailableToPrimeAt
has the latest timestamp. (NOTE: the move history will not have the list in order so verify with timestamps.)APPROVED
.Screenshots