Skip to content
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

B 22087 int - Number of shipments in the search queue not decreasing when shipments are deleted #14865

Merged
merged 34 commits into from
Mar 4, 2025

Conversation

JonSpight
Copy link
Contributor

@JonSpight JonSpight commented Feb 21, 2025

Agility ticket

Summary

When there are multiple shipments and 1 is deleted, the number of shipments does not account for the deleted shipment

How to test

  1. Create a Move with four shipments (all either approved or submitted status).
  2. Sign in as a Service Counselor and search for the move using the move code.
  3. Verify the # of shipments is four.
  4. repeat steps 2-3 as TOO.
  5. repeat steps 2-3 as TIO.
  6. Change one of the shipments status to REJECTED.
  7. Change one of the shipments status to CANCELED.
  8. Delete one shipment
  9. Sign in as a Service Counselor and search for the move using the move code.
  10. Verify the # of shipments is one.
  11. repeat steps 6- 9 but as TOO.
  12. repeat steps 6- 9 but as TIO.

dependabot bot and others added 4 commits February 4, 2025 19:16
Bumps [store2](https://github.com/nbubna/store) from 2.14.2 to 2.14.4.
- [Commits](nbubna/store@2.14.2...2.14.4)

---
updated-dependencies:
- dependency-name: store2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
@JonSpight JonSpight self-assigned this Feb 21, 2025
@JonSpight JonSpight added G-Unit Scrum Team G INTEGRATION Slated for Integration Testing backend labels Feb 21, 2025
@JonSpight JonSpight marked this pull request as ready for review February 21, 2025 18:15
@JonSpight JonSpight requested a review from a team as a code owner February 21, 2025 18:15
Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way that I read the AC and understand it, is they still want rejected/canceled shipments to be included no? They just don't want to include deleted shipments.

If that's not the case, then I'd recommend updating the AC and getting clarification since rejected/canceled shipments still show on the MTO page.

I'd recommend you check out ExcludeDeletedScope in the backend to help you out and not return deleted shipments when querying the db.

@danieljordan-caci
Copy link
Contributor

After talking with @JonSpight on Slack, seems like we might have some limitations with Pop and so we are unable to use ExcludeDeletedScope() effectively as well as adding an explicit

query := appCtx.DB().Q().Where("mto_shipments.deleted_at IS NULL")

to where we can filter these out at the db successfully

Think the approach is fine, but would suggest moving the filtering closer to the service object and filtering out deleted shipments within the order fetcher & move search functions

pambecker
pambecker previously approved these changes Mar 4, 2025
@paulstonebraker
Copy link
Contributor

tested and ready to approve, just waiting to hear back from Jon on if MTOShipmentStatusCancellationRequested should be included or excluded in the count

paulstonebraker
paulstonebraker previously approved these changes Mar 4, 2025
Copy link
Contributor

@paulstonebraker paulstonebraker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had previously tested with the changes from the most recent commit so I am comfortable approving!

@pambecker
Copy link
Contributor

Can you please update the 'How to test' above as well, to match the new findings and not include Cancellation Requested.

Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!

@JonSpight JonSpight merged commit 11ad97f into integrationTesting Mar 4, 2025
6 checks passed
@JonSpight JonSpight deleted the B-22087-int branch March 4, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend G-Unit Scrum Team G INTEGRATION Slated for Integration Testing
Development

Successfully merging this pull request may close these issues.

7 participants