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

Refactor to use new view based CRM_V2 models #566

Merged
merged 8 commits into from
Dec 5, 2023

Conversation

Cruikshanks
Copy link
Member

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

As part of the work we have been doing on two-part tariff, we will be creating all our new tables in the default public schema.

We have also decided that when there is a legacy table that we are still going to need we will create a View of it in the public schema. This allows us to correct any issues with naming conventions, strip out unused fields, and join entities currently sat in different schemas. The first example of this approach was done in PR #531 .

We created the new views in Create CRM_V2 schema views. Then in Create CRM_V2 schema models and helpers we added the new models and helpers that use them.

This is the final step in the process, we are refactoring any use of the legacy models to use the new ones and deleting all the legacy-based code.

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

As part of the work we have been doing on two-part tariff, we will be creating all our new tables in the default `public` schema.

We have also decided that when there is a legacy table that we are still going to need we will create a [View](https://www.postgresql.org/docs/current/sql-createview.html) of it in the `public` schema. This allows us to correct any issues with naming conventions, strip out unused fields, and join entities currently sat in different schemas. The first example of this approach was done in PR #531 .

We created the new views in [Create CRM_V2 schema views](#556). Then in [Create CRM_V2 schema models and helpers](#561) we added the new models and helpers that use them.

This is the final step in the process, we are refactoring any use of the legacy models to use the new ones and deleting all the legacy-based code.
@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Dec 4, 2023
@Cruikshanks Cruikshanks self-assigned this Dec 4, 2023
@Cruikshanks Cruikshanks force-pushed the refactor-to-use-new-crm-v2-models branch from 415f3aa to 84ad2da Compare December 5, 2023 09:46
we also deal with a number of uses of the old naming for variables within the code.
@Cruikshanks Cruikshanks force-pushed the refactor-to-use-new-crm-v2-models branch from 84ad2da to a1c8ab0 Compare December 5, 2023 10:12
@Cruikshanks Cruikshanks marked this pull request as ready for review December 5, 2023 10:59
Copy link
Contributor

@Jozzey Jozzey left a comment

Choose a reason for hiding this comment

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

Just the one typo

app/services/billing-accounts/change-address.service.js Outdated Show resolved Hide resolved
test/support/helpers/bill.helper.js Dismissed Show dismissed Hide dismissed
@Cruikshanks Cruikshanks requested a review from Jozzey December 5, 2023 14:45
Copy link
Contributor

@Jozzey Jozzey left a comment

Choose a reason for hiding this comment

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

@Cruikshanks Cruikshanks merged commit 65cb797 into main Dec 5, 2023
7 checks passed
@Cruikshanks Cruikshanks deleted the refactor-to-use-new-crm-v2-models branch December 5, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants