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 #14572

Closed
wants to merge 48 commits into from

Conversation

samaysofo
Copy link
Contributor

@samaysofo samaysofo commented Jan 13, 2025

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

loganwc and others added 30 commits October 29, 2024 16:07
@samaysofo
Copy link
Contributor Author

fyi, working on adding the screenshots. the duty location (NS Mayport, FL) that was being used during development is no longer there in the location lookup.

@danieljordan-caci
Copy link
Contributor

fyi, working on adding the screenshots. the duty location (NS Mayport, FL) that was being used during development is no longer there in the location lookup.

Yeah they are getting away from Prime counseled moves. My advice would be to just edit the provides_counseling value in whatever duty location you use to get the desired result.

@samaysofo
Copy link
Contributor Author

PR has been updated with videos.

@samaysofo
Copy link
Contributor Author

fyi, working on adding the screenshots. the duty location (NS Mayport, FL) that was being used during development is no longer there in the location lookup.

Yeah they are getting away from Prime counseled moves. My advice would be to just edit the provides_counseling value in whatever duty location you use to get the desired result.

I ended up setting one of the duty locations provides_counseling value i wanted to use in the db.

@@ -305,3 +306,95 @@ func findOconusGblocDepartmentIndicator(appCtx appcontext.AppContext, dutyLocati
return nil, apperror.NewImplementationError(fmt.Sprintf("Error: Cannot determine GBLOC -- serviceMember.Affiliation: %s, DutyLocaton: %s, departmentIndicator: %s, dutyLocation.Address.ID: %s",
serviceMember.Affiliation, dutyLocation.Name, *departmentIndicator, dutyLocation.Address.ID))
}

// Return the closeset transportation office in the GBLOC of the given duty location for oconus/conus duty locations
Copy link
Contributor

Choose a reason for hiding this comment

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

spelling on closest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This pr is still open for review, when anyone gets the chance. Waiting on making the typo change if by chance someone else has some recommended changes to make all at once.

@robot-mymove
Copy link

robot-mymove commented Jan 16, 2025

Test coverage on server failed.

Last run: Mon 20 Jan 2025 02:36:09 PM UTC
Refer to this report to see coverage details for the server app.
Documentation for test coverage can be found at this link.

planner := &mocks.Planner{}
planner.On("ZipTransitDistance",
mock.AnythingOfType("*appcontext.appContext"),
mock.Anything,
mock.Anything,
false,
false,
false,
false,
Copy link
Contributor

Choose a reason for hiding this comment

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

ZipTransitDistance only takes 5 arguments. I can't tell why it takes a 4th and 5th but definitely doesn't need a 6th and 7th. Seems like maybe a wonky merge thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, looks like a wonky merge got me

@@ -177,18 +177,17 @@ describe('RequestedShipments', () => {
moveCode: 'TE5TC0DE',
};

it('does not render the "Add service items to move" section or Counseling option when all shipments are PPM', () => {
it('should disable the counseling checkbox when full ppm shipment', () => {
Copy link
Contributor

@ajlusk ajlusk Jan 20, 2025

Choose a reason for hiding this comment

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

Basically inconsequential but while you're fixing typos, it seems the previous language at the end of this was more accurate. "Full PPM" describes a move, not a shipment. There's a similar rephrasing in a few places.

for i := range move.MTOShipments {
// if it's a PPMShipment update both the mto and ppm shipment level statuses
if move.MTOShipments[i].ShipmentType == models.MTOShipmentTypePPM {
move.MTOShipments[i].Status = models.MTOShipmentStatusSubmitted
move.MTOShipments[i].PPMShipment.Status = models.PPMShipmentStatusSubmitted
// actual expense reimbursement is always true for civilian moves
move.MTOShipments[i].PPMShipment.IsActualExpenseReimbursement = models.BoolPointer(isCivilian)
if move.IsPPMOnly() && !orders.OriginDutyLocation.ProvidesServicesCounseling {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a test for this logic in move_router_test.go?

@@ -13,4 +13,5 @@ type TransportationOfficesFetcher interface {
GetTransportationOffice(appCtx appcontext.AppContext, transportationOfficeID uuid.UUID, includeOnlyPPMCloseoutOffices bool) (*models.TransportationOffice, error)
GetAllGBLOCs(appCtx appcontext.AppContext) (*models.GBLOCs, error)
GetCounselingOffices(appCtx appcontext.AppContext, dutyLocationID uuid.UUID) (*models.TransportationOffices, error)
FindClosestCounselingOffice(appCtx appcontext.AppContext, dutyLocationID uuid.UUID) (models.TransportationOffice, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

To be consistent with the other functions, could you return a pointer to the transportation office?
FindClosestCounselingOffice(appCtx appcontext.AppContext, dutyLocationID uuid.UUID) (*models.TransportationOffice, error)


func (suite *TransportationOfficeServiceSuite) Test_FindClosestCounselingOfficeCONUS() {
suite.toFetcher = NewTransportationOfficesFetcher()
customAddress1 := models.Address{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use address_factory.BuildAddress to create these addresses?

models.AffiliationSPACEFORCE}

setupServiceMember := func(serviceMemberAffiliation models.ServiceMemberAffiliation) models.ServiceMember {
customServiceMember := models.ServiceMember{
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 could use service_member_factory here.

},
},
}, nil)
suite.MustSave(&origDutyLocation)
Copy link
Contributor

@ajlusk ajlusk Jan 21, 2025

Choose a reason for hiding this comment

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

I believe the suite.MustSave here is redundant and superfluous.

It's needed for the address above but since you already used the factory with a DB connection for the duty location it isn't doing anything. It's very easy to copy and paste from somewhere else. I was recently corrected on the same thing.

@samaysofo samaysofo closed this Jan 22, 2025
@samaysofo samaysofo deleted the INT-B-21480-Full-PPM-Counseling branch February 28, 2025 18:19
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.

9 participants