Skip to content

Commit

Permalink
Merge pull request #575 from dadosjusbr/indenizacao-de-ferias
Browse files Browse the repository at this point in the history
retornando indenização de férias
  • Loading branch information
danielfireman authored Feb 7, 2024
2 parents 3c44da1 + 45343d1 commit 648fa4d
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 38 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"
},
"indenizacao_de_ferias": {
"type": "number"
},
"licenca_premio": {
"type": "number"
},
Expand Down Expand Up @@ -1388,6 +1391,9 @@ const docTemplate = `{
"auxilio_alimentacao": {
"type": "number"
},
"indenizacao_de_ferias": {
"type": "number"
},
"licenca_premio": {
"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"
},
"indenizacao_de_ferias": {
"type": "number"
},
"licenca_premio": {
"type": "number"
},
Expand Down Expand Up @@ -1379,6 +1382,9 @@
"auxilio_alimentacao": {
"type": "number"
},
"indenizacao_de_ferias": {
"type": "number"
},
"licenca_premio": {
"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
indenizacao_de_ferias:
type: number
licenca_premio:
type: number
outras:
Expand Down Expand Up @@ -416,6 +418,8 @@ definitions:
properties:
auxilio_alimentacao:
type: number
indenizacao_de_ferias:
type: number
licenca_premio:
type: number
outras:
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-20240122222419-3472161adddb
github.com/dadosjusbr/storage v0.0.0-20240205184937-b9805fd9200e
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 @@ -42,6 +42,8 @@ github.com/dadosjusbr/storage v0.0.0-20240109194919-e8fa5bdec162 h1:adRnuhh3Lvk4
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/dadosjusbr/storage v0.0.0-20240205184937-b9805fd9200e h1:3cH5bjKv7JDuGSAU+7WCdtM/ov0pv/6XzTWhTMbyUgc=
github.com/dadosjusbr/storage v0.0.0-20240205184937-b9805fd9200e/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
23 changes: 13 additions & 10 deletions papi/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,10 @@ func (h handler) V2GetMonthlyInfo(c echo.Context) error {
Total: monthlyInfo.Summary.Remunerations.Total,
},
ItemSummary: itemSummary{
FoodAllowance: monthlyInfo.Summary.ItemSummary.FoodAllowance,
BonusLicense: monthlyInfo.Summary.ItemSummary.BonusLicense,
Others: monthlyInfo.Summary.ItemSummary.Others,
FoodAllowance: monthlyInfo.Summary.ItemSummary.FoodAllowance,
BonusLicense: monthlyInfo.Summary.ItemSummary.BonusLicense,
VacationCompensation: monthlyInfo.Summary.ItemSummary.VacationCompensation,
Others: monthlyInfo.Summary.ItemSummary.Others,
},
},
},
Expand Down Expand Up @@ -458,9 +459,10 @@ func (h handler) GetMonthlyInfosByYear(c echo.Context) error {
Total: mi.Summary.Remunerations.Total,
},
ItemSummary: itemSummary{
FoodAllowance: mi.Summary.ItemSummary.FoodAllowance,
BonusLicense: mi.Summary.ItemSummary.BonusLicense,
Others: mi.Summary.ItemSummary.Others,
FoodAllowance: mi.Summary.ItemSummary.FoodAllowance,
BonusLicense: mi.Summary.ItemSummary.BonusLicense,
VacationCompensation: mi.Summary.ItemSummary.VacationCompensation,
Others: mi.Summary.ItemSummary.Others,
},
},
},
Expand Down Expand Up @@ -674,7 +676,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 @@ -838,9 +840,10 @@ func (h handler) V2GetAllAgencyInformation(c echo.Context) error {
Total: c.Summary.Remunerations.Total,
},
ItemSummary: itemSummary{
FoodAllowance: c.Summary.ItemSummary.FoodAllowance,
BonusLicense: c.Summary.ItemSummary.BonusLicense,
Others: c.Summary.ItemSummary.Others,
FoodAllowance: c.Summary.ItemSummary.FoodAllowance,
BonusLicense: c.Summary.ItemSummary.BonusLicense,
VacationCompensation: c.Summary.ItemSummary.VacationCompensation,
Others: c.Summary.ItemSummary.Others,
},
},
},
Expand Down
7 changes: 4 additions & 3 deletions papi/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ type summary struct {
}

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

type summaries struct {
Expand Down
28 changes: 16 additions & 12 deletions uiapi/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ func (h handler) V2GetSummaryOfAgency(c echo.Context) error {
HasNext: time.Date(year, time.Month(month), 1, 0, 0, 0, 0, time.UTC).In(h.loc).Before(time.Now().AddDate(0, 1, 0)),
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,
FoodAllowance: agencyMonthlyInfo.Summary.ItemSummary.FoodAllowance,
BonusLicense: agencyMonthlyInfo.Summary.ItemSummary.BonusLicense,
VacationCompensation: agencyMonthlyInfo.Summary.ItemSummary.VacationCompensation,
Others: agencyMonthlyInfo.Summary.ItemSummary.Others,
},
}
return c.JSON(http.StatusOK, agencySummary)
Expand Down Expand Up @@ -340,9 +341,10 @@ 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,
FoodAllowance: agencyMonthlyInfo.Summary.ItemSummary.FoodAllowance,
BonusLicense: agencyMonthlyInfo.Summary.ItemSummary.BonusLicense,
VacationCompensation: agencyMonthlyInfo.Summary.ItemSummary.VacationCompensation,
Others: agencyMonthlyInfo.Summary.ItemSummary.Others,
},
}
monthTotalsOfYear = append(monthTotalsOfYear, monthTotals)
Expand Down Expand Up @@ -597,9 +599,10 @@ func (h handler) V2GetGeneralRemunerationFromYear(c echo.Context) error {
Discounts: d.Discounts,
Remunerations: d.Remunerations,
ItemSummary: itemSummary{
FoodAllowance: d.ItemSummary.FoodAllowance,
BonusLicense: d.ItemSummary.BonusLicense,
Others: d.ItemSummary.Others,
FoodAllowance: d.ItemSummary.FoodAllowance,
BonusLicense: d.ItemSummary.BonusLicense,
VacationCompensation: d.ItemSummary.VacationCompensation,
Others: d.ItemSummary.Others,
},
})
}
Expand Down Expand Up @@ -813,9 +816,10 @@ func (h handler) GetAnnualSummary(c echo.Context) error {
discountsRemPerMonth := s.Discounts / float64(s.NumMonthsWithData)
discountsRemPerCapita := s.Discounts / float64(s.TotalCount)
itemSummary := itemSummary{
FoodAllowance: s.ItemSummary.FoodAllowance,
BonusLicense: s.ItemSummary.BonusLicense,
Others: s.ItemSummary.Others,
FoodAllowance: s.ItemSummary.FoodAllowance,
BonusLicense: s.ItemSummary.BonusLicense,
VacationCompensation: s.ItemSummary.VacationCompensation,
Others: s.ItemSummary.Others,
}
annualData = append(annualData, annualSummaryData{
Year: s.Year,
Expand Down
7 changes: 4 additions & 3 deletions uiapi/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ type annualSummaryData struct {
}

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

type mensalRemuneration struct {
Expand Down
26 changes: 17 additions & 9 deletions uiapi/uiapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (g getSummaryOfAgency) testWhenDataExists(t *testing.T) {
"resumo_rubricas": {
"auxilio_alimentacao": 100,
"licenca_premio": 150,
"indenizacao_de_ferias": 130,
"outras": 200
}
}
Expand Down Expand Up @@ -955,9 +956,10 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
Discounts: 1000,
Remunerations: 10000,
ItemSummary: models.ItemSummary{
FoodAllowance: 100,
BonusLicense: 150,
Others: 200,
FoodAllowance: 100,
BonusLicense: 150,
VacationCompensation: 125,
Others: 200,
},
},
{
Expand Down Expand Up @@ -1007,6 +1009,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
"resumo_rubricas": {
"auxilio_alimentacao": 100,
"licenca_premio": 150,
"indenizacao_de_ferias": 125,
"outras": 200
}
},
Expand All @@ -1020,6 +1023,7 @@ func (g getGenerealRemunerationFromYear) testWhenDataExists(t *testing.T) {
"resumo_rubricas": {
"auxilio_alimentacao": 100,
"licenca_premio": 0,
"indenizacao_de_ferias": 0,
"outras": 200
}
}
Expand Down Expand Up @@ -1177,6 +1181,7 @@ func (g getTotalsOfAgencyYear) testWhenDataExists(t *testing.T) {
"resumo_rubricas": {
"auxilio_alimentacao": 100,
"licenca_premio": 150,
"indenizacao_de_ferias": 130,
"outras": 200
}
}
Expand Down Expand Up @@ -1323,9 +1328,10 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) {
Size: 30195,
},
ItemSummary: models.ItemSummary{
FoodAllowance: 100,
BonusLicense: 150,
Others: 200,
FoodAllowance: 100,
BonusLicense: 150,
VacationCompensation: 130,
Others: 200,
},
},
}
Expand Down Expand Up @@ -1390,6 +1396,7 @@ func (g getAnnualSummary) testWhenDataExists(t *testing.T) {
"resumo_rubricas": {
"auxilio_alimentacao": 100,
"licenca_premio": 150,
"indenizacao_de_ferias": 130,
"outras": 200
}
}
Expand Down Expand Up @@ -1574,9 +1581,10 @@ func agencyMonthlyInfos() []models.AgencyMonthlyInfo {
50000: 0,
},
ItemSummary: models.ItemSummary{
FoodAllowance: 100,
BonusLicense: 150,
Others: 200,
FoodAllowance: 100,
BonusLicense: 150,
VacationCompensation: 130,
Others: 200,
},
},
CrawlerVersion: "unspecified",
Expand Down

0 comments on commit 648fa4d

Please sign in to comment.