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 description to contributor_aggregate_ytd #6105

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion webservices/common/models/large_aggregates.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class EntityReceiptDisbursementTotals(db.Model):
cycle = db.Column(db.Integer, doc=docs.RECORD_CYCLE)
month = db.Column(db.Integer, doc="Numeric representation of year")
year = db.Column(db.Integer, doc="Numeric representation of month")
end_date = db.Column(db.Date, doc="Date representation of the month and year")
end_date = db.Column(db.Date)
cumulative_candidate_receipts = db.Column(
db.Float,
doc="Cumulative candidate receipts in a two year period, adjusted to avoid double counting.",
Expand Down
8 changes: 8 additions & 0 deletions webservices/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,10 @@
MAX_UPDATE_DATE = '''
The maximum date this record was last updated.(MM/DD/YYYY or YYYY-MM-DD)
'''

CANDIDATE_PCC_ID = 'The candidate\'s primary campaign committee ID'

CANDIDATE_PCC_NAME = 'The candidate\'s primary campaign committee name'
# ======== election end ===========


Expand Down Expand Up @@ -1270,6 +1274,8 @@
Date the event ends(MM/DD/YYYY or YYYY-MM-DD)
'''

END_DATE_ENTITY_CHART = 'The cumulative total for this month.'

CALENDAR_EXPORT = '''
Returns CSV or ICS for downloading directly into calendar applications like Google, Outlook or other applications.

Expand Down Expand Up @@ -1542,6 +1548,8 @@
CONTRIBUTOR_EMPLOYER = 'Employer of contributor, filers need to make an effort to gather this information'
CONTRIBUTOR_OCCUPATION = 'Occupation of contributor, filers need to make an effort to gather this information'
CONTRIBUTOR_ZIP = 'Zip code of contributor'
CONTRIBUTOR_AGGREGATE_YTD = 'Total amount received from this source for the year to date. \
Starting 2000, it is aggregated on an election-cycle basis in F3 and F3P, and calendar year in F3X.'
IS_INDIVIDUAL = 'Restrict to non-earmarked individual contributions where memo code is true. \
Filtering individuals is useful to make sure contributions are not double reported and in creating \
breakdowns of the amount of money coming from individuals.'
Expand Down
10 changes: 5 additions & 5 deletions webservices/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from marshmallow_sqlalchemy import SQLAlchemySchema, SQLAlchemyAutoSchema
from marshmallow_pagination import schemas as paging_schemas

from webservices import utils, decoders
from webservices import utils, decoders, docs
from webservices.spec import spec
from webservices.common import models
from webservices import __API_VERSION__
Expand Down Expand Up @@ -999,7 +999,7 @@ class CandidateHistoryTotalSchema(schemas['CandidateHistorySchema'],
'committee': ma.fields.Nested(schemas['CommitteeHistorySchema']),
'contributor': ma.fields.Nested(schemas['CommitteeHistorySchema']),
'contribution_receipt_amount': ma.fields.Float(),
'contributor_aggregate_ytd': ma.fields.Float(),
'contributor_aggregate_ytd': ma.fields.Float(description=docs.CONTRIBUTOR_AGGREGATE_YTD),
'image_number': ma.fields.Str(),
'original_sub_id': ma.fields.Str(),
'sub_id': ma.fields.Str(),
Expand Down Expand Up @@ -1610,8 +1610,8 @@ class ElectionSchema(ma.Schema):
incumbent_challenge_full = ma.fields.Str()
party_full = ma.fields.Str()
committee_ids = ma.fields.List(ma.fields.Str)
candidate_pcc_id = ma.fields.Str(doc="The candidate's primary campaign committee ID")
candidate_pcc_name = ma.fields.Str(doc="The candidate's primary campaign committee name")
candidate_pcc_id = ma.fields.Str(description=docs.CANDIDATE_PCC_ID)
candidate_pcc_name = ma.fields.Str(description=docs.CANDIDATE_PCC_NAME)
total_receipts = ma.fields.Float()
total_disbursements = ma.fields.Float()
cash_on_hand_end_period = ma.fields.Float()
Expand Down Expand Up @@ -1675,7 +1675,7 @@ class TotalsCommitteeSchema(schemas['CommitteeHistorySchema']):
EntityReceiptDisbursementTotalsSchema = make_schema(
models.EntityReceiptDisbursementTotals,
options={'exclude': ('idx', 'month', 'year')},
fields={'end_date': ma.fields.Date(doc='The cumulative total for this month.')},
fields={'end_date': ma.fields.Date(description=docs.END_DATE_ENTITY_CHART)}
)
EntityReceiptDisbursementTotalsPageSchema = make_page_schema(EntityReceiptDisbursementTotalsSchema)
register_schema(EntityReceiptDisbursementTotalsSchema)
Expand Down