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 18491 update endpoint for updateMTOServiceItem MAIN #11909

Merged
merged 8 commits into from
Feb 12, 2024

Conversation

traskowskycaci
Copy link
Contributor

@traskowskycaci traskowskycaci commented Feb 1, 2024

INTEGRATION PR: #11908

Agility ticket

Summary

The updateMTOServiceItem only allows a service item without a SITDestinationFinalAddress field value to be created. It does not allow updates of the SITDestinationFinalAddress value if it already exists.

Since we populate the SITDestinationFinalAddress for destination SIT service items DDASIT, DDDSIT, DDFSIT, and DDSFSC at the time of destination SIT request/creation, there will never be a case where a destination SIT service item has an empty SITDestinationFinalAddress field, so this endpoint can never update that SITDestinationFinalAddress field.

Based on those findings, a new v2 endpoint was not needed. Instead, I added the four destination service codes as an explicit check that ensures the final destination address field cannot be updated. The added check does not break any functionality, it just clearly documents what was already happening based on the current logic in place.

I updated the error message to be more informative and to direct end users to update the shipment destination address if they want to update the destination SIT service item's final destination address.

I also expanded tests to reflect this functionality and updated the documentation for the endpoint.

The updateMTOServiceItem does allow the SITDestinationFinalAddress field value to be created for origin SIT service items, however, that column being populated for origin SIT service items is not relevant to SIT calculations. Instead, we are focusing on the destination SIT service items and their SITDestinationFinalAddress value.

How to test

  1. Access the office application.
  2. Login as a prime user.
  3. Request destination SIT, which creates the 4 destination service items: DDASIT, DDDSIT, DDFSIT, and DDSFSC.
  4. Using swagger or postman, use the updateMTOServiceItem endpoint to try updating the SITDestinationFinalAddress for any of the four destination SIT service items. Example request body:
    {
    "modelType": "UpdateMTOServiceItemSIT",
    "SITDestinationFinalAddress": {
    "ID": "62e795f4-61a8-4cca-b59d-028345c07b89",
    "StreetAddress1": "Maria Street Address 1",
    "City": "Herington",
    "State": "KS",
    "PostalCode": "66667",
    "Country": "United States"
    }
    }
  5. Check that you receive a 422 with an error message directing you to update the shipment destination address:
    image
  6. Check that the database value for SITDestinationFinalAddress was not changed for the service item, and make sure that the SITDestinationFinalAddress for the service item still matches the shipment destination address.

@traskowskycaci traskowskycaci added the Mountain Movers Movin' Mountains 1 Sprint at a time label Feb 1, 2024
@traskowskycaci traskowskycaci self-assigned this Feb 1, 2024
@traskowskycaci traskowskycaci marked this pull request as ready for review February 8, 2024 17:56
@traskowskycaci traskowskycaci requested a review from a team as a code owner February 8, 2024 17:56
Copy link
Contributor

@cameroncaci cameroncaci left a comment

Choose a reason for hiding this comment

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

Commit hashes are good

@deandreJones deandreJones merged commit 6df3d24 into main Feb 12, 2024
38 checks passed
@deandreJones deandreJones deleted the B-18491-update-endpoint-updateMTOServiceItem-MAIN branch February 12, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mountain Movers Movin' Mountains 1 Sprint at a time
Development

Successfully merging this pull request may close these issues.

4 participants