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 19821 sit auth date to db int #12668

Merged
merged 18 commits into from
May 15, 2024

Conversation

traskowskycaci
Copy link
Contributor

@traskowskycaci traskowskycaci commented May 13, 2024

Do not merge before #12593

Agility ticket

Summary

The point of this story is to store the SIT authorized end date value in the database so that it can be sent to Homesafe. Previously, this SIT authorized end date was just being calculated on the front end but not stored anywhere.

The sitStatus holds most of the frontend calculations, with pkg/services/sit_status/shipment_sit_status.go being where a lot of the meat and potatoes are for the SIT panel on the MTO page.

The work here captures that SIT authorized end date value (sitStatus.CurrentSIT.SITAuthorizedEndDate) and stores it in the mto_shipments table in either the origin_sit_auth_end_date column or the dest_sit_auth_end_date column, dependent on whether sitStatus.CurrentSIT is Origin or Destination. Logic was added to the handlers for updating a service item (when the TOO approves the service items, this populates the SIT panel initially), changing the SIT entry date of the service item, a SIT extension creation and approval by the TOO, and approval of a SIT extension request from the prime.

We also now return the SIT authorized end date stored on the shipment in the response for the prime v1, v2, and v3 getMoveTaskOrder endpoints. SIT entry date was already being included in the response for this endpoint at the service item level. Now, HSC will have both the SIT start date and SIT authorized end date available to them which is what the feature is all about.

How to test

Origin:

  1. As a customer, create a new move with shipments.
  2. Counsel the move, approve as TOO
  3. As the prime, request origin SIT. Make sure the SIT entry date is earlier than the current day you are testing AND the departure date is later than the current day.
  4. On the MTO page, approve the origin SIT service items. If your SIT panel on the MTO page does not say "Current location: origin SIT" you can modify the SIT entry date on the service item below to be a date preceding the current day.
  5. Check the mto_shipments table. You should see the origin_sit_auth_end_date value in the database populated with a value that matches what you see on the MTO page SIT panel for SIT authorized end date.
  6. Edit the SIT authorized end date or the Total days of SIT approved fields and make sure if the SIT authorized end date changes, that change is also reflected in the database.
  7. Call the prime getMoveTaskOrder endpoint for the move you created (prime v1, v2, or v3). Ensure that you see originSitAuthEndDate in the response, as well as an accurate sitEntryDate under the DOFSIT service item.

Request SIT Extension
8. As the prime, find the shipment you created for your new move that still has the current location as origin SIT.
9. "Request SIT Extension" as the prime
10. Go back to the MTO page as the TOO
11. Find the Review request next to "Additional Days Requested"
image
12. Reject the SIT extension. You can change the dates on the modal, but rejecting should NOT update the SIT auth end date or allowed days.
13. As the prime, request another SIT extension.
14. As the TOO, modify the SIT auth end date or days allowed and approve the extension.
15. Call the prime getMoveTaskOrder endpoint for the move you created (prime v1, v2, or v3). Ensure that you see originSitAuthEndDate in the response, as well as an accurate sitEntryDate under the DOFSIT service item.

Destination:

  1. As a customer, create a new move with shipments.
  2. Counsel the move, approve as TOO
  3. As the prime, request destination SIT. Make sure the SIT entry date is earlier than the current day you are testing AND the departure date is later than the current day.
  4. On the MTO page, approve the destination SIT service items. If your SIT panel on the MTO page does not say "Current location: destination SIT" you can modify the SIT entry date on the service item below to be a date preceding the current day.
  5. Check the mto_shipments table. You should see the dest_sit_auth_end_date value in the database populated with a value that matches what you see on the MTO page SIT panel for SIT authorized end date.
  6. Edit the SIT authorized end date or the Total days of SIT approved fields and make sure if the SIT authorized end date changes, that change is also reflected in the database.
  7. Call the prime getMoveTaskOrder endpoint for the move you created (prime v1, v2, or v3). Ensure that you see destinationSitAuthEndDate in the response, as well as an accurate sitEntryDate under the DDFSIT service item.

Request SIT Extension
8. As the prime, find the shipment you created for your new move that still has the current location as destination SIT.
9. "Request SIT Extension" as the prime
10. Go back to the MTO page as the TOO
11. Find the Review request next to "Additional Days Requested"
image
12. Reject the SIT extension. You can change the dates on the modal, but rejecting should NOT update the SIT auth end date or allowed days.
13. As the prime, request another SIT extension.
14. As the TOO, modify the SIT auth end date or days allowed and approve the extension.
15. Call the prime getMoveTaskOrder endpoint for the move you created (prime v1, v2, or v3). Ensure that you see originSitAuthEndDate in the response, as well as an accurate sitEntryDate under the DOFSIT service item.

@traskowskycaci traskowskycaci added Mountain Movers Movin' Mountains 1 Sprint at a time INTEGRATION Slated for Integration Testing labels May 15, 2024
@traskowskycaci traskowskycaci self-assigned this May 15, 2024
@traskowskycaci traskowskycaci marked this pull request as ready for review May 15, 2024 12:12
@traskowskycaci traskowskycaci requested a review from a team as a code owner May 15, 2024 12:12
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.

Ran into an issue in your first scenario. Here's how to replicate:

  • change auth end date in SIT panel (changes in db are good)
  • change SIT entry date for origin 1st day SIT, change reflect in SIT panel but does not update the database

Need to also update SIT auth end date in the database when the SIT entry date update handler fires.

@traskowskycaci
Copy link
Contributor Author

Ran into an issue in your first scenario. Here's how to replicate:

  • change auth end date in SIT panel (changes in db are good)
  • change SIT entry date for origin 1st day SIT, change reflect in SIT panel but does not update the database

Need to also update SIT auth end date in the database when the SIT entry date update handler fires.

Great catch, fixing now

@traskowskycaci
Copy link
Contributor Author

Ran into an issue in your first scenario. Here's how to replicate:

  • change auth end date in SIT panel (changes in db are good)
  • change SIT entry date for origin 1st day SIT, change reflect in SIT panel but does not update the database

Need to also update SIT auth end date in the database when the SIT entry date update handler fires.

Should be working now

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.

Muuuuuuch better. Walked through each scenario and passed all test cases. Good work. This looked like it sucked. LGTM!

@traskowskycaci traskowskycaci merged commit d5c0f40 into integrationTesting May 15, 2024
30 checks passed
@traskowskycaci traskowskycaci deleted the B-19821-sit-auth-date-to-db-INT branch May 15, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INTEGRATION Slated for Integration Testing Mountain Movers Movin' Mountains 1 Sprint at a time
Development

Successfully merging this pull request may close these issues.

None yet

4 participants