bcgov / nr-compliance-enforcement

A scalable solution that manages public complaints as well as investigative case files for multiple Compliance and Enforcement divisions across the natural resource sector.
Apache License 2.0
3 stars 2 forks source link

chore: Fix mapSearch agency check for CEEB users #735

Closed mikevespi closed 3 weeks ago

mikevespi commented 3 weeks ago

Description

Complaints service's mapSearch function uses the local function _getAgencyByUser to determine a users agency. This function identifies a users agency through the office they are assigned to. CEEB users have no office assigned, thus _getAgencyByUser fails. To get around this, mapSearch now uses the hasCEEBRole variable already included to determine if _getAgencyByUser should be called, or "EPO" should be assigned (as is the case for CEEB users). Current implementation of tests do not address the problem, and there was an existing false positive in the tests for the complaints service. This will be addressed separately.

Fixes # (issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist

Further comments


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud