Skip to content

Commit

Permalink
adicionando auxílio-saúde
Browse files Browse the repository at this point in the history
  • Loading branch information
joellensilva committed Mar 19, 2024
1 parent 57d3157 commit 00d62c8
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 2 deletions.
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"
},
"auxilio_saude": {
"type": "number"
},
"gratificacao_natalina": {
"type": "number"
},
Expand Down Expand Up @@ -1397,6 +1400,9 @@ const docTemplate = `{
"auxilio_alimentacao": {
"type": "number"
},
"auxilio_saude": {
"type": "number"
},
"gratificacao_natalina": {
"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"
},
"auxilio_saude": {
"type": "number"
},
"gratificacao_natalina": {
"type": "number"
},
Expand Down Expand Up @@ -1388,6 +1391,9 @@
"auxilio_alimentacao": {
"type": "number"
},
"auxilio_saude": {
"type": "number"
},
"gratificacao_natalina": {
"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
auxilio_saude:
type: number
gratificacao_natalina:
type: number
indenizacao_de_ferias:
Expand Down Expand Up @@ -422,6 +424,8 @@ definitions:
properties:
auxilio_alimentacao:
type: number
auxilio_saude:
type: number
gratificacao_natalina:
type: number
indenizacao_de_ferias:
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-20240307002251-d7ccaca9cd29
github.com/dadosjusbr/storage v0.0.0-20240315221019-5da10c81ab80
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 @@ -48,6 +48,8 @@ github.com/dadosjusbr/storage v0.0.0-20240215133808-01101e0b3766 h1:u5Qem0JR196g
github.com/dadosjusbr/storage v0.0.0-20240215133808-01101e0b3766/go.mod h1:PszGy6CDoG3kNLjIsCmwD3MAWED7xL7U/OWj7ajsiHc=
github.com/dadosjusbr/storage v0.0.0-20240307002251-d7ccaca9cd29 h1:PoZPA1Nt+HDFNbR2cAciWffdcoK+Bxc5Emh1kkOJNXk=
github.com/dadosjusbr/storage v0.0.0-20240307002251-d7ccaca9cd29/go.mod h1:PszGy6CDoG3kNLjIsCmwD3MAWED7xL7U/OWj7ajsiHc=
github.com/dadosjusbr/storage v0.0.0-20240315221019-5da10c81ab80 h1:mo6k/MAl6aF662JFUYHxqCNvRkX8OXZN0DmQKJe55D4=
github.com/dadosjusbr/storage v0.0.0-20240315221019-5da10c81ab80/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 @@ -338,6 +338,7 @@ func (h handler) V2GetMonthlyInfo(c echo.Context) error {
VacationCompensation: monthlyInfo.Summary.ItemSummary.VacationCompensation,
ChristmasBonus: monthlyInfo.Summary.ItemSummary.ChristmasBonus,
CompensatoryLicense: monthlyInfo.Summary.ItemSummary.CompensatoryLicense,
HealthAllowance: monthlyInfo.Summary.ItemSummary.HealthAllowance,
Others: monthlyInfo.Summary.ItemSummary.Others,
},
},
Expand Down Expand Up @@ -466,6 +467,7 @@ func (h handler) GetMonthlyInfosByYear(c echo.Context) error {
VacationCompensation: mi.Summary.ItemSummary.VacationCompensation,
ChristmasBonus: mi.Summary.ItemSummary.ChristmasBonus,
CompensatoryLicense: mi.Summary.ItemSummary.CompensatoryLicense,
HealthAllowance: mi.Summary.ItemSummary.HealthAllowance,
Others: mi.Summary.ItemSummary.Others,
},
},
Expand Down Expand Up @@ -680,7 +682,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 @@ -849,6 +851,7 @@ func (h handler) V2GetAllAgencyInformation(c echo.Context) error {
VacationCompensation: c.Summary.ItemSummary.VacationCompensation,
ChristmasBonus: c.Summary.ItemSummary.ChristmasBonus,
CompensatoryLicense: c.Summary.ItemSummary.CompensatoryLicense,
HealthAllowance: c.Summary.ItemSummary.HealthAllowance,
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 @@ -28,6 +28,7 @@ type itemSummary struct {
VacationCompensation float64 `json:"indenizacao_de_ferias"`
ChristmasBonus float64 `json:"gratificacao_natalina"`
CompensatoryLicense float64 `json:"licenca_compensatoria"`
HealthAllowance float64 `json:"auxilio_saude"`
Others float64 `json:"outras"` // 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 @@ -128,6 +128,7 @@ func (h handler) V2GetSummaryOfAgency(c echo.Context) error {
VacationCompensation: agencyMonthlyInfo.Summary.ItemSummary.VacationCompensation,
ChristmasBonus: agencyMonthlyInfo.Summary.ItemSummary.ChristmasBonus,
CompensatoryLicense: agencyMonthlyInfo.Summary.ItemSummary.CompensatoryLicense,
HealthAllowance: agencyMonthlyInfo.Summary.ItemSummary.HealthAllowance,
Others: agencyMonthlyInfo.Summary.ItemSummary.Others,
},
}
Expand Down Expand Up @@ -348,6 +349,7 @@ func (h handler) V2GetTotalsOfAgencyYear(c echo.Context) error {
VacationCompensation: agencyMonthlyInfo.Summary.ItemSummary.VacationCompensation,
ChristmasBonus: agencyMonthlyInfo.Summary.ItemSummary.ChristmasBonus,
CompensatoryLicense: agencyMonthlyInfo.Summary.ItemSummary.CompensatoryLicense,
HealthAllowance: agencyMonthlyInfo.Summary.ItemSummary.HealthAllowance,
Others: agencyMonthlyInfo.Summary.ItemSummary.Others,
},
}
Expand Down Expand Up @@ -608,6 +610,7 @@ func (h handler) V2GetGeneralRemunerationFromYear(c echo.Context) error {
VacationCompensation: d.ItemSummary.VacationCompensation,
ChristmasBonus: d.ItemSummary.ChristmasBonus,
CompensatoryLicense: d.ItemSummary.CompensatoryLicense,
HealthAllowance: d.ItemSummary.HealthAllowance,
Others: d.ItemSummary.Others,
},
})
Expand Down Expand Up @@ -827,6 +830,7 @@ func (h handler) GetAnnualSummary(c echo.Context) error {
VacationCompensation: s.ItemSummary.VacationCompensation,
ChristmasBonus: s.ItemSummary.ChristmasBonus,
CompensatoryLicense: s.ItemSummary.CompensatoryLicense,
HealthAllowance: s.ItemSummary.HealthAllowance,
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 @@ -278,6 +278,7 @@ type itemSummary struct {
VacationCompensation float64 `json:"indenizacao_de_ferias"`
ChristmasBonus float64 `json:"gratificacao_natalina"`
CompensatoryLicense float64 `json:"licenca_compensatoria"`
HealthAllowance float64 `json:"auxilio_saude"`
Others float64 `json:"outras"` // valor agregado de outras rubricas não identificadas
}

Expand Down
8 changes: 8 additions & 0 deletions uiapi/uiapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func (g getSummaryOfAgency) testWhenDataExists(t *testing.T) {
"indenizacao_de_ferias": 130,
"gratificacao_natalina": 120,
"licenca_compensatoria": 120,
"auxilio_saude": 300,
"outras": 200
}
}
Expand Down Expand Up @@ -963,6 +964,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
VacationCompensation: 125,
ChristmasBonus: 175,
CompensatoryLicense: 120,
HealthAllowance: 300,
Others: 200,
},
},
Expand Down Expand Up @@ -1016,6 +1018,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
"indenizacao_de_ferias": 125,
"gratificacao_natalina": 175,
"licenca_compensatoria": 120,
"auxilio_saude": 300,
"outras": 200
}
},
Expand All @@ -1032,6 +1035,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
"indenizacao_de_ferias": 0,
"gratificacao_natalina": 0,
"licenca_compensatoria": 0,
"auxilio_saude": 0,
"outras": 200
}
}
Expand Down Expand Up @@ -1192,6 +1196,7 @@ func (g getTotalsOfAgencyYear) testWhenDataExists(t *testing.T) {
"indenizacao_de_ferias": 130,
"gratificacao_natalina": 120,
"licenca_compensatoria": 120,
"auxilio_saude": 300,
"outras": 200
}
}
Expand Down Expand Up @@ -1343,6 +1348,7 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) {
VacationCompensation: 130,
ChristmasBonus: 170,
CompensatoryLicense: 120,
HealthAllowance: 300,
Others: 200,
},
},
Expand Down Expand Up @@ -1411,6 +1417,7 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) {
"indenizacao_de_ferias": 130,
"gratificacao_natalina": 170,
"licenca_compensatoria": 120,
"auxilio_saude": 300,
"outras": 200
}
}
Expand Down Expand Up @@ -1600,6 +1607,7 @@ func agencyMonthlyInfos() []models.AgencyMonthlyInfo {
VacationCompensation: 130,
ChristmasBonus: 120,
CompensatoryLicense: 120,
HealthAllowance: 300,
Others: 200,
},
},
Expand Down

0 comments on commit 00d62c8

Please sign in to comment.