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

feat: CE-1045 add action taken filter for ceeb #707

Conversation

mikevespi
Copy link
Contributor

@mikevespi mikevespi commented Oct 16, 2024

Description

Added a filter on Action Taken to the complaints list filters for CEEB users. If the filter is is present the search function will send a request to case management for a list of complaint_identifiers (in CM this is found through case_file -> lead_identifier via the new getLeadsByActionTaken). These are then used to filter the complaints via an AND WHERE...IN condition. If no lead_identifiers are returned, then an array of [-1] is passed in its place, since WHERE...IN() causes an error in postgres with an empty set.

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

Testing included manually testing the filter in both the complaint list, and map view. A Cypress test was added, however at the time of writing this there is no seed data in Case Management, so setup for the test (assigning an action taken to a complaint so that there is something to show up once the filter is applied) takes place in the test itself, which is not ideal.

When manually testing, if no results show after filtering, clear the filter, go into one of the actions and set an action taken, then try again.

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

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:

Added the Action Taken filter to the Complaint list for CEEB users. The
filter also applies to the map view. In both the complaint search and
map search, if and only if the filters contain an Action Taken, a call
to the Case Management service is made requesting the lead identifiers
(which in NATCom are complaint identifiers) of all leads belonging to
a case_file that has had the specified action taken on it. If the list
is not empty, we add an AND clause to the search to filter the results
against the list. If the list is empty then the search should return
no results, however SQL errors if you pass an empty list to an IN.
To avoid this, a list of a single value that is not a valid complaint
identifier is passed in its stead, giving the desired result.
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
24.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@mikevespi mikevespi changed the base branch from main to release/lions-mane-jellyfish October 16, 2024 16:32
@afwilcox afwilcox added the case_management_1 https://dc0a4a-compenf-dev-1-backend.apps.emerald.devops.gov.bc.ca/graphql label Oct 16, 2024
@mikevespi mikevespi closed this Oct 16, 2024
@mikevespi mikevespi deleted the feat/CE-1045-add-action-taken-filter-for-CEEB branch October 16, 2024 16:44
@mikevespi mikevespi restored the feat/CE-1045-add-action-taken-filter-for-CEEB branch October 16, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
case_management_1 https://dc0a4a-compenf-dev-1-backend.apps.emerald.devops.gov.bc.ca/graphql
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants