Skip to content

Commit

Permalink
Merge pull request #581 from dadosjusbr/adicionando-ferias
Browse files Browse the repository at this point in the history
adicionando férias
  • Loading branch information
danielfireman committed May 14, 2024
2 parents bb0bf22 + 89f9b42 commit 187b8a2
Show file tree
Hide file tree
Showing 10 changed files with 39 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 @@ -1049,6 +1049,9 @@ const docTemplate = `{
"auxilio_saude": {
"type": "number"
},
"ferias": {
"type": "number"
},
"gratificacao_natalina": {
"type": "number"
},
Expand Down Expand Up @@ -1403,6 +1406,9 @@ const docTemplate = `{
"auxilio_saude": {
"type": "number"
},
"ferias": {
"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 @@ -1040,6 +1040,9 @@
"auxilio_saude": {
"type": "number"
},
"ferias": {
"type": "number"
},
"gratificacao_natalina": {
"type": "number"
},
Expand Down Expand Up @@ -1394,6 +1397,9 @@
"auxilio_saude": {
"type": "number"
},
"ferias": {
"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 @@ -189,6 +189,8 @@ definitions:
type: number
auxilio_saude:
type: number
ferias:
type: number
gratificacao_natalina:
type: number
indenizacao_de_ferias:
Expand Down Expand Up @@ -426,6 +428,8 @@ definitions:
type: number
auxilio_saude:
type: number
ferias:
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-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
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
5 changes: 4 additions & 1 deletion papi/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions papi/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 4 additions & 0 deletions uiapi/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions uiapi/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
8 changes: 8 additions & 0 deletions uiapi/uiapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -965,6 +966,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
ChristmasBonus: 175,
CompensatoryLicense: 120,
HealthAllowance: 300,
Vacation: 220,
Others: 200,
},
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1605,6 +1612,7 @@ func agencyMonthlyInfos() []models.AgencyMonthlyInfo {
FoodAllowance: 100,
BonusLicense: 150,
VacationCompensation: 130,
Vacation: 220,
ChristmasBonus: 120,
CompensatoryLicense: 120,
HealthAllowance: 300,
Expand Down

0 comments on commit 187b8a2

Please sign in to comment.