Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,9 @@ const docTemplate = `{
"id_orgao": {
"type": "string"
},
"inconsistente": {
"type": "boolean"
},
"indice_transparencia": {
"$ref": "#/definitions/papi.score"
},
Expand Down Expand Up @@ -1531,6 +1534,9 @@ const docTemplate = `{
"descontos_por_mes": {
"type": "number"
},
"inconsistente": {
"type": "boolean"
},
"meses_com_dados": {
"type": "integer"
},
Expand Down Expand Up @@ -1884,6 +1890,9 @@ const docTemplate = `{
"error": {
"$ref": "#/definitions/uiapi.procError"
},
"inconsistente": {
"type": "boolean"
},
"mes": {
"type": "integer"
},
Expand Down
9 changes: 9 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,9 @@
"id_orgao": {
"type": "string"
},
"inconsistente": {
"type": "boolean"
},
"indice_transparencia": {
"$ref": "#/definitions/papi.score"
},
Expand Down Expand Up @@ -1522,6 +1525,9 @@
"descontos_por_mes": {
"type": "number"
},
"inconsistente": {
"type": "boolean"
},
"meses_com_dados": {
"type": "integer"
},
Expand Down Expand Up @@ -1875,6 +1881,9 @@
"error": {
"$ref": "#/definitions/uiapi.procError"
},
"inconsistente": {
"type": "boolean"
},
"mes": {
"type": "integer"
},
Expand Down
6 changes: 6 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ definitions:
$ref: '#/definitions/papi.miError'
id_orgao:
type: string
inconsistente:
type: boolean
indice_transparencia:
$ref: '#/definitions/papi.score'
mes:
Expand Down Expand Up @@ -348,6 +350,8 @@ definitions:
type: number
descontos_por_mes:
type: number
inconsistente:
type: boolean
meses_com_dados:
type: integer
num_membros:
Expand Down Expand Up @@ -580,6 +584,8 @@ definitions:
type: number
error:
$ref: '#/definitions/uiapi.procError'
inconsistente:
type: boolean
mes:
type: integer
outras_remuneracoes:
Expand Down
1 change: 1 addition & 0 deletions papi/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ func (h handler) V2GetMonthlyInfo(c echo.Context) error {
ParserVersion: monthlyInfo.ParserVersion,
},
ManualCollection: monthlyInfo.ManualCollection,
Inconsistent: monthlyInfo.Inconsistent,
}
//O status 4 informa que os dados estão indisponíveis. Ao removê-los dos resultados da API, garantimos que eles sejam exibidos como se não houvesse dados.
} else if monthlyInfo.ProcInfo.Status != 4 {
Expand Down
1 change: 1 addition & 0 deletions papi/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type summaryzedMI struct {
Collect *collect `json:"dados_coleta,omitempty"`
ManualCollection bool `json:"coleta_manual"`
Error *miError `json:"error,omitempty"`
Inconsistent bool `json:"inconsistente"`
}

type agency struct {
Expand Down
1 change: 1 addition & 0 deletions uiapi/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ func (h handler) GetAnnualSummary(c echo.Context) error {
Size: s.Package.Size,
},
ItemSummary: itemSummary(s.ItemSummary),
Inconsistent: s.Inconsistent,
})
}
var collect []collecting
Expand Down
2 changes: 2 additions & 0 deletions uiapi/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ type v2MonthTotals struct {
RemunerationsPerCapita float64 `json:"remuneracoes_por_membro"`
CrawlingTimestamp timestamp `json:"timestamp"`
ItemSummary itemSummary `json:"resumo_rubricas"`
Inconsistent bool `json:"inconsistente"`
}

type timestamp struct {
Expand Down Expand Up @@ -271,6 +272,7 @@ type annualSummaryData struct {
NumMonthsWithData int `json:"meses_com_dados"`
Package *backup `json:"package,omitempty"`
ItemSummary itemSummary `json:"resumo_rubricas"`
Inconsistent bool `json:"inconsistente"`
}

// DEPRECATED: The ItemSummary struct is deprecated
Expand Down
7 changes: 5 additions & 2 deletions uiapi/uiapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,8 @@ func (g getTotalsOfAgencyYear) testWhenDataExists(t *testing.T) {
"licenca_compensatoria": 120,
"auxilio_saude": 300,
"outras": 200
}
},
"inconsistente": false
}
],
"package": {
Expand Down Expand Up @@ -1387,6 +1388,7 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) {
"auxilio_saude": 300,
"outras": 200,
},
Inconsistent: true,
},
}
dbMock.EXPECT().Connect().Return(nil).Times(1)
Expand Down Expand Up @@ -1456,7 +1458,8 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) {
"licenca_compensatoria": 120,
"auxilio_saude": 300,
"outras": 200
}
},
"inconsistente": true
}
]
}
Expand Down