Skip to content

Commit

Permalink
Remove the replacement legacy import code (#1585)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4535

By this time last year (December 2023), we completed a workshop with our ReSP colleagues and began working toward a vision that would conclude with NALD being replaced by ReSP. A key part of this vision would be a complete change in how we import our licence abstraction (ABS) data.

The legacy process that examines _all_ licences, processing each one to determine whether it is new or changed, would be replaced by single licence 'events'. ReSP would provide an event bus to which our service would subscribe. As MVP (because details were scant), we would treat any event as a trigger to process a licence and determine whether it is new or changed.

To be as ready as possible, we saw an opportunity to replace the existing legacy import and create the basis for that MVP. We would rebuild what the legacy import does but refactor the process to be licence-specific. For example, the legacy import has a CRM step for all licences, an abstraction step for all, and a returns step for all. We'd refactor that to do the CRM step, the abstraction step, and the returns step for a single licence.

This work was done under [ReSP Import abstraction data prep—water.licence](https://eaflood.atlassian.net/browse/WATER-4535). Once we figured out how to verify that it was importing things correctly, we could test the contacts and abstraction steps. We'd then need to tackle returns information.

Piggybacking on this work was the need to change two parts: tariff billing and return version management. These two features needed to know when a licence 'end dates' were changed to flag it for billing correctly and in case return logs were required to be reissued.

This was no small job, and it got as far as it did thanks to the perseverance of @jonathangoulding . Unfortunately, events overtook this work and a new change in direction has been agreed. Now, WRLS itself will replace NALD. This means licences will be created and directly managed within the service. There will be no need for an import process _at all_.

If it had changed direction once, there was always the chance it would change back! So, we decided to leave the work done within the app. If nothing else, it's a handy resource for figuring out what the legacy import is doing.

However, management of the two-part tariff billing and return version still needs to know if a licence's end dates have changed. So, we've added a new job (see [WATER-4728 New 'import' job to trigger return log and supplementary flag checks](https://eaflood.atlassian.net/browse/WATER-4728)) at `/jobs/import-licences` specifically designed to trigger these two processes.

The problem is that folks sometimes do it in this new job when it comes to managing two-part tariffs and returns. Other times, they update and amend the legacy licence import replacement we built. There is a concern that something will be missed or done incorrectly because the team is confused between the two.

So, leaning into the knowledge that source control means deleted code is never truly lost, this change aims to remove the confusion by deleting the replacement legacy import functionality we added.
  • Loading branch information
Cruikshanks authored Dec 24, 2024
1 parent 5fb2330 commit 3e502c1
Show file tree
Hide file tree
Showing 54 changed files with 16 additions and 4,248 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,7 @@ COOKIE_SECRET=
ENABLE_REISSUING_BILLING_BATCHES=false
ENABLE_REQUIREMENTS_FOR_RETURNS=false
ENABLE_SYSTEM_LICENCE_VIEW=true
ENABLE_IMPORT_LEGACY_LICENCE=true
ENABLE_TWO_PART_TARIFF_SUPPLEMENTARY=false
ENABLE_MONITORING_STATIONS_VIEW=true
ENABLE_LICENCE_PURPOSES_VIEW=true
ENABLE_LICENCE_POINTS_VIEW=true
27 changes: 0 additions & 27 deletions app/controllers/import.controller.js

This file was deleted.

2 changes: 0 additions & 2 deletions app/plugins/router.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const CheckRoutes = require('../routes/check.routes.js')
const DataRoutes = require('../routes/data.routes.js')
const FilterRoutesService = require('../services/plugins/filter-routes.service.js')
const HealthRoutes = require('../routes/health.routes.js')
const ImportRoutes = require('../routes/import.routes.js')
const NotificationsAdHocReturnsRoutes = require('../routes/notifications-ad-hoc-returns.route.js')
const NotificationsSetupRoutes = require('../routes/notifications-setup.routes.js')
const JobRoutes = require('../routes/jobs.routes.js')
Expand Down Expand Up @@ -51,7 +50,6 @@ const routes = [
...ReturnVersionsRoutes,
...ReturnVersionsSetupRoutes,
...DataRoutes,
...ImportRoutes,
...NotificationsSetupRoutes,
...NotificationsAdHocReturnsRoutes
]
Expand Down
22 changes: 0 additions & 22 deletions app/routes/import.routes.js

This file was deleted.

121 changes: 0 additions & 121 deletions app/services/import/legacy/fetch-address.service.js

This file was deleted.

132 changes: 0 additions & 132 deletions app/services/import/legacy/fetch-company-address.service.js

This file was deleted.

Loading

0 comments on commit 3e502c1

Please sign in to comment.