bcgov / NRPTI

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

Publish BCMI records to NRCED #1274

Open sggerard opened 2 months ago

sggerard commented 2 months ago

As an admin, when I manually create and publish an inspection or other record to BCMI, I expect that record to also be published/ publically available to view on NRCED.

Additional Context

Acceptance Criteria

sggerard commented 1 month ago

Inspection records that are showing in BCMI have been manually added, even if there is an existing record from the importer that has been published to NRCED. This causes a duplication of records and means if we publish the BCMI record to NRCED as well we will have duplicate records showing in NRCED.

For example: https://nrced-f00029-prod.apps.silver.devops.gov.bc.ca/records;autofocus=66ed5db7e38b120022fb9447 https://mines.nrs.gov.bc.ca/p/644a489016e8780022b87f32/compliance

These are the same Inspection 232946. There are two master records (66ed5db7e38b120022fb944b and 66f6d7793772c1002288b3da) as well as two BCMI records (66ed5db7e38b120022fb9449, 66f6d7793772c1002288b3d9) but only one NRCED record (66ed5db7e38b120022fb9447). The reason we don't see two records in BCMI is because only one has been added to a collection.

This duplication appears to be caused by the importer not correctly associating the inspection with the mine so it doesn't appear as a record under the mine forcing our admin user to create an entirely new record.

sggerard commented 1 month ago

I have just confirmed with Harpreet that all records posted to BCMI are done manually due to requirements around redaction and approval and the ui limitations (No way to add an existing record to a mine).

This leaves this work sort of blocked, any changes will likely result in a large amount of work to fix duplications. I think the best approach is to improve the UI/processes so that all new records are handled in a way that doesn't result in duplication.

Keegnan commented 1 week ago

Waiting to hear back from SO for next steps.

sggerard commented 1 week ago

Email sent to Colin & Robin after the discussion in our Demo suggesting possible steps forward to best meet the desired outcomes whilst handling all the edge cases.

Evening Colin & Robin,

Thanks for attending the demo this morning and for the discussion around how to handle manual vs imported records moving forwards. Here is a summary of the steps that I believe will best implement the ticket https://github.com/bcgov/NRPTI/issues/1201 and then later https://github.com/bcgov/NRPTI/issues/1125 as well as provide an complete picture of all records to the public on both platforms. Please let me know if you have any thoughts or refinements.

  1. Inspections from NRIS-EMLI & NRIS-EPD importers are linked to a Mine (using the best possible method) so that they appear under a Mines ‘Mine Records’ and update the UI to clearly show which are published to BCMI and/or NRCED. This will allow an administrator to see a complete picture of all records relating to a mine, even duplicates.

  2. Add option in the Mine Records UI to publish action records (i.e not permits) to NRCED with either a tickbox or by linking to the primary edit record screen. This allows existing manually created BCMI records to be easily manually posted to NRCED if needed.

  3. Inspections from NRIS-EMLI & NRIS-EPD after July 01 are automatically published to both BCMI & NRCED. This will lead to duplicates, and we will need to develop a process for manually added inspections created after July 01 with a corresponding automatically imported record to be deleted and instead add the attachments to the automatically imported record instead. At this time, I don’t believe this can be easily coded as a database migration and could likely need manual intervention to resolve the duplicates.

Future work:

  1. Once the NRIS API has been updated: Inspection attachments from NRIS-EMLI after July 01 will be automatically published to both BCMI & NRCED if the publish field is set to ‘Y’.

Outcomes: Mine Inspections (And later attachments) from EPD & EMLI after July 01 are automatically published to both BCMI & NRCED reducing manual workload. All records for a given Mine can be seen by an administrator and duplicate records can be easily identified. Existing manually created BCMI records can be easily manually posted to NRCED if there’s no corresponding imported record. If there is a corresponding imported record, then manual intervention is likely needed. Records can still be manually added and updated. A user can search NRCED by Mine and see a complete picture of compliance/enforcement records.