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

Add Mur disposition category filter #5988

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

fec-jli
Copy link
Contributor

@fec-jli fec-jli commented Sep 20, 2024

Summary

Add filter by mur_disposition_category_id in the /legal/search/ endpoint.
Here is the list of Mur dispostion category list

Required reviewers

2 devs

Impacted areas of the application

/legal/search/

Completion criteria

  • Filter by mur_disposition_category_id on MURs work.
  • reload all case documents on dev, stage, prod after deploy.

How to test

1)Checkout branch
2)Setup local ES
3Upload legal doc on local ES.
These commands for reference:
python cli.py create_index case_index
python cli.py delete_index case_index
python cli.py load_adrs
python cli.py load_admin_fines
python cli.py load_current_murs
you can terminate(Ctr+C) in the middle of loading.

4)pytest and flask run

5)Test urls
http://127.0.0.1:5000/v1/legal/search/?type=murs&mur_disposition_category_id=12
http://127.0.0.1:5000/v1/legal/search/?type=murs&mur_disposition_category_id=7

http://127.0.0.1:5000/v1/legal/search/?type=murs&mur_disposition_category_id=12&mur_disposition_category_id=7

on dev:
https://fec-dev-api.app.cloud.gov/v1/legal/search?api_key=DEMO_KEY&type=murs&mur_disposition_category_id=1

multi-filter:
https://fec-dev-api.app.cloud.gov/v1/legal/search?api_key=DEMO_KEY&type=murs&mur_disposition_category_id=1&mur_disposition_category_id=12

@fec-jli fec-jli force-pushed the feature/add_case_disposition_filter branch from 33fce23 to fee2946 Compare September 23, 2024 16:33
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 88.61789% with 14 lines in your changes missing coverage. Please review.

Project coverage is 86.73%. Comparing base (83e299e) to head (fee2946).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
webservices/legal_docs/current_cases.py 93.39% 7 Missing ⚠️
webservices/resources/legal.py 56.25% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5988      +/-   ##
===========================================
+ Coverage    86.70%   86.73%   +0.02%     
===========================================
  Files           82       82              
  Lines         8975     8979       +4     
===========================================
+ Hits          7782     7788       +6     
+ Misses        1193     1191       -2     
Flag Coverage Δ
86.73% <88.61%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@cnlucas cnlucas left a comment

Choose a reason for hiding this comment

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

Great job @fec-jli!

@fec-jli
Copy link
Contributor Author

fec-jli commented Sep 23, 2024

query to get MUR_ADR disposition category list:
with q as (SELECT DISTINCT fecmur.event.event_name AS event_name FROM fecmur.calendar INNER JOIN fecmur.event USING (event_id) INNER JOIN fecmur.entity USING (entity_id) LEFT JOIN (SELECT detail_key AS entity_id, master_key AS settlement_id FROM fecmur.relatedobjects INNER JOIN fecmur.settlement ON fecmur.relatedobjects.master_key = fecmur.settlement.settlement_id WHERE relation_id = 1 ) AS relatedobjects ON relatedobjects.entity_id = fecmur.calendar.entity_id LEFT JOIN fecmur.settlement USING (settlement_id) LEFT JOIN (SELECT * FROM fecmur.violations WHERE stage = 'Closed' ) AS violations ON violations.entity_id = fecmur.calendar.entity_id WHERE event_name NOT IN ('Complaint/Referral', 'Disposition') ORDER BY fecmur.event.event_name ASC ) SELECT row_number() OVER () AS idx,event_name FROM q WHERE event_name NOT IN ('Complaint/Referral', 'Disposition') ORDER BY event_name ASC

mur_disposition_category_list.csv

Copy link
Contributor

@tmpayton tmpayton left a comment

Choose a reason for hiding this comment

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

Amazing job @fec-jli

@tmpayton tmpayton merged commit afa2e70 into develop Sep 24, 2024
3 checks passed
@tmpayton tmpayton deleted the feature/add_case_disposition_filter branch September 24, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Build disposition filter for MURs only
3 participants