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 21480 full ppm counseling #14639

Open
wants to merge 68 commits into
base: integrationTesting
Choose a base branch
from
Open

Conversation

samaysofo
Copy link
Contributor

B-21480

Summary

These changes finds the closest transportation office that provides counseling in the GBLOC of the given duty location for oconus/conus duty locations then assign them to an order with a full PPM shipment that do not provide counseling. It also disables the counseling fee checkbox for full ppm shipments.

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

NOTE: I had to set the duty location for zip code (32222) provides_counseling to false in other to get a duty location with that status.

Run this to get all duty_location:
select * from duty_locations ;
Get the Id of one of the duty_locations and run this :
UPDATE duty_locations SET provides_services_counseling = false WHERE id = 'Provide_The_ID_You_Wish_TO_Update'
Double check if the record was updated
select * from duty_locations dl where dl.id ='The_ID_You_Updated'

How to test

  1. Access the app
  2. Login as a customer
  3. Create a move and make sure the duty location does not provide service counseling (e.g NS Mayport FL , 32228)
  4. Add a PPM shipment (make sure this is the only shipment associated with the move and the duty location is "NS Mayport FL") and submit.
  5. Login as a Service Counselor (GBLOC = CNNQ)
  6. Navigate to the "Counseling Queue".
  7. Should see the move created in step 3 with status "Needs Counseling".
  8. Login as a Task Ordering Office
  9. Navigate to the Task Order Queue
  10. Should not see the move created in step 3.
  11. Click on the "Search" nav and search for the move created in step 3 (select "Move Code" search option)
  12. Click on the move to navigate to the "Move details" page.
  13. The counseling option(checkbox) under MTO service items should be disabled.

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

https://github.com/user-attachments/assets/77d9a562-4a6b-4111-8ffc-0d64835ab4d5
https://github.com/user-attachments/assets/d769ae4d-ee2e-4409-9183-707f294a57eb

elizabeth-perkins and others added 20 commits November 26, 2024 11:19
@samaysofo samaysofo added INTEGRATION Slated for Integration Testing Go-Rillaz Go-Rillaz database frontend backend labels Jan 22, 2025
@samaysofo samaysofo self-assigned this Jan 22, 2025
@samaysofo
Copy link
Contributor Author

Samay, I'm running server_test locally, and I'm getting a failure on TestSubmitMoveForApprovalHandler ("Submits ppm success"). It seems to be erroring when it tries to fetch the closestOffice, but no rows exists.

@brianmanley-caci ok, taking a look at it.

@samaysofo , please see my code suggestion here. This fixes the test that was breaking for me, and also test the counseling office lookup failure path. If you agree with the code changes, you can apply them to your branch. 46e45b4

@brianmanley-caci i tested out your suggested changes and that fixed the broken test. I went ahead and applied the changes to the pr. Thanks

@brianmanley-caci
Copy link
Contributor

Samay, I'm running server_test locally, and I'm getting a failure on TestSubmitMoveForApprovalHandler ("Submits ppm success"). It seems to be erroring when it tries to fetch the closestOffice, but no rows exists.

@brianmanley-caci ok, taking a look at it.

@samaysofo , please see my code suggestion here. This fixes the test that was breaking for me, and also test the counseling office lookup failure path. If you agree with the code changes, you can apply them to your branch. 46e45b4

@brianmanley-caci i tested out your suggested changes and that fixed the broken test. I went ahead and applied the changes to the pr. Thanks

@samaysofo I think you also need to apply the changes from that commit in transportation_office_fetcher.go for the error handling. I'm still seeing test failures in other tests which may be because that is missing.

suite.Assertions.IsType(&handlers.ErrResponse{}, response)
internalServerErrorResponse := response.(*handlers.ErrResponse)
suite.Equal(internalServerErrorResponse.Code, http.StatusInternalServerError)
suite.Equal(internalServerErrorResponse.Err.Error(), "failure saving move when routing move submission")
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is failing. I believe the correct error message should be "Failed to find counseling office that provides counseling"

pambecker
pambecker previously approved these changes Feb 11, 2025
@brianmanley-caci
Copy link
Contributor

@samaysofo I'm seeing an error in move_router_test.go for "PPM moves are routed correctly and SignedCertification is created" now. That test probably needs to be updated as well.

msaki-caci
msaki-caci previously approved these changes Feb 12, 2025
@samaysofo samaysofo dismissed stale reviews from pambecker and msaki-caci via c3485e2 February 17, 2025 18:38
@samaysofo
Copy link
Contributor Author

PR is up for review again, when someone gets the chance. Thanks

err = suite.DB().Find(&move, move.ID)
suite.NoError(err)
suite.Equal(tt.moveStatus, move.Status)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should be testing for an expected outcome. This existing test should test for no error like it was previously. Then you could add an additional test to test the "Failed to find counseling office..." case. Does that make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yes, that makes sense. will update to add separate cases.

suite.Equal(models.MoveStatusNeedsServiceCounseling, move.Status, "expected Needs Service Counseling")
suite.Equal(models.MTOShipmentStatusSubmitted, move.MTOShipments[0].Status, "expected Submitted")
suite.Equal(models.PPMShipmentStatusSubmitted, move.MTOShipments[0].PPMShipment.Status, "expected Submitted")
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thought here with probably having different test for different expected outcomes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend database frontend Go-Rillaz Go-Rillaz INTEGRATION Slated for Integration Testing
Development

Successfully merging this pull request may close these issues.

7 participants