Closed tloriato closed 5 years ago
By the graph presented, I'm assuming we also need to filter by month/year and then aggregate those invoices counts by day, right? To return a list of [(day, count)].
Yes
GET /v1/cities/1100015/daily-issuing?month=7&year=2019
{
"city": {
"codigoMunicipio": "1100015",
"cnpj": "18511471000120",
"municipio.codigoIbge": "1100015",
"municipio.nome": "Alta Floresta D'Oeste",
"municipio.uf": "RO",
"municipio.nomeRegiao": "Leste Rondoniense",
"municipio.estado.sigla": "RO",
"municipio.estado.nome": "Rondônia",
"municipio.regiao.nomeRegiao": "Leste Rondoniense",
"municipio.regiao.uf": "RO"
},
"dailyIssuing": [
{
"dataIncidencia": "2019-05-21",
"emitedInvoicesCount": 3
},
{
"dataIncidencia": "2019-05-23",
"emitedInvoicesCount": 4
},
{
"dataIncidencia": "2019-05-25",
"emitedInvoicesCount": 5
},
{
"dataIncidencia": "2019-05-26",
"emitedInvoicesCount": 5
},
{
"dataIncidencia": "2019-05-27",
"emitedInvoicesCount": 2
},
{
"dataIncidencia": "2019-05-28",
"emitedInvoicesCount": 4
},
{
"dataIncidencia": "2019-05-29",
"emitedInvoicesCount": 1
},
{
"dataIncidencia": "2019-05-31",
"emitedInvoicesCount": 6
}
]
}
Note that days with zero invoices are no shown in the query. I suggest that this should be treated in the front-end, since seems like an easy fix. In the backend, we are currently just using Database functions and returning the result. Treating this in the backend would add some overhead to the response time.
off-topic: we need to fix that city endpoint and property names after, it's pretty ugly lol
@tloriato can we close this?
Sure, daveboy
Sure, daveboy
Given the city (prefeitura) X, we would like to have a breakdown of those values:
It's the amount of invoices issued in that city, basically a
count from all invoices where competencia = x
.Related to sdec-brasil/old-dashboard#60