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-21094: Automatic Reweigh Based on Estimated Weight #14364

Merged
merged 47 commits into from
Feb 10, 2025

Conversation

WeatherfordAaron
Copy link
Contributor

Agility Ticket: B-21094

Agility Ticket's Acceptance Criteria

As the MilMove system (on behalf of the TOO),
I need to request a reweigh for all shipments on a customer's move based on the sum of the estimated weight(s),
So that I can ensure the customer has the greatest chance of reweighs being performed on all of their shipments (through the use of more advanced notice).

AC1: 
Given the sum of all estimated weights on a customer's move,
When that sum is within 10% (or greater) of the customer's weight entitlement,
Then a reweigh is requested for all shipments on a that move (excludes PPMs).

AC2: PRESERVE EXISTING CAPABILITY ALREADY IN MILMOVE
Given a customer's move where the sum of the estimated weights did not result in automatic reweigh(s) being requested,
When the sum of the actual shipment weights is within 10% (or greater) of the customer's weight entitlement,
Then a reweigh is requested for all shipments on that move (excludes PPMs).

How to test

  1. As a Service Member, create a new move + orders + at least 2 non-PPM shipments.
  2. As Service Counsellor, update the move's orders and approve/send the move.
  3. As TOO, approve the shipments (this should make the move available to the Prime user role).
  4. As Prime, update each shipment so that the sum of the Estimated Weights of all the shipments on the move falls within the top 10% of the Authorized Weight.

Note 1: Currently you must enter both Estimated and Actual Weights on each of the shipments if you are using the Prime Simulator because current form validation forces you to do so.. however, this is a ticket which should change this functionality so that the Prime Simulator can have Estimated Weight without the need for Actual Weight (and vice versa).


Note 2: The reason the sum needs to fall within the top 10% of the Authorized Weight is because other logic may be carried out once the sum of Estimated Weights or Actual Weights goes over the Authorized Weight.


Authorized Weight = A
Target Weight Floor = T
A * 0.9 = T

Example: If Authorized Weight is 7000 lbs, 7000 * 0.9 = 6300. This means that, from the entire move, if the sum of the Estimated Weights is at least 6300 lbs or the sum of the Actual Weights is at least 6300 lbs, it will trigger an automatic reweight request.

  1. As soon as the sum of the Estimated Weights of the shipments on the move falls within the top 10% of the Authorized Weight, you should see the "Reweigh Weight" attribute (seen below) with the red "Missing" text for each shipment on the move. This indicates that an auto-reweigh has been initiated.
Screenshot 2024-12-05 at 6 32 37 AM

@robot-mymove
Copy link

robot-mymove commented Dec 10, 2024

Warnings
⚠️

New files have been created under one of the legacy directories
(src/shared or src/scenes). Please relocate them according to the file structure described here.

View the frontend file org ADR for more information

Generated by 🚫 dangerJS against 5201b10

@WeatherfordAaron WeatherfordAaron self-assigned this Dec 10, 2024
@WeatherfordAaron WeatherfordAaron added ByteSize M&Ms Team ByteSized M&Ms INTEGRATION Slated for Integration Testing labels Dec 10, 2024
@WeatherfordAaron WeatherfordAaron marked this pull request as ready for review December 12, 2024 17:05
@WeatherfordAaron WeatherfordAaron requested review from a team as code owners December 12, 2024 17:05
pkg/models/move.go Outdated Show resolved Hide resolved
pkg/models/move.go Outdated Show resolved Hide resolved
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 like you still have failing tests - re-request when ya get all those stubborn things resolved.

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.

Had two shipments (OCONUS) and allowance of 11,000 pounds.

Updated weights of first to be 6,000

Second shipment, updated weights to 6,000

Automatically saw the "reweigh weight: missing" populate
Screenshot 2025-02-04 at 12 12 48 PM

Verified I was prompted to address it as TOO
Screenshot 2025-02-04 at 12 11 37 PM

LGTM!

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.

Clean implementation, love the new GetAutoReweighShipments func. Works and meets AC, but noticed 2 spots for touch up

Screenshot 2025-02-05 at 3 09 59 PM
Screenshot 2025-02-05 at 3 12 51 PM

pkg/services/move/move_weights.go Outdated Show resolved Hide resolved
pkg/services/move/move_weights.go Show resolved Hide resolved
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.

Perfect!

@brooklyn-welsh brooklyn-welsh merged commit 600409c into integrationTesting Feb 10, 2025
5 of 6 checks passed
@brooklyn-welsh brooklyn-welsh deleted the INT-B-21094 branch February 10, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ByteSize M&Ms Team ByteSized M&Ms INTEGRATION Slated for Integration Testing
Development

Successfully merging this pull request may close these issues.

7 participants