Skip to content

Commit

Permalink
Refactor to use new view based WATER models (#569)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4057

As part of the work we have been doing on two-part tariff, we will create 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 WATER schema views](#551). Then in [Create WATER schema models & helpers](#560) 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.
  • Loading branch information
Cruikshanks authored Dec 15, 2023
1 parent fb7f5ad commit 4d0b401
Show file tree
Hide file tree
Showing 155 changed files with 1,054 additions and 5,418 deletions.
2 changes: 1 addition & 1 deletion app/controllers/billing-accounts.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function changeAddress (request, h) {
const { address, agentCompany, contact } = validatedData.value

const result = await ChangeAddressService.go(
request.params.invoiceAccountId,
request.params.billingAccountId,
address,
agentCompany,
contact
Expand Down
224 changes: 0 additions & 224 deletions app/models/legacy-base.model.js

This file was deleted.

31 changes: 0 additions & 31 deletions app/models/legacy.query-builder.js

This file was deleted.

58 changes: 0 additions & 58 deletions app/models/water/bill-licence.model.js

This file was deleted.

Loading

0 comments on commit 4d0b401

Please sign in to comment.