Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retornando licença-prêmio #573

Merged
merged 4 commits into from
Jan 23, 2024
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
6 changes: 6 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,9 @@ const docTemplate = `{
"auxilio_alimentacao": {
"type": "number"
},
"licenca_premio": {
"type": "number"
},
"outras": {
"description": "valor agregado de outras rubricas não identificadas",
"type": "number"
Expand Down Expand Up @@ -1385,6 +1388,9 @@ const docTemplate = `{
"auxilio_alimentacao": {
"type": "number"
},
"licenca_premio": {
"type": "number"
},
"outras": {
"description": "valor agregado de outras rubricas não identificadas",
"type": "number"
Expand Down
6 changes: 6 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,9 @@
"auxilio_alimentacao": {
"type": "number"
},
"licenca_premio": {
"type": "number"
},
"outras": {
"description": "valor agregado de outras rubricas não identificadas",
"type": "number"
Expand Down Expand Up @@ -1376,6 +1379,9 @@
"auxilio_alimentacao": {
"type": "number"
},
"licenca_premio": {
"type": "number"
},
"outras": {
"description": "valor agregado de outras rubricas não identificadas",
"type": "number"
Expand Down
4 changes: 4 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ definitions:
properties:
auxilio_alimentacao:
type: number
licenca_premio:
type: number
outras:
description: valor agregado de outras rubricas não identificadas
type: number
Expand Down Expand Up @@ -414,6 +416,8 @@ definitions:
properties:
auxilio_alimentacao:
type: number
licenca_premio:
type: number
outras:
description: valor agregado de outras rubricas não identificadas
type: number
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/dadosjusbr/proto v0.0.0-20221212025627-91c60aa3cd12
github.com/dadosjusbr/storage v0.0.0-20240109194919-e8fa5bdec162
github.com/dadosjusbr/storage v0.0.0-20240122222419-3472161adddb
github.com/gocarina/gocsv v0.0.0-20220712153207-8b2118da4570
github.com/golang/mock v1.6.0
github.com/joho/godotenv v1.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ github.com/dadosjusbr/storage v0.0.0-20231106132314-7063d34ebc2d h1:vU6hL1gxD9fv
github.com/dadosjusbr/storage v0.0.0-20231106132314-7063d34ebc2d/go.mod h1:JTg/Wu2+wn9SV1J19dDeEronive9J6QelMA7K6vLO8I=
github.com/dadosjusbr/storage v0.0.0-20240109194919-e8fa5bdec162 h1:adRnuhh3Lvk4YClkZl3KRJYln3XmFr+ElGBArQt86LI=
github.com/dadosjusbr/storage v0.0.0-20240109194919-e8fa5bdec162/go.mod h1:PszGy6CDoG3kNLjIsCmwD3MAWED7xL7U/OWj7ajsiHc=
github.com/dadosjusbr/storage v0.0.0-20240122222419-3472161adddb h1:yCHr4P7e8kBCd7vEuqoaW7r737ukj6UGFXtwgERzNmg=
github.com/dadosjusbr/storage v0.0.0-20240122222419-3472161adddb/go.mod h1:PszGy6CDoG3kNLjIsCmwD3MAWED7xL7U/OWj7ajsiHc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
5 changes: 4 additions & 1 deletion papi/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ func (h handler) V2GetMonthlyInfo(c echo.Context) error {
},
ItemSummary: itemSummary{
FoodAllowance: monthlyInfo.Summary.ItemSummary.FoodAllowance,
BonusLicense: monthlyInfo.Summary.ItemSummary.BonusLicense,
Others: monthlyInfo.Summary.ItemSummary.Others,
},
},
Expand Down Expand Up @@ -458,6 +459,7 @@ func (h handler) GetMonthlyInfosByYear(c echo.Context) error {
},
ItemSummary: itemSummary{
FoodAllowance: mi.Summary.ItemSummary.FoodAllowance,
BonusLicense: mi.Summary.ItemSummary.BonusLicense,
Others: mi.Summary.ItemSummary.Others,
},
},
Expand Down Expand Up @@ -672,7 +674,7 @@ func (h handler) V2GetAggregateIndexesWithParams(c echo.Context) error {
// @Produce json
// @Success 200 {object} []aggregateIndexesByGroup "Requisição bem sucedida."
// @Failure 500 {string} string "Erro interno do servidor."
// @Router /v2/indice [get]
// @Router /v2/indice [get]
func (h handler) V2GetAggregateIndexes(c echo.Context) error {
agregado := c.QueryParam("agregado")
detalhe := c.QueryParam("detalhe")
Expand Down Expand Up @@ -837,6 +839,7 @@ func (h handler) V2GetAllAgencyInformation(c echo.Context) error {
},
ItemSummary: itemSummary{
FoodAllowance: c.Summary.ItemSummary.FoodAllowance,
BonusLicense: c.Summary.ItemSummary.BonusLicense,
Others: c.Summary.ItemSummary.Others,
},
},
Expand Down
1 change: 1 addition & 0 deletions papi/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type summary struct {

type itemSummary struct {
FoodAllowance float64 `json:"auxilio_alimentacao,omitempty"`
BonusLicense float64 `json:"licenca_premio,omitempty"`
Others float64 `json:"outras,omitempty"` // valor agregado de outras rubricas não identificadas
}

Expand Down
4 changes: 4 additions & 0 deletions uiapi/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (h handler) V2GetSummaryOfAgency(c echo.Context) error {
HasPrevious: time.Date(year, time.Month(month), 1, 0, 0, 0, 0, time.UTC).In(h.loc).After(time.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC).In(h.loc)),
ItemSummary: itemSummary{
FoodAllowance: agencyMonthlyInfo.Summary.ItemSummary.FoodAllowance,
BonusLicense: agencyMonthlyInfo.Summary.ItemSummary.BonusLicense,
Others: agencyMonthlyInfo.Summary.ItemSummary.Others,
},
}
Expand Down Expand Up @@ -340,6 +341,7 @@ func (h handler) V2GetTotalsOfAgencyYear(c echo.Context) error {
MemberCount: agencyMonthlyInfo.Summary.Count,
ItemSummary: itemSummary{
FoodAllowance: agencyMonthlyInfo.Summary.ItemSummary.FoodAllowance,
BonusLicense: agencyMonthlyInfo.Summary.ItemSummary.BonusLicense,
Others: agencyMonthlyInfo.Summary.ItemSummary.Others,
},
}
Expand Down Expand Up @@ -596,6 +598,7 @@ func (h handler) V2GetGeneralRemunerationFromYear(c echo.Context) error {
Remunerations: d.Remunerations,
ItemSummary: itemSummary{
FoodAllowance: d.ItemSummary.FoodAllowance,
BonusLicense: d.ItemSummary.BonusLicense,
Others: d.ItemSummary.Others,
},
})
Expand Down Expand Up @@ -811,6 +814,7 @@ func (h handler) GetAnnualSummary(c echo.Context) error {
discountsRemPerCapita := s.Discounts / float64(s.TotalCount)
itemSummary := itemSummary{
FoodAllowance: s.ItemSummary.FoodAllowance,
BonusLicense: s.ItemSummary.BonusLicense,
Others: s.ItemSummary.Others,
}
annualData = append(annualData, annualSummaryData{
Expand Down
1 change: 1 addition & 0 deletions uiapi/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ type annualSummaryData struct {

type itemSummary struct {
FoodAllowance float64 `json:"auxilio_alimentacao,omitempty"`
BonusLicense float64 `json:"licenca_premio,omitempty"`
Others float64 `json:"outras,omitempty"` // valor agregado de outras rubricas não identificadas
}

Expand Down
4 changes: 4 additions & 0 deletions uiapi/uiapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
Remunerations: 10000,
ItemSummary: models.ItemSummary{
FoodAllowance: 100,
BonusLicense: 150,
Others: 200,
},
},
Expand Down Expand Up @@ -1001,6 +1002,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
"remuneracoes": 10000,
"resumo_rubricas": {
"auxilio_alimentacao": 100,
"licenca_premio": 150,
"outras": 200
}
},
Expand Down Expand Up @@ -1313,6 +1315,7 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) {
},
ItemSummary: models.ItemSummary{
FoodAllowance: 100,
BonusLicense: 150,
Others: 200,
},
},
Expand Down Expand Up @@ -1377,6 +1380,7 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) {
},
"resumo_rubricas": {
"auxilio_alimentacao": 100,
"licenca_premio": 150,
"outras": 200
}
}
Expand Down
Loading