opencivicdata / docs.opencivicdata.org

Open Civic Data project documentation
https://open-civic-data.readthedocs.io
44 stars 33 forks source link

Handling unitemized totals and other summary amounts #99

Open gordonje opened 6 years ago

gordonje commented 6 years ago

Something @palewire and I were just discussing. This is something we touched on in the previous conversation, but I don't think we fully resolved.

In CA, filers don't have to itemize contributions under $100. Instead, they can report a total for all unitemized contributions. It isn't clear where this would be recorded in our current schema, and it's pretty essential in order to figuring out the total amount raised.

We think we need a place to store this and other total or summary amounts. What we have in mind is an optional, repeating .totals or .summaries field on Filing that would have the following properties:

Would be interested to hear from others if this would adequately cover other kinds of filings in other jurisdiction. Maybe in some cases we might also need to link the totals to specific elections?

aepton commented 6 years ago

That seems great for now. I'll add it to my list of updates.

jsfenfen commented 6 years ago

I think a number of states allow wonderfully nebulous things like 'cash balance adjustment' or some sorta periodic adjustment. This is important in "continuous filing" states, like Oregon (real live Orestar manual image below, p. 31, 'transaction subtype' !), where there are no periodic reports filed with summary figures, so the amounts are calculable only on a rolling basis (and so some minor adjustment is sometimes allowed).

image

Just plain not having a filing object associated with transactions is a bigger challenge. I assume one could just generate a synthetic filing object (I guess that would be listed in the filing authority section?). Not sure?

gordonje commented 6 years ago

@aepton's endorsement is enough for me to go ahead making this change in python-opencivicdata.

@jsfenfen's example suggests we might want to call this repeating field something other than .totals if it's going to used for amounts labeled "cash balance adjustment". Is .summary_amounts better? Or does anyone have any other suggestions?

palewire commented 6 years ago

@jsfenfen Could the Oregon problem be solved by the future addition of a "subtransaction" model that handles sub expenditures and things like this cash balance adjustment?

gordonje commented 6 years ago

Now that I think more about it...this new repeating .summary_amounts field prob belongs on FilingAction, not Filing. This is consistent with the way transactions are linked to the filing on which they are reported and allows for a filing to have multiple versions of the same summary amount, in the case that these change when filings are amended.

aepton commented 6 years ago

Yeah, that makes a lot of sense. I was initially hostile to putting summary amounts on the Filing, but you're right that the totals will often change and FilingAction seems like a good place to put them.

aepton commented 6 years ago

Fixed in https://github.com/opencivicdata/docs.opencivicdata.org/pull/104