Skip to content

[MDS-6062] Fix NOW transfer#3543

Merged
sggerard merged 4 commits intodevelopfrom
mds-6062-fix-transfer-draft-now
May 22, 2025
Merged

[MDS-6062] Fix NOW transfer#3543
sggerard merged 4 commits intodevelopfrom
mds-6062-fix-transfer-draft-now

Conversation

@sggerard
Copy link
Contributor

Objective

Fix transferring a Notice of Work between mines where a Draft permit has already been created

MDS-6062

  • Updates the Draft permit on transfer, including creating a new xref if needed.
  • Updates the mine_guid of documents
  • Migration to correct any exisiting draft permits with mismatching mine_guids

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_core-api'

Failed conditions
25.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Copy link
Collaborator

@matbusby-fw matbusby-fw left a comment

Choose a reason for hiding this comment

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

Looks awesome! Just a couple of minor things. Moving the sql likely doesn't matter too much, but I think it would be good to show the status name in the user error rather than the code.

@sggerard sggerard merged commit a6d6649 into develop May 22, 2025
12 of 13 checks passed
@sggerard sggerard deleted the mds-6062-fix-transfer-draft-now branch May 22, 2025 21:21
matbusby-fw pushed a commit that referenced this pull request May 26, 2025
* Support transferring draft permits, add migration

* Update migration

* Fix final bugs

* Add test
asinn134 added a commit that referenced this pull request May 29, 2025
* some missing env variables from local setup

* [MDS-6451] Report Condition Migration (#3502)

* create migration

* drop the old column, add the unique constraint

* fix unique constraint

* change name of table, add audit fields

* add deleted_ind to table

* version history

* fix null value insertion into guid column

* get some of the tests working

* update logic

* changes in extraction process for tests

* basic tests working for permit requirements

* make error output stop running into a type error

* remainder of tests

* update error handling a bit

* some missing env variables from local setup

* [MDS-6451] Report Condition Migration (#3502)

* create migration

* drop the old column, add the unique constraint

* fix unique constraint

* change name of table, add audit fields

* add deleted_ind to table

* version history

* fix null value insertion into guid column

* get some of the tests working

* update logic

* changes in extraction process for tests

* basic tests working for permit requirements

* make error output stop running into a type error

* remainder of tests

* update error handling a bit

* [MDS-6474] Report 1-many UI (#3535)

* allow linking and unlinking of multiple conditions to report requirements. Do some cleanup

* form changes

* rest of the UI and also some BE stuff

* test issues, styling issues

* add a little BE test

* fix some logic, update a test

* selector test

* test bad request

* test coverage for get check permit id

* remove stray "s"

* update error message

* change some field labels, error messge

* allow linking and unlinking of multiple conditions to report req

* checking out memory usage

* revert memory monitoring

* change title back too

* [FIX] flagsmith error handling (#3537)

don't crash BE when no app context when flagsmith is down

* [MDS-6497] Fix for mine showing alerts from another mine (#3539)

fix for mine showing alerts from another mine

* [MDS-6491] Add permit_type tag (#3540)

* Add permit_type meta tag

* Update tests

* Add output_dir

* [Snyk] Security upgrade node from 20.18.3-alpine to 20.19.2-alpine (#3541)

fix: services/minespace-web/Dockerfile.ci to reduce vulnerabilities

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* [MDS-6507] Fix for Page not found when clicking view minespace in Core (#3542)

adjusted VIEW_MINESPACE route

* [MDS-6062] Fix NOW transfer (#3543)

* Support transferring draft permits, add migration

* Update migration

* Fix final bugs

* Add test

* some missing env variables from local setup

* Handle duplicate report requirements in permit condition creation

* adding report name when missing during permit extraction

* adding report name when missing during permit extraction

* some missing env variables from local setup

* [MDS-6451] Report Condition Migration (#3502)

* create migration

* drop the old column, add the unique constraint

* fix unique constraint

* change name of table, add audit fields

* add deleted_ind to table

* version history

* fix null value insertion into guid column

* get some of the tests working

* update logic

* changes in extraction process for tests

* basic tests working for permit requirements

* make error output stop running into a type error

* remainder of tests

* update error handling a bit

* [MDS-6474] Report 1-many UI (#3535)

* allow linking and unlinking of multiple conditions to report requirements. Do some cleanup

* form changes

* rest of the UI and also some BE stuff

* test issues, styling issues

* add a little BE test

* fix some logic, update a test

* selector test

* test bad request

* test coverage for get check permit id

* remove stray "s"

* update error message

* change some field labels, error messge

* allow linking and unlinking of multiple conditions to report req

* checking out memory usage

* revert memory monitoring

* change title back too

* restore setenv to match dev

* some missing env variables from local setup

* Handle duplicate report requirements in permit condition creation

* Refactor tests and logic for permit condition reports

Added new test cases and improved existing ones for creating permit condition report requirements. Updated logic to handle session validation more robustly and ensure accurate processing of shared report requirements.

* restore setenv to match dev

* update test

* adding report name when missing during permit extraction

* update test

* adding report name when missing during permit extraction

* to match dev

* remove space changes

* add test

* adding report name when missing during permit extraction

* to match dev

* remove space changes

* add test

* revert snap

---------

Co-authored-by: Tara Epp <102187683+taraepp@users.noreply.github.com>
Co-authored-by: Samuel Gerard <sggerard1997@gmail.com>
Co-authored-by: Simen Fivelstad Smaaberg <66635118+simensma-fresh@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Mat.Busby <mat.busby@ca.ey.com>
taraepp added a commit that referenced this pull request Jun 4, 2025
* some missing env variables from local setup

* [MDS-6451] Report Condition Migration (#3502)

* create migration

* drop the old column, add the unique constraint

* fix unique constraint

* change name of table, add audit fields

* add deleted_ind to table

* version history

* fix null value insertion into guid column

* get some of the tests working

* update logic

* changes in extraction process for tests

* basic tests working for permit requirements

* make error output stop running into a type error

* remainder of tests

* update error handling a bit

* [MDS-6474] Report 1-many UI (#3535)

* allow linking and unlinking of multiple conditions to report requirements. Do some cleanup

* form changes

* rest of the UI and also some BE stuff

* test issues, styling issues

* add a little BE test

* fix some logic, update a test

* selector test

* test bad request

* test coverage for get check permit id

* remove stray "s"

* update error message

* change some field labels, error messge

* allow linking and unlinking of multiple conditions to report req

* checking out memory usage

* revert memory monitoring

* change title back too

* restore setenv to match dev

* [MDS-6450] identify same report (#3547)

* some missing env variables from local setup

* Handle duplicate report requirements in permit condition creation

* Refactor tests and logic for permit condition reports

Added new test cases and improved existing ones for creating permit condition report requirements. Updated logic to handle session validation more robustly and ensure accurate processing of shared report requirements.

* restore setenv to match dev

* update test

* update test

---------

Co-authored-by: Tara Epp <102187683+taraepp@users.noreply.github.com>

* [MDS-6516] Add mandatory report name in extraction (#3551)

* some missing env variables from local setup

* [MDS-6451] Report Condition Migration (#3502)

* create migration

* drop the old column, add the unique constraint

* fix unique constraint

* change name of table, add audit fields

* add deleted_ind to table

* version history

* fix null value insertion into guid column

* get some of the tests working

* update logic

* changes in extraction process for tests

* basic tests working for permit requirements

* make error output stop running into a type error

* remainder of tests

* update error handling a bit

* some missing env variables from local setup

* [MDS-6451] Report Condition Migration (#3502)

* create migration

* drop the old column, add the unique constraint

* fix unique constraint

* change name of table, add audit fields

* add deleted_ind to table

* version history

* fix null value insertion into guid column

* get some of the tests working

* update logic

* changes in extraction process for tests

* basic tests working for permit requirements

* make error output stop running into a type error

* remainder of tests

* update error handling a bit

* [MDS-6474] Report 1-many UI (#3535)

* allow linking and unlinking of multiple conditions to report requirements. Do some cleanup

* form changes

* rest of the UI and also some BE stuff

* test issues, styling issues

* add a little BE test

* fix some logic, update a test

* selector test

* test bad request

* test coverage for get check permit id

* remove stray "s"

* update error message

* change some field labels, error messge

* allow linking and unlinking of multiple conditions to report req

* checking out memory usage

* revert memory monitoring

* change title back too

* [FIX] flagsmith error handling (#3537)

don't crash BE when no app context when flagsmith is down

* [MDS-6497] Fix for mine showing alerts from another mine (#3539)

fix for mine showing alerts from another mine

* [MDS-6491] Add permit_type tag (#3540)

* Add permit_type meta tag

* Update tests

* Add output_dir

* [Snyk] Security upgrade node from 20.18.3-alpine to 20.19.2-alpine (#3541)

fix: services/minespace-web/Dockerfile.ci to reduce vulnerabilities

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* [MDS-6507] Fix for Page not found when clicking view minespace in Core (#3542)

adjusted VIEW_MINESPACE route

* [MDS-6062] Fix NOW transfer (#3543)

* Support transferring draft permits, add migration

* Update migration

* Fix final bugs

* Add test

* some missing env variables from local setup

* Handle duplicate report requirements in permit condition creation

* adding report name when missing during permit extraction

* adding report name when missing during permit extraction

* some missing env variables from local setup

* [MDS-6451] Report Condition Migration (#3502)

* create migration

* drop the old column, add the unique constraint

* fix unique constraint

* change name of table, add audit fields

* add deleted_ind to table

* version history

* fix null value insertion into guid column

* get some of the tests working

* update logic

* changes in extraction process for tests

* basic tests working for permit requirements

* make error output stop running into a type error

* remainder of tests

* update error handling a bit

* [MDS-6474] Report 1-many UI (#3535)

* allow linking and unlinking of multiple conditions to report requirements. Do some cleanup

* form changes

* rest of the UI and also some BE stuff

* test issues, styling issues

* add a little BE test

* fix some logic, update a test

* selector test

* test bad request

* test coverage for get check permit id

* remove stray "s"

* update error message

* change some field labels, error messge

* allow linking and unlinking of multiple conditions to report req

* checking out memory usage

* revert memory monitoring

* change title back too

* restore setenv to match dev

* some missing env variables from local setup

* Handle duplicate report requirements in permit condition creation

* Refactor tests and logic for permit condition reports

Added new test cases and improved existing ones for creating permit condition report requirements. Updated logic to handle session validation more robustly and ensure accurate processing of shared report requirements.

* restore setenv to match dev

* update test

* adding report name when missing during permit extraction

* update test

* adding report name when missing during permit extraction

* to match dev

* remove space changes

* add test

* adding report name when missing during permit extraction

* to match dev

* remove space changes

* add test

* revert snap

---------

Co-authored-by: Tara Epp <102187683+taraepp@users.noreply.github.com>
Co-authored-by: Samuel Gerard <sggerard1997@gmail.com>
Co-authored-by: Simen Fivelstad Smaaberg <66635118+simensma-fresh@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Mat.Busby <mat.busby@ca.ey.com>

* address SonarQube reliability concern

---------

Co-authored-by: Mat.Busby <mat.busby@ca.ey.com>
Co-authored-by: Mat Busby <83598933+matbusby-fw@users.noreply.github.com>
Co-authored-by: asinn134 <127789479+asinn134@users.noreply.github.com>
Co-authored-by: Samuel Gerard <sggerard1997@gmail.com>
Co-authored-by: Simen Fivelstad Smaaberg <66635118+simensma-fresh@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants