-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
…move into B-21551-NTSR-Estimated-Price
…to MAIN-B-21480-Full-PPM-Counseling
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 |
PR has been updated with videos. |
I ended up setting one of the duty locations |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling on closest
There was a problem hiding this comment.
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.
Test coverage on server failed.Last run: Mon 20 Jan 2025 02:36:09 PM UTC |
planner := &mocks.Planner{} | ||
planner.On("ZipTransitDistance", | ||
mock.AnythingOfType("*appcontext.appContext"), | ||
mock.Anything, | ||
mock.Anything, | ||
false, | ||
false, | ||
false, | ||
false, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
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.
Verification Steps for Reviewers
These are to be checked by a reviewer.
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
Frontend
officeApp
class or custommin-width
styling is used to hide any states the would not be visible to the user.Backend
Database
Any new migrations/schema changes:
Screenshots
https://github.com/user-attachments/assets/77d9a562-4a6b-4111-8ffc-0d64835ab4d5
https://github.com/user-attachments/assets/d769ae4d-ee2e-4409-9183-707f294a57eb