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

Add company address model and relationships #1140

Merged
merged 10 commits into from
Jun 25, 2024
Merged

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-3981

We recently added a new acceptance test data loader to replace the slow and flaky legacy acceptance test data loader in water-abstraction-service.

However, a couple of our acceptance tests fail when using our new test data. After investigation, it turns out that the legacy charge information setup journey relies on their being a crm_v2.company_addresses record linking a company to its addresses.

It can find the companies linked to our licence. But once you select the company to use it then goes looking for the possible addresses. With the old test data you get to pick from 2 because there are crm_v2.company_addresses. With our new test data you are taken to the enter a postcode screen as a fallback to the legacy code not finding any addresses.

At the moment this is the only reason we've come across that depends on this table. But we need it to make this journey work.

SO, this change adds the model and links it to CompanyModel. We then ensure it is cleaned down in the tear-down and available in our data loader.

https://eaflood.atlassian.net/browse/WATER-3981

We recently [added a new acceptance test data loader](https://eaflood.atlassian.net/browse/WATER-3981) to replace the slow and flaky legacy acceptance test data loader in [water-abstraction-service](https://github.com/DEFRA/water-abstraction-service).

However a couple of our acceptance tests fail when using our new test data. After investigation it turns out that the legacy charge information setup journey relies on their being a `crm_v2.company_addresses` record linking a company to its addresses.

It can find the companies linked to our licence. But once you select the company to use it then goes looking for the possible addresses. With the old test data you get to pick from 2 because there are `crm_v2.company_addresses`. With our new test data you are taken to the enter a postcode screen as a fallback to the legacy code not finding any addresses.

At the moment this is the only reason we've come across that depends on this table. But we need it to make this journey work.

SO, this change adds the model and links it to `CompanyModel`. We then ensure it is cleaned down in the tear-down and available in our data loader.
@Cruikshanks Cruikshanks added the enhancement New feature or request label Jun 25, 2024
@Cruikshanks Cruikshanks self-assigned this Jun 25, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review June 25, 2024 11:08
@Cruikshanks Cruikshanks merged commit 8a0c37d into main Jun 25, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the add-company-address-model branch June 25, 2024 11:09
Cruikshanks added a commit to DEFRA/water-abstraction-acceptance-tests that referenced this pull request Jun 26, 2024
https://eaflood.atlassian.net/browse/WATER-3981

In [Switch to new test data loader for SROC billing](#90) we started the move to a new acceptance test data loader to replace the slow and flaky legacy one. 😍🫶 

We _swear_ all the tests were passing before we merged. But low and behold a number are failing. When we dug in we found its because there are tests referring to the old licence reference. Clearly, we must have imagined the passing tests! 🤦 

But we also found that those that rely on adding a new charge version were also broken because our fixture wasn't creating data that the legacy charge version setup journey requires.

We added the ability to create the data needed in [Add company address model and relationships](DEFRA/water-abstraction-system#1140).

This change updates our SROC billing fixture and all the references to the old licence reference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant