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 Prime API address validation #14870

Merged
merged 39 commits into from
Feb 25, 2025
Merged

B-22227 Prime API address validation #14870

merged 39 commits into from
Feb 25, 2025

Conversation

r-mettler
Copy link
Contributor

B-22227

INT PR

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": "lS2ptUIaLqFAfL@asdf.com",
      "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 and others added 30 commits January 25, 2025 01:34
@r-mettler r-mettler self-assigned this Feb 21, 2025
@r-mettler r-mettler requested a review from a team as a code owner February 21, 2025 19:13
@r-mettler
Copy link
Contributor Author

NOTE: The pkg/services/move/move_fetcher_test.go in the INT PR won't be in this main PR because a duplicate was introduced by the merge of INT into my B-22227-INT branch and the duplicate was removed.

Copy link
Contributor

@taeJungCaci taeJungCaci left a comment

Choose a reason for hiding this comment

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

Same as INT

Copy link
Contributor

@antgmann antgmann left a comment

Choose a reason for hiding this comment

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

All matches except the aforementioned duplicate and a commit that resolves merge issues. Looks good

@r-mettler r-mettler merged commit efd1e63 into main Feb 25, 2025
11 of 14 checks passed
@r-mettler r-mettler deleted the B-22227 branch February 25, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants