diff --git a/go.mod b/go.mod index e70470c..d9e6819 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/dadosjusbr/proto v0.0.0-20221212025627-91c60aa3cd12 - github.com/dadosjusbr/storage v0.0.0-20240315221019-5da10c81ab80 + github.com/dadosjusbr/storage v0.0.0-20240514131514-43ac5da3ae8a github.com/gocarina/gocsv v0.0.0-20220712153207-8b2118da4570 github.com/golang/mock v1.6.0 github.com/joho/godotenv v1.4.0 diff --git a/go.sum b/go.sum index a44c82d..6ab5016 100644 --- a/go.sum +++ b/go.sum @@ -32,10 +32,13 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/dadosjusbr/datapackage v0.0.0-20230904162108-6e2264aafb68/go.mod h1:o1FghJC46mR+lgHcQWVve/q84/SAd0WVdYMcgq88BBU= +github.com/dadosjusbr/datapackage v0.0.0-20240320203926-5f369dadd3a5/go.mod h1:xDZc4jX8VDOP7SFo793x0Q8gjUjuMSOmNEUG/wqLKAw= github.com/dadosjusbr/proto v0.0.0-20221212025627-91c60aa3cd12 h1:ufl8nbCEo6g2VHUbedGy0gYk9Sgrynf9rcnzuSw4TEg= github.com/dadosjusbr/proto v0.0.0-20221212025627-91c60aa3cd12/go.mod h1:gPA7VxjEmyez/xtln4qBj+tM1NO0/zcw3ryjxTRNSco= 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/dadosjusbr/storage v0.0.0-20240514131514-43ac5da3ae8a h1:1LyzfsNzKgLjC4/cyQr+N724a4dcRCHB5yIauAnhhcI= +github.com/dadosjusbr/storage v0.0.0-20240514131514-43ac5da3ae8a/go.mod h1:rIM/dbZMdrMfVnZgNgRNRRtsxfhSMH8S8X7MZEeKkrQ= 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= @@ -49,6 +52,7 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frictionlessdata/datapackage-go v1.0.4/go.mod h1:bqt5SzFjnpsZNw4kXO4CFIwH9vV5LhEdQikftJ0uJ5M= github.com/frictionlessdata/tableschema-go v1.1.4-0.20220401172006-6cc5f3b2411c/go.mod h1:B+DhLlwjCf6p6FqVkqpdYyAIy7L8jHCaxa2wFaqpYdc= +github.com/frictionlessdata/tableschema-go v1.5.2/go.mod h1:B+DhLlwjCf6p6FqVkqpdYyAIy7L8jHCaxa2wFaqpYdc= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= diff --git a/papi/handlers.go b/papi/handlers.go index 390dde1..08e3946 100644 --- a/papi/handlers.go +++ b/papi/handlers.go @@ -336,6 +336,7 @@ func (h handler) V2GetMonthlyInfo(c echo.Context) error { FoodAllowance: monthlyInfo.Summary.ItemSummary.FoodAllowance, BonusLicense: monthlyInfo.Summary.ItemSummary.BonusLicense, VacationCompensation: monthlyInfo.Summary.ItemSummary.VacationCompensation, + Vacation: monthlyInfo.Summary.ItemSummary.Vacation, ChristmasBonus: monthlyInfo.Summary.ItemSummary.ChristmasBonus, CompensatoryLicense: monthlyInfo.Summary.ItemSummary.CompensatoryLicense, HealthAllowance: monthlyInfo.Summary.ItemSummary.HealthAllowance, @@ -465,6 +466,7 @@ func (h handler) GetMonthlyInfosByYear(c echo.Context) error { FoodAllowance: mi.Summary.ItemSummary.FoodAllowance, BonusLicense: mi.Summary.ItemSummary.BonusLicense, VacationCompensation: mi.Summary.ItemSummary.VacationCompensation, + Vacation: mi.Summary.ItemSummary.Vacation, ChristmasBonus: mi.Summary.ItemSummary.ChristmasBonus, CompensatoryLicense: mi.Summary.ItemSummary.CompensatoryLicense, HealthAllowance: mi.Summary.ItemSummary.HealthAllowance, @@ -682,7 +684,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") @@ -849,6 +851,7 @@ func (h handler) V2GetAllAgencyInformation(c echo.Context) error { FoodAllowance: c.Summary.ItemSummary.FoodAllowance, BonusLicense: c.Summary.ItemSummary.BonusLicense, VacationCompensation: c.Summary.ItemSummary.VacationCompensation, + Vacation: c.Summary.ItemSummary.Vacation, ChristmasBonus: c.Summary.ItemSummary.ChristmasBonus, CompensatoryLicense: c.Summary.ItemSummary.CompensatoryLicense, HealthAllowance: c.Summary.ItemSummary.HealthAllowance, diff --git a/papi/models.go b/papi/models.go index a182b14..0a4b872 100644 --- a/papi/models.go +++ b/papi/models.go @@ -26,6 +26,7 @@ type itemSummary struct { FoodAllowance float64 `json:"auxilio_alimentacao"` BonusLicense float64 `json:"licenca_premio"` VacationCompensation float64 `json:"indenizacao_de_ferias"` + Vacation float64 `json:"ferias"` ChristmasBonus float64 `json:"gratificacao_natalina"` CompensatoryLicense float64 `json:"licenca_compensatoria"` HealthAllowance float64 `json:"auxilio_saude"` diff --git a/uiapi/handlers.go b/uiapi/handlers.go index a219d57..7da93ef 100644 --- a/uiapi/handlers.go +++ b/uiapi/handlers.go @@ -126,6 +126,7 @@ func (h handler) V2GetSummaryOfAgency(c echo.Context) error { FoodAllowance: agencyMonthlyInfo.Summary.ItemSummary.FoodAllowance, BonusLicense: agencyMonthlyInfo.Summary.ItemSummary.BonusLicense, VacationCompensation: agencyMonthlyInfo.Summary.ItemSummary.VacationCompensation, + Vacation: agencyMonthlyInfo.Summary.ItemSummary.Vacation, ChristmasBonus: agencyMonthlyInfo.Summary.ItemSummary.ChristmasBonus, CompensatoryLicense: agencyMonthlyInfo.Summary.ItemSummary.CompensatoryLicense, HealthAllowance: agencyMonthlyInfo.Summary.ItemSummary.HealthAllowance, @@ -347,6 +348,7 @@ func (h handler) V2GetTotalsOfAgencyYear(c echo.Context) error { FoodAllowance: agencyMonthlyInfo.Summary.ItemSummary.FoodAllowance, BonusLicense: agencyMonthlyInfo.Summary.ItemSummary.BonusLicense, VacationCompensation: agencyMonthlyInfo.Summary.ItemSummary.VacationCompensation, + Vacation: agencyMonthlyInfo.Summary.ItemSummary.Vacation, ChristmasBonus: agencyMonthlyInfo.Summary.ItemSummary.ChristmasBonus, CompensatoryLicense: agencyMonthlyInfo.Summary.ItemSummary.CompensatoryLicense, HealthAllowance: agencyMonthlyInfo.Summary.ItemSummary.HealthAllowance, @@ -608,6 +610,7 @@ func (h handler) V2GetGeneralRemunerationFromYear(c echo.Context) error { FoodAllowance: d.ItemSummary.FoodAllowance, BonusLicense: d.ItemSummary.BonusLicense, VacationCompensation: d.ItemSummary.VacationCompensation, + Vacation: d.ItemSummary.Vacation, ChristmasBonus: d.ItemSummary.ChristmasBonus, CompensatoryLicense: d.ItemSummary.CompensatoryLicense, HealthAllowance: d.ItemSummary.HealthAllowance, @@ -828,6 +831,7 @@ func (h handler) GetAnnualSummary(c echo.Context) error { FoodAllowance: s.ItemSummary.FoodAllowance, BonusLicense: s.ItemSummary.BonusLicense, VacationCompensation: s.ItemSummary.VacationCompensation, + Vacation: s.ItemSummary.Vacation, ChristmasBonus: s.ItemSummary.ChristmasBonus, CompensatoryLicense: s.ItemSummary.CompensatoryLicense, HealthAllowance: s.ItemSummary.HealthAllowance, diff --git a/uiapi/models.go b/uiapi/models.go index 0b986aa..d0a7610 100644 --- a/uiapi/models.go +++ b/uiapi/models.go @@ -276,6 +276,7 @@ type itemSummary struct { FoodAllowance float64 `json:"auxilio_alimentacao"` BonusLicense float64 `json:"licenca_premio"` VacationCompensation float64 `json:"indenizacao_de_ferias"` + Vacation float64 `json:"ferias"` ChristmasBonus float64 `json:"gratificacao_natalina"` CompensatoryLicense float64 `json:"licenca_compensatoria"` HealthAllowance float64 `json:"auxilio_saude"` diff --git a/uiapi/uiapi_test.go b/uiapi/uiapi_test.go index 858308e..fe8c770 100644 --- a/uiapi/uiapi_test.go +++ b/uiapi/uiapi_test.go @@ -103,6 +103,7 @@ func (g getSummaryOfAgency) testWhenDataExists(t *testing.T) { "auxilio_alimentacao": 100, "licenca_premio": 150, "indenizacao_de_ferias": 130, + "ferias": 220, "gratificacao_natalina": 120, "licenca_compensatoria": 120, "auxilio_saude": 300, @@ -965,6 +966,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) { ChristmasBonus: 175, CompensatoryLicense: 120, HealthAllowance: 300, + Vacation: 220, Others: 200, }, }, @@ -1016,6 +1018,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) { "auxilio_alimentacao": 100, "licenca_premio": 150, "indenizacao_de_ferias": 125, + "ferias": 220, "gratificacao_natalina": 175, "licenca_compensatoria": 120, "auxilio_saude": 300, @@ -1033,6 +1036,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) { "auxilio_alimentacao": 100, "licenca_premio": 0, "indenizacao_de_ferias": 0, + "ferias": 0, "gratificacao_natalina": 0, "licenca_compensatoria": 0, "auxilio_saude": 0, @@ -1194,6 +1198,7 @@ func (g getTotalsOfAgencyYear) testWhenDataExists(t *testing.T) { "auxilio_alimentacao": 100, "licenca_premio": 150, "indenizacao_de_ferias": 130, + "ferias": 220, "gratificacao_natalina": 120, "licenca_compensatoria": 120, "auxilio_saude": 300, @@ -1346,6 +1351,7 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) { FoodAllowance: 100, BonusLicense: 150, VacationCompensation: 130, + Vacation: 220, ChristmasBonus: 170, CompensatoryLicense: 120, HealthAllowance: 300, @@ -1415,6 +1421,7 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) { "auxilio_alimentacao": 100, "licenca_premio": 150, "indenizacao_de_ferias": 130, + "ferias": 220, "gratificacao_natalina": 170, "licenca_compensatoria": 120, "auxilio_saude": 300, @@ -1605,6 +1612,7 @@ func agencyMonthlyInfos() []models.AgencyMonthlyInfo { FoodAllowance: 100, BonusLicense: 150, VacationCompensation: 130, + Vacation: 220, ChristmasBonus: 120, CompensatoryLicense: 120, HealthAllowance: 300,