-
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 21507 pod poe too validation #14475
Int b 21507 pod poe too validation #14475
Conversation
Consolidate getPoeLocation with getPodLocation for DRY code
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.
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.
src/utils/shipmentDisplay.jsx
Outdated
/** | ||
* @description This function is used to format the port in the | ||
* ShipmentAddresses component. | ||
* It displays only the port code, port name, city, state and zip code. | ||
* */ | ||
export function formatPortInfo(port) { | ||
if (port) { | ||
return `${port.portCode} - ${port.portName}\n${port.city}, ${port.state} ${port.zip}`; | ||
} | ||
return '-'; | ||
} | ||
|
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 move this to formatters.js
instead of here? I think potentially we will need this in a more broad form throughout the app and that file seems more relevant.
This isn't a hill I want to die on, but I'd prefer Seattle, Washington
over SEATTLE, WASHINGTON
y'know? Not enforcing it, just want to bring that up.
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.
Got this here 17cb068
for _, serviceItem := range shipments[i].MTOServiceItems { | ||
if serviceItem.PODLocation != nil { | ||
loadErr := appCtx.DB().Load(serviceItem.PODLocation, "City", "Country", "UsPostRegionCity.UsPostRegion.State") | ||
if loadErr != nil { | ||
return nil, loadErr | ||
} | ||
} | ||
if serviceItem.POELocation != nil { | ||
loadErr := appCtx.DB().Load(serviceItem.POELocation, "City", "Country", "UsPostRegionCity.UsPostRegion.State") | ||
if loadErr != nil { | ||
return nil, loadErr | ||
} | ||
} | ||
} |
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 update/add a test to reflect these changes?
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.
Got this here f960e09
…OD-POE_TOO_Validation
Got this here f0d0742 |
…OD-POE_TOO_Validation
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.
B-21507
Summary
We are adding a view for the Port of Embark and Port of Debark for the TOO and any other office user with the ability to view the MTO page.
They should be able to view the Port of Embark or Port of Debark based on whichever one is populated the other port should be blank. Here is an example:
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
How to test
Create an INTL UB shipment as a customer (CONUS -> AK or AK -> CONUS)
Manually create the mto_service_items table for the shipment:
INSERT INTO mto_service_items ( id, mto_shipment_id, move_id, re_service_id, status, created_at, updated_at, approved_at ) VALUES ( uuid_generate_v4(), '8eeba537-bb40-4f58-a534-74ea9ff64590', '813b7a43-2e3f-42f3-8c4e-eca95390d5ca', '388115e8-abe9-441d-96cf-a39f24baa0a3', 'APPROVED'::service_item_status, NOW(), NOW(), NOW() );
In the prime v3 api, call getMoveTaskOrder using the move_id for the service item you created in step 2. You will need the etag for the newly created service item for the next step.
In the prime v1 api, call updateMTOServiceItem using a payload like this (adjust for you specific service item ID):
{ "id": "40b7e71a-6b03-4413-8601-dea694253ee3", "modelType": "UpdateMTOServiceItemInternationalPortFSC", "portCode": "PDX", "reServiceCode": "PODFSC" }
Verify that you receive a 200 response like this:
{ "reServiceCode": "PODFSC", "eTag": "MjAyNC0xMi0wMlQxNjo0MjoxNi42NjUwNDla", "id": "40b7e71a-6b03-4413-8601-dea694253ee3", "modelType": "MTOServiceItemBasic", "moveTaskOrderID": "813b7a43-2e3f-42f3-8c4e-eca95390d5ca", "mtoShipmentID": "8eeba537-bb40-4f58-a534-74ea9ff64590", "reServiceName": "International POD Fuel Surcharge", "status": "APPROVED" }
Login as a TOO user or any office user that has permissions to access the MTO page. Search up the move id that we used to setup the POD/POE. When you travel to the MTO Page, you should now see the Port of Embark or Debark populated with the Port Code, Port Name, City, State, and Zip associated with it.
Frontend
officeApp
class or custommin-width
styling is used to hide any states the would not be visible to the user.Backend
Screenshots