diff --git a/docs/docs.go b/docs/docs.go index aafa36f..c5c7825 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1407,6 +1407,9 @@ const docTemplate = `{ "id_orgao": { "type": "string" }, + "inconsistente": { + "type": "boolean" + }, "indice_transparencia": { "$ref": "#/definitions/papi.score" }, @@ -1531,6 +1534,9 @@ const docTemplate = `{ "descontos_por_mes": { "type": "number" }, + "inconsistente": { + "type": "boolean" + }, "meses_com_dados": { "type": "integer" }, @@ -1884,6 +1890,9 @@ const docTemplate = `{ "error": { "$ref": "#/definitions/uiapi.procError" }, + "inconsistente": { + "type": "boolean" + }, "mes": { "type": "integer" }, diff --git a/docs/swagger.json b/docs/swagger.json index cb28d78..7d11e09 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1398,6 +1398,9 @@ "id_orgao": { "type": "string" }, + "inconsistente": { + "type": "boolean" + }, "indice_transparencia": { "$ref": "#/definitions/papi.score" }, @@ -1522,6 +1525,9 @@ "descontos_por_mes": { "type": "number" }, + "inconsistente": { + "type": "boolean" + }, "meses_com_dados": { "type": "integer" }, @@ -1875,6 +1881,9 @@ "error": { "$ref": "#/definitions/uiapi.procError" }, + "inconsistente": { + "type": "boolean" + }, "mes": { "type": "integer" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index dc76ee6..5edc3f5 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -262,6 +262,8 @@ definitions: $ref: '#/definitions/papi.miError' id_orgao: type: string + inconsistente: + type: boolean indice_transparencia: $ref: '#/definitions/papi.score' mes: @@ -348,6 +350,8 @@ definitions: type: number descontos_por_mes: type: number + inconsistente: + type: boolean meses_com_dados: type: integer num_membros: @@ -580,6 +584,8 @@ definitions: type: number error: $ref: '#/definitions/uiapi.procError' + inconsistente: + type: boolean mes: type: integer outras_remuneracoes: diff --git a/papi/handlers.go b/papi/handlers.go index 8869bf1..bee65b2 100644 --- a/papi/handlers.go +++ b/papi/handlers.go @@ -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 { diff --git a/papi/models.go b/papi/models.go index 8d8f597..a5028fc 100644 --- a/papi/models.go +++ b/papi/models.go @@ -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 { diff --git a/uiapi/handlers.go b/uiapi/handlers.go index ac0435d..064ea2b 100644 --- a/uiapi/handlers.go +++ b/uiapi/handlers.go @@ -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 diff --git a/uiapi/models.go b/uiapi/models.go index 4dcb8e0..251a737 100644 --- a/uiapi/models.go +++ b/uiapi/models.go @@ -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 { @@ -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 diff --git a/uiapi/uiapi_test.go b/uiapi/uiapi_test.go index 698983b..c912341 100644 --- a/uiapi/uiapi_test.go +++ b/uiapi/uiapi_test.go @@ -1213,7 +1213,8 @@ func (g getTotalsOfAgencyYear) testWhenDataExists(t *testing.T) { "licenca_compensatoria": 120, "auxilio_saude": 300, "outras": 200 - } + }, + "inconsistente": false } ], "package": { @@ -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) @@ -1456,7 +1458,8 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) { "licenca_compensatoria": 120, "auxilio_saude": 300, "outras": 200 - } + }, + "inconsistente": true } ] }