[caciviclab/disclosure-backend-static] Endpoint for candidate contributions (#20)

0 views
Skip to first unread message

Aaron D Borden

unread,
Sep 17, 2016, 7:29:04 PM9/17/16
to caciviclab/disclosure-backend-static

Not sure where this stacks up in priorities or difficulty. Looking for an endpoint to get the contributions made to a specific candidate. Maybe /candidate/:id/contributions/:type with some kind of limit and offset parameter so we can scroll the dataset. And maybe we can break this down a bit, since it's kind of 3 datasets.

Here's what the frontend mock is asking for:
'sm-mobile-6-candidate-contributions'


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Aaron D Borden

unread,
Sep 17, 2016, 7:36:01 PM9/17/16
to caciviclab/disclosure-backend-static

Thinking about implementation for a static backend, we could hard-code a limit (page size) and then just dump those page-size junks into json files. Then the query parameters just become page number and we fetch the chunk based on that. Directory would look like this, each index.json with up to page-size number of contributors within:

candidate/
└── 1
    └── contributions
        ├── committee
        │   ├── 1
        │   │   └── index.json
        │   ├── 2
        │   │   └── index.json
        │   └── 3
        │       └── index.json
        ├── individual
        │   ├── 1
        │   │   └── index.json
        │   ├── 2
        │   │   └── index.json
        │   └── 3
        │       └── index.json
        └── other
            ├── 1
            │   └── index.json
            ├── 2
            │   └── index.json
            └── 3
                └── index.json

Tom Dooner

unread,
Sep 17, 2016, 11:38:25 PM9/17/16
to caciviclab/disclosure-backend-static

Sorting adds an additional layer of complexity to this which probably breaks your pagination implementation proposal.

I'm thinking that we should just ship all transactions for each type at once instead of attempting pagination/sorting, and let the frontend do all the hard stuff*. After all, right now our entire data set is 1,447 transactions -- not exactly a browser-crashing amount. Sure, it will grow, but we have in previous incarnations shipped quite a lot of JSON succesfully.

* of course this is my backend-biased viewpoint ;)

Aaron D Borden

unread,
Sep 18, 2016, 2:23:11 AM9/18/16
to caciviclab/disclosure-backend-static

👍 I should have looked at the data before saying something :)

Sure, this actually frees us up to do some cool stuff on the frontend.

Aaron D Borden

unread,
Sep 18, 2016, 12:14:02 PM9/18/16
to CA Civic Lab
Hey folks sorry for the github spam, this should be disabled now.


On Sat, 2016-09-17 at 23:23 -0700, Aaron D Borden <notifi...@github.com> wrote:
> :+1: I should have looked at the data before saying something :)
>
> Sure, this actually frees us up to do some cool stuff on the frontend.
>
> --
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly or view it on GitHub:
> https://github.com/caciviclab/disclosure-backend-static/issues/20#issuecomment-247828567
>
> --
> OpenCal Discourse http://104.131.98.144/
> ---
> You received this message because you are subscribed to the Google Groups "CA Civic Lab" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opencal+u...@googlegroups.com.
> To post to this group, send email to ope...@googlegroups.com.
> Visit this group at https://groups.google.com/group/opencal.
> To view this discussion on the web visit https://groups.google.com/d/msgid/opencal/caciviclab/disclosure-backend-static/issues/20/247828567%40github.com.
> For more options, visit https://groups.google.com/d/optout.

--
Aaron D Borden
Human and Hacker
signature.asc
Reply all
Reply to author
Forward
0 new messages