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 21507 pod poe too validation #14475

Merged
merged 62 commits into from
Jan 8, 2025

Conversation

msaki-caci
Copy link
Contributor

@msaki-caci msaki-caci commented Dec 26, 2024

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:

image

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

How to test

NOTE: We are following the same steps for 1-5 from B-21505 to setup the location for the POE/POD.

  1. Create an INTL UB shipment as a customer (CONUS -> AK or AK -> CONUS)

  2. 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() );

  3. 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.

  4. 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" }

  5. 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" }

  6. 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

  • 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

Screenshots

image

Add descriptions for POE/POD Locations in swagger.
Update API call to pull Port info
Update MTOShipment.yaml to include Port
Add POE/POD Location to MTOShipment payload
Make methods to pull the port location into the payload
update swagger definitions for POE/POD locations
Display Port Location and data on frontend MTO page
Pull the port location back in mto_shipment_fetcher
Add shipment display function for ports
Add Port Name and refactor format in shipment display
Consolidate getPoeLocation with getPodLocation for DRY code
update comment
Add port tests to model to payload for ghcapi
Restore FF for UB
Fix getPortLocation function
@brianmanley-caci brianmanley-caci self-requested a review January 7, 2025 14:21
Copy link
Contributor

@brianmanley-caci brianmanley-caci left a comment

Choose a reason for hiding this comment

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

Looks good 🎉

Screenshot 2025-01-07 at 8 21 05 AM

Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

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

Some smaller changes, also please update the storybook - ShipmentDetails.stories.jsx

Right now it's showing blank locations - should have at least one
Screenshot 2025-01-07 at 11 12 53 AM

Comment on lines 166 to 177
/**
* @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 '-';
}

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 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got this here 17cb068

Comment on lines +153 to +166
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
}
}
}
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 update/add a test to reflect these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got this here f960e09

Add poe location to ShipmentDetails.stories.jsx
Hide POE/POD Location UI if there isn't a value
Move port location formatter to formatters.js
Add toTitleCase function to formatters.js
Update test files
Start adding test to mto_shipment_fetcher_test.go
Fix serviceItemPortFSC to link to shipment model and pass DB argument
@msaki-caci
Copy link
Contributor Author

Some smaller changes, also please update the storybook - ShipmentDetails.stories.jsx

Right now it's showing blank locations - should have at least one Screenshot 2025-01-07 at 11 12 53 AM

Got this here f0d0742

@danieljordan-caci danieljordan-caci self-requested a review January 8, 2025 18:22
Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

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

LGTM! Tested CONUS -> OCONUS, OCONUS -> CONUS, intra-AK, and domestic. Port info only shows up when it should. Good work.
Screenshot 2025-01-08 at 12 21 53 PM
Screenshot 2025-01-08 at 12 22 01 PM
Screenshot 2025-01-08 at 12 22 08 PM
Screenshot 2025-01-08 at 12 22 15 PM

@brianmanley-caci brianmanley-caci self-requested a review January 8, 2025 18:44
@msaki-caci msaki-caci merged commit b5abcdc into integrationTesting Jan 8, 2025
34 checks passed
@msaki-caci msaki-caci deleted the INT-B-21507_POD-POE_TOO_Validation branch January 8, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend frontend Go-Rillaz Go-Rillaz INTEGRATION Slated for Integration Testing
Development

Successfully merging this pull request may close these issues.

4 participants