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 national party schedule a/b endpoints #5791

Merged
merged 5 commits into from
May 15, 2024

Conversation

pkfec
Copy link
Contributor

@pkfec pkfec commented Apr 17, 2024

Summary

Create two new national party account endpoints (Transaction level) under swagger docs

  1. /national_party/schedule_a/
  2. /national_party/schedule_b/

Resolves #5786

Related #5811

Required reviewers

1 frontend and 2 or more backend developers

Screenshots

Screen Shot 2024-04-24 at 11 38 58 PM

How to test

On local:

OR

Deploy a test branch to Dev space and test the NPA filters

@pkfec pkfec self-assigned this Apr 17, 2024
@pkfec pkfec marked this pull request as draft April 17, 2024 07:09
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 97.95918% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 86.18%. Comparing base (3e9f5b8) to head (ab254ab).
Report is 8 commits behind head on develop.

Files Patch % Lines
webservices/resources/national_party.py 91.04% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5791      +/-   ##
===========================================
+ Coverage    85.77%   86.18%   +0.41%     
===========================================
  Files           81       83       +2     
  Lines         8624     8918     +294     
===========================================
+ Hits          7397     7686     +289     
- Misses        1227     1232       +5     

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

@pkfec pkfec force-pushed the feature/nation-party-endpoints branch 3 times, most recently from d89d129 to fee4f9a Compare April 18, 2024 16:38
@pkfec pkfec changed the title Add national party schedule_a endpoint Add national party schedule a/b endpoint Apr 22, 2024
@pkfec pkfec changed the title Add national party schedule a/b endpoint Add national party schedule a/b endpoints Apr 22, 2024
@pkfec pkfec force-pushed the feature/nation-party-endpoints branch 3 times, most recently from 3c6f9c0 to a522d31 Compare April 25, 2024 03:32
@pkfec pkfec marked this pull request as ready for review April 25, 2024 03:33
@pkfec pkfec force-pushed the feature/nation-party-endpoints branch from 8d9be99 to 050db6e Compare April 29, 2024 15:26
@pkfec pkfec changed the title Add national party schedule a/b endpoints Add national party schedule a/b endpoints is BLOCKED by https://github.com/fecgov/openFEC/pull/5809 Apr 29, 2024
@pkfec pkfec force-pushed the feature/nation-party-endpoints branch from 050db6e to 399457a Compare April 29, 2024 17:46
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.

Can we remove these null fields. I think ideally they wouldn't be in the MV, but can we at least take them out of the model? Can someone confirm what I'm seeing--that they all are null?
organization_type
organization_type_full
candidate_first_name
candidate_id
candidate_last_name
candidate_middle_name
candidate_name
candidate_office
candidate_office_district
candidate_office_full
candidate_office_state
candidate_office_state_full
conduit_committee_city
conduit_committee_id
conduit_committee_name
conduit_committee_state
conduit_committee_street1
conduit_committee_street2
conduit_committee_zip
candidate_prefix
candidate_suffix

@pkfec
Copy link
Contributor Author

pkfec commented Apr 30, 2024

Can we remove these null fields. I think ideally they wouldn't be in the MV, but can we at least take them out of the model? Can someone confirm what I'm seeing--that they all are null? organization_type organization_type_full candidate_first_name candidate_id candidate_last_name candidate_middle_name candidate_name candidate_office candidate_office_district candidate_office_full candidate_office_state candidate_office_state_full conduit_committee_city conduit_committee_id conduit_committee_name conduit_committee_state conduit_committee_street1 conduit_committee_street2 conduit_committee_zip candidate_prefix candidate_suffix

Sure, I can take a look and confirm if all the fields are null.

@pkfec pkfec changed the title Add national party schedule a/b endpoints is BLOCKED by https://github.com/fecgov/openFEC/pull/5809 Add national party schedule a/b endpoints May 1, 2024
@pkfec pkfec marked this pull request as draft May 1, 2024 16:29
@pkfec pkfec force-pushed the feature/nation-party-endpoints branch from 399457a to 9ed935f Compare May 2, 2024 03:42
@pkfec pkfec marked this pull request as ready for review May 2, 2024 11:18
@pkfec pkfec force-pushed the feature/nation-party-endpoints branch from 9ed935f to fba21ff Compare May 2, 2024 14:37
@pkfec pkfec requested a review from rfultz May 2, 2024 15:20
@pkfec
Copy link
Contributor Author

pkfec commented May 2, 2024

conduit_committee_city
conduit_committee_id
conduit_committee_name
conduit_committee_state
conduit_committee_street1
conduit_committee_street2
conduit_committee_zip

@PaulClark2 suggested removing the organization and conduit* fields since party committees typically lack that data. However, he recommended keeping the candidate information since some party committees do have relevant data for it.
cc @hcaofec

@pkfec pkfec force-pushed the feature/nation-party-endpoints branch from fba21ff to 5b8e1f7 Compare May 3, 2024 00:48
@pkfec
Copy link
Contributor Author

pkfec commented May 3, 2024

conduit_committee_city
conduit_committee_id
conduit_committee_name
conduit_committee_state
conduit_committee_street1
conduit_committee_street2
conduit_committee_zip

@PaulClark2 suggested removing the organization and conduit* fields since party committees typically lack that data. However, he recommended keeping the candidate information since some party committees do have relevant data for it. cc @hcaofec

I removed the organization and conduit* fields from the NPA model file

@cnlucas cnlucas self-requested a review May 3, 2024 13:18
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.

Fabulous job @pkfec! Thank you so much!

Copy link
Contributor

@fec-jli fec-jli left a comment

Choose a reason for hiding this comment

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

It works as expected.
Could we consider creating a separate ticket to add a 'Zipcode' validation function in args.py? This would help eliminate the excessive duplication of Zipcode validation code in many places.

@pkfec
Copy link
Contributor Author

pkfec commented May 7, 2024

It works as expected. Could we consider creating a separate ticket to add a 'Zipcode' validation function in args.py? This would help eliminate the excessive duplication of Zipcode validation code in many places.

Thanks for the feedback @fec-jli. I can make up a ticket to move the Zipcode validation function to webservies.utils.py instead of args.py as most of the validations happens in utils.py

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.

Really awesome job @pkfec!

Copy link
Contributor

@hcaofec hcaofec left a comment

Choose a reason for hiding this comment

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

Great work!

Copy link
Contributor

@johnnyporkchops johnnyporkchops left a comment

Choose a reason for hiding this comment

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

Endpoints look good . Great job Priya!

@pkfec pkfec force-pushed the feature/nation-party-endpoints branch from 5b8e1f7 to 6149d17 Compare May 7, 2024 20:36
@pkfec
Copy link
Contributor Author

pkfec commented May 7, 2024

I added recipient_zip as a filter for sb endpoint.

@JonellaCulmer
Copy link
Contributor

JonellaCulmer commented May 14, 2024

@pkfec Just one thing for the endpoints:

  • Change receipt_type and disbursement_type filter descriptions to say: "National party account receipt types:" or "National party account disbursement types:"

@pkfec pkfec force-pushed the feature/nation-party-endpoints branch from f168327 to 2f762f5 Compare May 14, 2024 21:12
@pkfec pkfec force-pushed the feature/nation-party-endpoints branch from 2f762f5 to ab254ab Compare May 14, 2024 23:02
@pkfec
Copy link
Contributor Author

pkfec commented May 15, 2024

@pkfec Just one thing for the endpoints:

  • Change receipt_type and disbursement_type filter descriptions to say: "National party account receipt types:" or "National party account disbursement types:"

@JonellaCulmer I updated ^^ filter descriptions in docs.py

Copy link
Contributor

@JonellaCulmer JonellaCulmer left a comment

Choose a reason for hiding this comment

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

This looks really great, @pkfec. Thanks for all your hard work on this.

@JonellaCulmer JonellaCulmer merged commit f0dba5a into develop May 15, 2024
3 checks passed
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 national party account endpoints [Transaction level]
7 participants