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-21378: Introduce iUB RDD Transit Calculation #14563

Merged
merged 45 commits into from
Jan 30, 2025

Conversation

TevinAdams
Copy link
Contributor

@TevinAdams TevinAdams commented Jan 10, 2025

Agility ticket

Summary

In this PR the goal was to make sure the Required Delivery Date on a UB shipment is populated. To populate the field there are some requirements.

  1. The shipment must have a scheduled pickup date
  2. The shipment must be a UB shipment

Required delivery date for a UB shipment is made using the following formula:
rdd = (scheduledPickupDate + 1 day) + re_intl_transit_times.ub_transit_time
Then that rdd value is applied to the UB shipment

Is there anything you would like reviewers to give additional scrutiny?

this article explains more about the approach used.

Verification Steps for the Author

These are to be checked by the author.

  • Tested in the Experimental environment (for changes to containers, app startup, or connection to data stores)
  • Have the Agility acceptance criteria been met for this change?

Verification Steps for Reviewers

These are to be checked by a reviewer.

  • Has the branch been pulled in and checked out?
  • Have the BL acceptance criteria been met for this change?
  • Was the CircleCI build successful?
  • Has the code been reviewed from a standards and best practices point of view?

Setup to Run the Code

How to test

*Note: There may not be a re_intl_transit_times record with a origin_rate_area_id and a destination_rate_area_id that both exists in re_oconus_rate_areas.
In that case you will have to edit an intl_transit_time_record in the DB to have an origin and destination rate area id that does exist in the re_oconus_rate_areas table.

select *
from re_intl_transit_times
where origin_rate_area_id in (select rate_area_id from re_oconus_rate_areas)
and destination_rate_area_id in (select rate_area_id from re_oconus_rate_areas)

  1. Create a UB shipment as a MyMove user
  • Use addresses that have a us_post_region_cities_id that exist in a record in re_oconus_rate_areas table
  • Current address I used an address in zipcode 29229
  • Current duty location: Fort Jackson
  • Duty Location: Use a duty location that has an address that has a us_post_region_cities_id in re_oconus_rate_areas. In my case I used Eielson, AFB
  1. As SC counsel move
  2. As TOO approve move
  3. As Prime update the shipment with a scheduled pickup date
  4. Check the shipment in the DB and make sure the Required delivery date is populated

Frontend

  • There are no aXe warnings for UI.
  • This works in Supported Browsers and their phone views (Chrome, Firefox, Edge).
  • There are no new console errors in the browser devtools.
  • There are no new console errors in the test output.
  • If this PR adds a new component to Storybook, it ensures the component is fully responsive, OR if it is intentionally not, a wrapping div using the officeApp class or custom min-width styling is used to hide any states the would not be visible to the user.
  • This change meets the standards for Section 508 compliance.

Backend

Database

Any new migrations/schema changes:

  • Follows our guidelines for Zero-Downtime Deploys.
  • Have been communicated to #g-database.
  • Secure migrations have been tested following the instructions in our docs.

Screenshots

@TevinAdams TevinAdams self-assigned this Jan 10, 2025
@TevinAdams TevinAdams requested a review from a team as a code owner January 10, 2025 15:24
@TevinAdams TevinAdams changed the title required delivery date is populated on ub shipments B-21378: Introduce iUB RDD Transit Calculation Jan 10, 2025
@TevinAdams TevinAdams added Mountain Movers Movin' Mountains 1 Sprint at a time INTEGRATION Slated for Integration Testing labels Jan 10, 2025
@TevinAdams TevinAdams marked this pull request as draft January 10, 2025 21:51
@TevinAdams TevinAdams marked this pull request as ready for review January 13, 2025 18:16
@danieljordan-caci
Copy link
Contributor

Conflicts

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.

Does not appear to function for Prime V3 path updateMTOShipment API call via postman. RDD is only calculated on UpdateMTOShipmentStatus service, which is not called by UpdateMTOShipment within mto_shipment_updater.go

An error should also likely return if RDD can't be calculated for the RDD

Endpoint http://primelocal:3000/prime/v3/mto-shipments/:mtoShipmentID
Shipment ID being a UB shipment
{
  "scheduledDeliveryDate": "2025-01-20"
}

pkg/models/re_contract_year.go Outdated Show resolved Hide resolved
pkg/services/mto_shipment/rules.go Outdated Show resolved Hide resolved
@TevinAdams TevinAdams marked this pull request as draft January 16, 2025 17:21
@TevinAdams
Copy link
Contributor Author

Missing tests

image

Screenshot 2025-01-23 at 2 09 07 PM

@cameroncaci additional tests added. Went through with the debugger and those lines are hit by tests.

@TevinAdams TevinAdams requested a review from a team January 29, 2025 13:59
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.

You have a failing server test

@TevinAdams
Copy link
Contributor Author

You have a failing server test

@danieljordan-caci Fixed

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.

Looks good! Able to update the scheduled pickup date and the RDD sets/adjusts for UB shipments.

Screenshot 2025-01-30 at 10 53 39 AM
Screenshot 2025-01-30 at 10 53 52 AM

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.

oh wait, retract that approval - I see you have failing tests still

@TevinAdams TevinAdams merged commit 5a501f2 into integrationTesting Jan 30, 2025
34 checks passed
@TevinAdams TevinAdams deleted the B-21378-iUB-RDD-Transit-Calculation-INT branch January 30, 2025 18:57
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.

3 participants