taarifa/TaarifaAPI — pull request #8 by machakux (2014-10-04 09:44:05+00:00)
Title: Adding some aggregation endpoints

I was assuming a `resources` collection might accommodate multiple resource types, then resources can be classified by type through `facility_code`.

Examples:

/api//values/region
/api//count/region
/api//sum/region/population_served

I would prefer to use `endpoint` instead of `facility_code` (i.e something like `/api/waterpoints/values/region` instead of `/api/wp001/values/region`) for the sake of consistency & prettier URLs but I haven't figured how to do that without an extra database query unless facility_code values are equal endpoints. Is there a more convenient way to resolve this or should I just assume there will be one resource type per instance?