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

B 22227 int Prime API address validation #14724

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

Conversation

r-mettler
Copy link
Contributor

@r-mettler r-mettler commented Jan 31, 2025

B-22227

Summary

The Prime API was not validating any addresses that the Prime enters like our City Finder tool does. This backlog adds in address validation checks in various endpoints for the Prime API.

Is there anything you would like reviewers to give additional scrutiny?

I think I got all of them, but is possible I missed an API or two that allows creating/updating of addresses. Please let me know if you find one.

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

There are several endpoints that have been updated across the prime v1, prime v2, and prime v3 APIs. Test via the Prime Sim and/or Swagger both call the same endpoints that were updated.

NOTE: In order for the address to be updated via the Prime Sim using Update Destination Address you won't see the address immediately update because the TOO has to approve the address change first. So sign in as a TOO and approve the address if you want to see the address updated in the Prime Sim.

Here are the links to the swagger pages for quick access.

Prime V1
Prime V2
Prime V3

Access the PrimeV1 page and UpdateShipmentDestinationAddress and UpdateMTOShipmentAddress with valid and invalid address
Access the PrimeV1 page and test the GetLocationByZipCityState endpoint under /addresses/zip-city-lookup/{search} by searching for a city state zip combination and verifying you get results returned. This is the same endpoint the Customer and Office APIs also have for city finder in the app. This was added so Prime could use to look up valid addresses if needed.
Access the PrimeV2 page and CreateMTOShipment, UpdateMTOShipment with valid and invalid address
Access the PrimeV3 page and CreateMTOShipment, UpdateMTOShipment with valid and invalid address

There is a template for the CreateMTOShipment endpoint below you can use and just modify the addresses as needed for your tests.
TIP: There is a copy icon on the right side of the below box you can click so you don’t have to highlight it all then copy.

{
  "moveTaskOrderID": "8366f993-610a-4e12-994e-a24bad34f3fb",
  "requestedPickupDate": "2025-01-27",
  "primeEstimatedWeight": 4500,
  "customerRemarks": "handle with care",
  "agents": [
    {
      "firstName": "string",
      "lastName": "string",
      "email": "[email protected]",
      "phone": "",
      "agentType": "RELEASING_AGENT"
    }
  ],
  "pickupAddress": {
    "streetAddress1": "123 Main Ave",
    "streetAddress2": "Apartment 9000",
    "city": "Swansea",
    "state": "IL",
    "postalCode": "62226",
    "country": "US",
    "county": "ST CLAIR",
    "isOconus": false
  },
  "secondaryPickupAddress": {
    "streetAddress1": "123 Main Ave",
    "streetAddress2": "Apartment 9000",
    "city": "Swansea",
    "state": "IL",
    "postalCode": "62226",
    "country": "US",
    "county": "ST CLAIR",
    "isOconus": false
  },
  "tertiaryPickupAddress": {
    "streetAddress1": "123 Main Ave",
    "streetAddress2": "Apartment 9000",
    "city": "Swansea",
    "state": "IL",
    "postalCode": "62226",
    "country": "US",
    "county": "ST CLAIR",
    "isOconus": false
  },
  "destinationAddress": {
    "streetAddress1": "123 Main Ave",
    "streetAddress2": "Apartment 9000",
    "city": "Swansea",
    "state": "IL",
    "postalCode": "62226",
    "country": "US",
    "county": "ST CLAIR",
    "isOconus": false
  },
  "secondaryDestinationAddress": {
    "streetAddress1": "123 Main Ave",
    "streetAddress2": "Apartment 9000",
    "city": "Swansea",
    "state": "IL",
    "postalCode": "62226",
    "country": "US",
    "county": "ST CLAIR",
    "isOconus": false
  },
  "tertiaryDestinationAddress": {
    "streetAddress1": "123 Main Ave",
    "streetAddress2": "Apartment 9000",
    "city": "Swansea",
    "state": "IL",
    "postalCode": "62226",
    "country": "US",
    "county": "ST CLAIR",
    "isOconus": false
  },
  "shipmentType": "HHG",
  "diversion": false,
  "pointOfContact": "string",
  "counselorRemarks": "counselor approved",
  "ppmShipment": {
    "expectedDepartureDate": "2025-01-27",
    "pickupAddress": {
      "streetAddress1": "123 Main Ave",
      "streetAddress2": "Apartment 9000",
      "city": "Swansea",
      "state": "IL",
      "postalCode": "62226",
      "country": "US",
      "county": "ST CLAIR",
      "isOconus": false
    },
    "secondaryPickupAddress": {
      "streetAddress1": "123 Main Ave",
      "streetAddress2": "Apartment 9000",
      "city": "Swansea",
      "state": "IL",
      "postalCode": "62226",
      "country": "US",
      "county": "ST CLAIR",
      "isOconus": false
    },
    "tertiaryPickupAddress": {
      "streetAddress1": "123 Main Ave",
      "streetAddress2": "Apartment 9000",
      "city": "Swansea",
      "state": "IL",
      "postalCode": "62226",
      "country": "US",
      "county": "ST CLAIR",
      "isOconus": false
    },
    "destinationAddress": {
      "streetAddress1": "123 Main Ave",
      "streetAddress2": "Apartment 9000",
      "city": "Swansea",
      "state": "IL",
      "postalCode": "62226",
      "country": "US",
      "county": "ST CLAIR",
      "isOconus": false
    },
    "secondaryDestinationAddress": {
      "streetAddress1": "123 Main Ave",
      "streetAddress2": "Apartment 9000",
      "city": "Swansea",
      "state": "IL",
      "postalCode": "62226",
      "country": "US",
      "county": "ST CLAIR",
      "isOconus": false
    },
    "tertiaryDestinationAddress": {
      "streetAddress1": "123 Main Ave",
      "streetAddress2": "Apartment 9000",
      "city": "Swansea",
      "state": "IL",
      "postalCode": "62226",
      "country": "US",
      "county": "ST CLAIR",
      "isOconus": false
    },
    "sitExpected": false,
    "estimatedWeight": 4200,
    "hasProGear": true,
    "proGearWeight": 0,
    "spouseProGearWeight": 0,
    "isActualExpenseReimbursement": false
  }
}

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

@r-mettler r-mettler added Scrummy Bears Scrum Team H INTEGRATION Slated for Integration Testing labels Jan 31, 2025
@r-mettler r-mettler self-assigned this Jan 31, 2025
@r-mettler r-mettler requested a review from a team as a code owner January 31, 2025 20:42
Copy link
Contributor

@MInthavongsay MInthavongsay 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. Tested via Prime API/SimUI. Had one minor comment about the validation not validating on county. Not a huge deal due to business rule restrictions.

Copy link
Contributor

@ajlusk ajlusk left a comment

Choose a reason for hiding this comment

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

Seems to be functioning as desired.

Client tests are all passing. I can't get all of the Server and Playwright tests to run properly but that seems to be my environment, not this BL. Seems to be passing locally as best as I can tell.

@r-mettler
Copy link
Contributor Author

Seems to be functioning as desired.

Client tests are all passing. I can't get all of the Server and Playwright tests to run properly but that seems to be my environment, not this BL. Seems to be passing locally as best as I can tell.

Fortunately this one was running on circle with all the automated tests prior to the switch over to gitlab and I haven't made any changes since then. All tests were passing there without issues. I will try and run the tests again locally and verify they are still passing with latest INT changes before I merge in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INTEGRATION Slated for Integration Testing Scrummy Bears Scrum Team H
Development

Successfully merging this pull request may close these issues.

3 participants