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

INT B-22057 #14336

Merged
merged 2 commits into from
Dec 4, 2024
Merged

INT B-22057 #14336

merged 2 commits into from
Dec 4, 2024

Conversation

danieljordan-caci
Copy link
Contributor

@danieljordan-caci danieljordan-caci commented Dec 4, 2024

Agility ticket

Summary

With the work done in B-21986 we changed how the estimated & (new) max incentive calculations are done for PPMs. Problem is, we had a handful of PPMs in prod that need to be retroactively addressed.

This PR added a prod migration that will change move, shipment, and PPM statuses when:

  • max_incentive in ppm_shipments is NULL

This PR also adds a way for the SC to see the Max Incentive value stored in the max_incentive column in the ppm_shipments table

Migration:

-- if the PPM has a null max incentive, we need to let the SC go through the workflow to recalculate the max/estimated incentives
-- change move status so SCs can know to take these actions
UPDATE moves
SET status = 'NEEDS SERVICE COUNSELING'
FROM mto_shipments
JOIN ppm_shipments ON mto_shipments.id = ppm_shipments.shipment_id
WHERE ppm_shipments.max_incentive IS NULL
  AND mto_shipments.move_id = moves.id;

UPDATE mto_shipments
SET status = 'SUBMITTED'
WHERE id IN (
    SELECT mto_shipments.id
    FROM mto_shipments
    JOIN ppm_shipments ON mto_shipments.id = ppm_shipments.shipment_id
    WHERE ppm_shipments.max_incentive IS NULL
);

UPDATE ppm_shipments
SET status = 'SUBMITTED'
WHERE max_incentive IS NULL;

UPDATE ppm_shipments
SET advance_status = NULL
WHERE max_incentive IS NULL
    AND has_requested_advance = 'true';

This will land the PPM/shipments back into the SC's queue, where they can "Submit move details" again after reviewing and the max and estimated incentives will recalculate based on the new code in pkg/services/move_task_order/move_task_order_updater.go

How to test

  1. Access MM as a customer
  2. Complete PPMs with & without an advance and submit the move
  3. Complete the approval process as the SC
  4. Find the PPMs in DBeaver and turn the max_incentive value to NULL
  5. Then run the above migration snippet in DBeaver
  6. Navigate back to the moves (which should be in NEEDS SERVICE COUNSELING status)
  7. If you are approving an advance, you will see the max_incentive populate after saving & continuing through that
  8. If you did NOT request an advance, that column will populate when you click Submit move details as the SC
Screenshot 2024-12-04 at 3 21 48 PM

@danieljordan-caci danieljordan-caci added the INTEGRATION Slated for Integration Testing label Dec 4, 2024
@danieljordan-caci danieljordan-caci requested a review from a team December 4, 2024 21:18
@danieljordan-caci danieljordan-caci self-assigned this Dec 4, 2024
@danieljordan-caci danieljordan-caci requested a review from a team as a code owner December 4, 2024 21:18
@danieljordan-caci danieljordan-caci requested review from a team as code owners December 4, 2024 21:18
@robot-mymove
Copy link

Test coverage on server failed.

Last run: Wed 04 Dec 2024 09:39:18 PM UTC
Refer to this report to see coverage details for the server app.
Documentation for test coverage can be found at this link.

@cameroncaci cameroncaci added the Mountain Movers Movin' Mountains 1 Sprint at a time label Dec 4, 2024
@deandreJones
Copy link
Contributor

Validated that the secure migration is correct in prod only and blank files every other environment

@danieljordan-caci
Copy link
Contributor Author

Flaky tests failing flakily

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.

Amazing work, no critiques here

@danieljordan-caci danieljordan-caci merged commit bafa578 into integrationTesting Dec 4, 2024
29 of 30 checks passed
@danieljordan-caci danieljordan-caci deleted the INT-B-22057 branch December 4, 2024 22:16
@danieljordan-caci danieljordan-caci mentioned this pull request Dec 4, 2024
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.

5 participants