- Aug 03, 2016
-
-
João Victor Risso authored
Changes: - Add error handling in the database query function. When a database error occurs, it is logged in the server and a plain text response is returned to the user. - Implement the building of queries inside the API, which removes the need to have stored functions/procedures on the database, which is not flexible or efficient to maintain/extend. - Use route chaining to determine which function will build the query that needs to be executed. The last function is the one that actually sends the query to the database and send the response. Future Work: - Instead of returning a plain text response, return a HTTP 501 status, which is currently not possible. When one attempts to send such status the framework throws an error that the headers were already sent for the current request. - Chaining based on the route might not be the best solution here.
-
- Aug 02, 2016
-
-
João Victor Risso authored
-
- Jul 27, 2016
-
-
Vytor Calixto authored
Tests See merge request !6
-
Lucas Gabriel Lima authored
-
Lucas Gabriel Lima authored
-
- Jul 26, 2016
-
-
Lucas Gabriel Lima authored
-
- Jul 25, 2016
-
-
Vytor Calixto authored
-
- Jul 12, 2016
-
-
Vytor Calixto authored
-
Vytor Calixto authored
Implement basic queries for enrollments # Description Implemented enrollments queries per: - Region - State - City The *census_year* parameter is *mandatory* and should be included in all requests. The "/enrollments" route supports the following parameters - aggregate: metric to aggregate, can be {state, region, city}. When no parameter is supplied or the parameter is not supported, the API assumes the whole country. - id: record identifer of the metric to aggregate (e.g. one specific state or region), it only applies when the aggregate parameters is passed and is valid. Again, when no parameter is specified, the API assumes the whole range of values the metric can take (e.g. all states or all regions). - adm_dependency_id: administrative dependency identifier, the possible values are shown in the Table 1. - location_id: location identifier, its possible values are given in Table 2. # Tables *Table 1:* Administrative dependency table. | adm_dependency_id | name | |---------------------------|---------------| | 0 | All records | | 1 | Federal | | 2 | Estadual | | 3 | Municipal | | 4 | Privada | *Table 2:* Location table. | location_id | name | |----------------|---------------| | 0 | All records | | 1 | Urbana | | 2 | Rural | # Response Format The API returns a JSON array with name "result" where every array has following attributes: - name: Name of the metric (e.g. name of a state, city or region) - total: Total number of enrollments for the selected metric and given parameters. # Examples Retrieve the number of enrollments of 2014 for the whole country: > /api/v1/enrollments?census_year=2014 Retrieve the number of enrollments of 2013 for a given region: > /api/v1/enrollments?census_year=2013&aggregate=region&id=1 Retrieve the number of enrollments of 2012 for all rural locations in the state of Paraná: > /api/v1/enrollments?census_year=2012&aggregate=state&id=41&location_id=2 Retrieve the number of enrollments of 2012 for the North region: > /api/v1/enrollments?census_year=2012&aggregate=region&id=1 See merge request !5
-
Vytor Calixto authored
-
Vytor Calixto authored
-
- Jul 11, 2016
-
-
João Victor Risso authored
-
João Victor Risso authored
Signed-off-by:
João Victor Tozatti Risso <jvtr12@c3sl.ufpr.br>
-
João Victor Risso authored
Signed-off-by:
João Victor Tozatti Risso <jvtr12@c3sl.ufpr.br>
-
Luiz Gonçalves authored
-
Luiz Henrique Carrilho Gonçalves authored
Tests See merge request !3
-
Vytor Calixto authored
Fixed XML output Closes #6 See merge request !4
-
Vytor Calixto authored
Closes #6
-
João Victor Risso authored
Signed-off-by:
João Victor Tozatti Risso <jvtr12@c3sl.ufpr.br>
-
João Victor Risso authored
Signed-off-by:
João Victor Tozatti Risso <jvtr12@c3sl.ufpr.br>
-
- Jul 08, 2016
-
-
Vytor Calixto authored
-
Vytor Calixto authored
Conflicts: libs/routes/api.js
-
Vytor Calixto authored
-
João Victor Risso authored
- Rename /matriculas to /enrollments - Add initial support for parameters in the enrollments route
-
Lucas Gabriel Lima authored
-
Lucas Gabriel Lima authored
-
Vytor Calixto authored
Conflicts: package.json
-
Lucas Gabriel Lima authored
-
Vytor Calixto authored
-
Lucas Gabriel Lima authored
-
Lucas Gabriel Lima authored
-
Lucas Gabriel Lima authored
-
Lucas Gabriel Lima authored
-
Vytor Calixto authored
-
Vytor Calixto authored
Add cors Added CORS (Cross-Origin Resource Sharing) to API. This way the API allows different URLs to use it. See merge request !1
-
- Jul 07, 2016
-
-
Vytor Calixto authored
-
- Jul 06, 2016
-
-
Vytor Calixto authored
Related: #3
-
João Victor Risso authored
Signed-off-by:
João Victor Tozatti Risso <jvtr12@c3sl.ufpr.br>
-
- Jul 04, 2016
-
-
João Victor Risso authored
-
- Jul 01, 2016
-
-
João Victor Risso authored
Implement the following aggregations: - per-state - per-region - country In order to use these queries one should use the /api/v1/matriculas route. When the 'agregar' query parameter is set, one could use the values 'estado' and 'regiao' to run the aggregation for state and region, respectively. Otherwise, if no parameters are supplied, it defaults to the whole country aggregation query.
-