From e348f7553b7e46c38076776a0b8f37ef6bed59fc Mon Sep 17 00:00:00 2001 From: Joellensilva Date: Tue, 11 Jun 2024 17:35:57 -0300 Subject: [PATCH 1/2] adicionando coluna nome_sanitizado --- main.go | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index 25ca132..b2f6265 100644 --- a/main.go +++ b/main.go @@ -131,20 +131,21 @@ func main() { for id, p := range er.Rc.Folha.ContraCheque { salary, benefits, discounts, remuneration := calcBaseSalary(*p) paychecks = append(paychecks, models.Paycheck{ - ID: id + 1, - Agency: er.Rc.Coleta.Orgao, - Month: int(er.Rc.Coleta.Mes), - Year: int(er.Rc.Coleta.Ano), - CollectKey: er.Rc.Coleta.ChaveColeta, - Name: p.Nome, - RegisterID: p.Matricula, - Role: p.Funcao, - Workplace: p.LocalTrabalho, - Salary: salary, - Benefits: benefits, - Discounts: discounts, - Remuneration: remuneration, - Situation: ativoInativo(p.Ativo, er.Rc.Coleta.Orgao), + ID: id + 1, + Agency: er.Rc.Coleta.Orgao, + Month: int(er.Rc.Coleta.Mes), + Year: int(er.Rc.Coleta.Ano), + CollectKey: er.Rc.Coleta.ChaveColeta, + Name: p.Nome, + RegisterID: p.Matricula, + Role: p.Funcao, + Workplace: p.LocalTrabalho, + Salary: salary, + Benefits: benefits, + Discounts: discounts, + Remuneration: remuneration, + Situation: ativoInativo(p.Ativo, er.Rc.Coleta.Orgao), + SanitizedName: sanitizarItem(p.Nome), }) // Detalhamento das despesas i := 1 @@ -327,7 +328,7 @@ func ativoInativo(ativo bool, orgao string) *string { } } -// Sanitizando as rubricas: +// Sanitizando as rubricas e nomes: // deixando-as em minúsculo, sem acentos, pontuações, caracteres especiais e espaços duplos func sanitizarItem(item string) string { // Converte para minúsculas From 0d65346398e339571f4d46ee05bfde2dfbb7a197 Mon Sep 17 00:00:00 2001 From: Joellensilva Date: Mon, 17 Jun 2024 14:29:45 -0300 Subject: [PATCH 2/2] atualizando storage --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index eea3570..c27e6a8 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-20240514131514-43ac5da3ae8a + github.com/dadosjusbr/storage v0.0.0-20240617171357-618f39b02d6f github.com/kelseyhightower/envconfig v1.4.0 google.golang.org/protobuf v1.28.1 ) diff --git a/go.sum b/go.sum index 8c68859..4e57b67 100644 --- a/go.sum +++ b/go.sum @@ -44,6 +44,8 @@ github.com/dadosjusbr/storage v0.0.0-20240315221019-5da10c81ab80 h1:mo6k/MAl6aF6 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/dadosjusbr/storage v0.0.0-20240617171357-618f39b02d6f h1:56frC4wo/iyKmCe/5+HvKZn5AS3fFc0KDXm/DMij8kA= +github.com/dadosjusbr/storage v0.0.0-20240617171357-618f39b02d6f/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=