[bgatlas] cell stats
groupsky opened this issue · 0 comments
groupsky commented
- Method:
GET
- Route:
/bgatlas/cell/:utm_code/stats
- Inputs: utm_code
- Requires: authenticated user
- Returns: count of distinct species from monitoring and/or bgatlas2008_species and top 3 users with most distinct species
data: [{ user: {firstName: String, lastName: String}, species: Number}], count: Number
Test cases:
- a cell with no observations and no species in
bgatlas2008_species
results incount: 0, data: []
- a cell with no observation and one species in
bgatlas2008_species
results incount: 1, data: []
- a cell with one observation and no species in
bgatlas2008_species
results incount: 1, data: [{user: ..., species: 1}]
- a cell with two users each having one observation on the same species and no species in
bgatlas2008_species
results incount: 1, data: [{user: ..., species: 1}, {user: ..., species: 1}]
- a cell with one observation and the same species in
bgatlas2008_species
results incount: 1, data: [{user: ..., species: 1}]
- a cell with one observation and the different species in
bgatlas2008_species
results incount: 2, data: [{user: ..., species: 1}]
- a cell with two users each having one observation on different species and a third species in
bgatlas2008_species
results incount: 3, data: [{user: ..., species: 1}, {user: ..., species: 1}]
- a cell with four users each having one observation results in
data.length = 3
- an observation in a different cell results in
count: 0, data: []
- unauthorized request results in 401
- unknown utm_code results in 404