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

feat(EMS-4141): broker address lookup - manual entry #3494

Merged
merged 16 commits into from
Jan 24, 2025

Conversation

ttbarnes
Copy link
Contributor

@ttbarnes ttbarnes commented Jan 23, 2025

Introduction ✏️

This PR updates the broker address lookup functionality to allow a user to enter an address manually, when the broker is based in the UK, and/or the address lookup results are not as a user expects.

Previously, the logic was:

  • "If broker is based in the UK => address lookup".
  • "If broker is not based in the UK => manual address".

But we now allow a user to enter a manual address if a broker is based in the UK.

Resolution ✔️

E2E

  • Update relevant cypress commands to consume and pass a provideBrokerAddressManually flag/param.
  • Update cy.assertEnterAddressManuallyLink to consume a expectedText param.
  • Create a DRY clickEnterAddressManuallyLink link, cypress command.
  • Add test coverage for:
    • Submitting single and multiple contract policy applications with a broker that is based in the UK, with manual address entry.
    • Submitting the "broker manual address" form via "Save and back", when the broker is based in the UK.
    • Changing the "broker address" from "not based in the UK" to "based in the UK" - and then entering the address manually after mutiple address look up results are available.
    • Checking new and wiped values after changing answers through certain flows/scenarios.

API

  • Update mapBrokerAddress XLSX mapping function to return a value of FULL_ADDRESS or mapBrokerAddressBasedInTheUk, regardless of IS_BASED_IN_UK.

UI

  • Update various task list related functions to consume and pass a brokerFullAddress param.
  • Update getBrokerTasks logic.
  • Create a new DRY helper function to generate an "enter broker address manually URL" ,generateEnterBrokerAddressManuallyUrl.
  • Update BROKER_ADDRESSES and BROKER_CONFIRM_ADDRESS GET controllers to consume generateEnterBrokerAddressManuallyUrl.
  • Update broker mapSubmittedData function to to wipe address lookup fields if IS_BASED_IN_UK is true and FULL_ADDRESS is populated.
  • Update flattenApplicationData to only return address lookup fields if FULL_ADDRESS is not populated.
  • Update the summary list's brokerAddressField mapping function to return a FULL_ADDRESS field/row, if populated.

Miscellaneous ➕

  • Fix some typos.
  • Minor documentation improvements.

@ttbarnes ttbarnes merged commit 4dee04f into main-broker-address-lookup Jan 24, 2025
186 of 188 checks passed
@ttbarnes ttbarnes deleted the feat/EMS-4141 branch January 24, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore enhancement New feature or request feature New functionality tech Technical debt/improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants