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

Tag where permit is used #2618

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Tag where permit is used #2618

wants to merge 2 commits into from

Conversation

jonathangoulding
Copy link
Collaborator

@jonathangoulding jonathangoulding commented Aug 20, 2024

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

We want to establish what features in the legacy code depend on the permit.licence table. For example, we know in our own code, we depend on it to identify the ‘points’ for a licence.

The NALD import creates the permit licence table and document header table during the NALD import job.

The issue is that the permit.licence record is just a massive JSONB dump of all the NALD data related to the licence. It looks like the later licence import in water-abstraction-import did a much better job of breaking the same data down into constituent tables.

We’re focusing our efforts on recreating a new licence import ready for ReSP. But until we can confirm what legacy features depend on the old permit.licence table, we can’t decide whether to drop creating permit.licence records or recreate the massive JSONB dump.

@jonathangoulding jonathangoulding self-assigned this Aug 20, 2024
@jonathangoulding jonathangoulding added the do not merge Used for spikes and experiments label Aug 22, 2024
@@ -71,7 +73,7 @@ const handler = async () => {
// For the successful records,
// mark them as processed by updating the datestamp
// in permit.licence.date_licence_version_purpose_conditions_last_copied

// TODO: permit used here
Copy link
Collaborator Author

@jonathangoulding jonathangoulding Aug 22, 2024

Choose a reason for hiding this comment

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

This work has been tagged to show it is used as part of the Digitize journey (Also known as AR and abstraction reform)

@@ -128,6 +130,7 @@ const handler = async () => {
// For the successful records,
// mark them as processed by updating the datestamp
// in permit.licence.date_licence_version_purpose_conditions_last_copied
// TODO: permit used here
Copy link
Collaborator Author

@jonathangoulding jonathangoulding Aug 22, 2024

Choose a reason for hiding this comment

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

This data is pulled from CSV in aws.

We have added seeders to what we have called reference data. This can be reference data.

A discussion need to had if we can store this data in git or needs to handle more securely.

@@ -66,7 +66,7 @@ const getLicence = async (document, includeExpired, companyId) => {
}

throwIfUnauthorised(documentHeader, companyId)

// TODO: permit used here
Copy link
Collaborator Author

@jonathangoulding jonathangoulding Aug 22, 2024

Choose a reason for hiding this comment

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

I can not establish where this is called (if it even is).

It is not in the Licence Summary pages as they use the licence module.

As we have migrated all the licence summary pages (tabs), if this call was used on the summary page it will no longer be needed when we remove the summary code, however nothing leads to believe they call this controller.

@@ -263,6 +263,7 @@ const mapXml = async (xmlStr, user, today) => {
// Stage 1 - get licence numbers and region codes
const permits = getPermitsFromXml(xmlDoc)
const licenceNumbers = getLicenceNumbersFromPermits(permits)
// TODO: permit used here
Copy link
Collaborator Author

@jonathangoulding jonathangoulding Aug 22, 2024

Choose a reason for hiding this comment

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

You can get this direct using the water.licences

As discussed. If the XML mapper is used (which we currently believe no customers are) then this code could be removed or updated.

This data can be retrieved from water.licences

@@ -139,6 +140,7 @@ const getVersions = async () => {
waterService: pkg.version,
idm: await idmConnector.getServiceVersion(),
crm: await crmServiceVersionConnector.getServiceVersion(),
// TODO: permit used here
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

potential dead - mark as dead

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The system repo has it's own implementation for checkign service statues.

This is now obsolete.

@@ -21,7 +21,7 @@ const postPreviewReturnNotification = async (request, h) => {

// Create a new set to remove any duplicate values
const licenceRefs = [...new Set(data.map(item => item.licence_ref))]

// TODO: permit used here
Copy link
Collaborator Author

@jonathangoulding jonathangoulding Aug 22, 2024

Choose a reason for hiding this comment

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

This is located in the Returns notification paper forms functionality.

I have created a paper for notification but i can not see this being called.

I could not trigger postPreviewReturnNotification or postReturnNotification using the UI.

This call can be replaced by extracting the REV_DATE, EXPIRY_DATE and LAPSED_DATE from water.licence

        dateRevoked: calendarToIso(row.licence_data_value.REV_DATE),
        dateExpired: calendarToIso(row.licence_data_value.EXPIRY_DATE),
        dateLapsed: calendarToIso(row.licence_data_value.LAPSED_DATE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Used for spikes and experiments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant