bcgov / NRPTI

Natural Resources Public Transparency Initiative
Apache License 2.0
5 stars 15 forks source link

Amalgamated Mines Act Permits not showing in BCMI #1233

Closed Rebecca-MDS closed 4 weeks ago

Rebecca-MDS commented 1 month ago

Describe the Bug BCMI is used to post permits and permit amendments relating to Mines Act authorizations for published mines. It has been identified that permits that are tagged as "amalgamated" are not showing in BCMI despite them being active Mines Act permits.

Expected Behaviour Amalgamated permits should show in the authorizations view of individual mines where an amalgamated permit has been issued and loaded into Core.

Actual Behaviour Amalgamated permits for Mines Act authorizations are not showing in BCMI under Mines Act Authorizations for individual mines even though they are loaded into Core.

Steps To Reproduce Steps to reproduce the behaviour:

Go to Core and search a major mine that has an amalgamated permit (e.g. Silvertip Mine, 0100525) Click on Permits & Approvals > Permits > Mines Act Permit tab Expand a permit under Permit # (e.g. M-242) > Type = Amalgamated Permit Go to BC Mine Information website Click Menu > Find Mines by List > Search mine (e.g. Silvertip Mine) Click on Authorizations > Scroll to Mines Act Additional examples (Mine name, mine number): Blackwater Gold - 1300281 Fording River Operations - 1200004 Red Chris Mine - 0101102

Link to Core test (Silvertip mine): https://mds-test.apps.silver.devops.gov.bc.ca/mine-dashboard/a86cee31-c753-406b-8145-a0c9d3d4d6d5/permits-and-approvals/permits

Link to BCMI authorizations page (Silvertip mine): https://mines.nrs.gov.bc.ca/p/5fa1e42f4635c865df00d64c/authorizations

Additional Context This should be BCMI https://github.com/bcgov/mem-mmti-public (Unsure if we have access)

sggerard commented 1 month ago

Essentially the underlying issue is that NRPTI does not handling multiple permits per mine and elects to take the most recent permit as its permit number.

BCMI is displaying Amalgamated permits and amendments from other permits (M-242) under the name of the wrong permit (MX-1-520) due to this.

There isn't an option to select a type of "Amalgamated Permit" in nrpti so assuming they have been manually entered as permit ammendments.

Image

acatchpole commented 1 month ago

A partial ER diagram showing the relationship between the records involved in populating a Mine Information page in BCMI:

Image

sggerard commented 1 month ago

It doesn't appear that correct permitNumber is stored on the Permit. So short of a major refactor supporting multiple permit codes and displaying the correct code might not be possible.

The real issue of the ticket is that the permits are not showing as 'Amalgamated' and instead are showing as 'Permit Amended'. NRPTI is currently hard coded to only support two types: Permit (OGP) and Amended Permit (AMD). Need to add support for Amalgamated Permit (ALG)

sggerard commented 1 month ago

MDS has introduced MX (Exploration) permit records into core on top of the existing M records (Mining Operations). Previously NRIPTI only had to deal with M records which is why it doesn't have support for multiple permits. However it now needs to support both. I will create a separate job to add support for multiple permits.

Amalgamated permits are a somewhat new type of permit which NRPTI doesn't support and we will add support for. As opposed to making an amendment to an original permit, an amalgamation includes all the information in one permit. This is favourable to hundreds of contradicting amendments. An amalgamation still has a reference back to the original permit the same as an amendment. Note though that an amendment cannot be made to an amalgamation so after an amalgamation has been issued then subsequent changes will also be amalgamations.

acatchpole commented 4 weeks ago

related PR merged in. deployed to test