DoSomething / gladiator

:guardsman: The DoSomething.org competitions platform.
2 stars 0 forks source link

Add `GET api/v2/contests` endpoint #417

Closed sbsmith86 closed 7 years ago

sbsmith86 commented 7 years ago

What's this PR do?

This adds an endpoint at GET /api/v2/contests that return all contests data we have in gladiator.

The endpoint uses @DFurnes FilterRequests to allow for filtering on id, campaign_id, and campaign_run_id (see documentation for all query parameter options).

I also do some work moving around the api/v1/contests functionality so that we can still support whatever was using it.

Check out the documentation for an example response.

How should this be manually tested?

This looks like a large PR, but it is relatively straightforward. I am mostly just separating things into their own transformers so we can use them to embed resources. I think the easiest thing is to go commit-by-commit to see groups of changes.

Any background context you want to provide?

We are adding this so the data team can use the endpoint to ingest all gladiators data. This endpoint pretty much returns EVERYTHING. Then only thing I left out, I believe, are the default messages since I am returning message configurations per contest anyway.

What are the relevant tickets?

Addresses #415