teodoro 0.44.2 → 0.45.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e70ad622a533d7767eb960b8ce4cb57c9fb665e360256f1fe6a40768cc762076
4
- data.tar.gz: 21f8ee68467467351541e284c25fcb0ae6c60ea640efdb7f4a711fd00b9cdb21
3
+ metadata.gz: bb1c00eaa00dea82fcbaf037fcd319e3a0c2ef3dde4f524c0d674b327198eef1
4
+ data.tar.gz: 43e9a044e50b77eb72f60a3602755086b86791d19339dd89cedb163ab7ea4d90
5
5
  SHA512:
6
- metadata.gz: 3fca4cf8bb82be1f8bea7769b2ca1f2b8fe45571006a8d85372f21c2a714e5c5b85525d3685029f4caf51a9897415fdb922eb7fb7a79c9f24f8a5333bef5d8b6
7
- data.tar.gz: 73f3ac48d331cd0f86d5bec1e8c6524847601920bf636963a7aa9d5a5545eb442734723e1b5deccb0b2f106fbcf540812482b6fee5a84c1c4816be910a54a20f
6
+ metadata.gz: ded51453baf0dfacd2fcd794bea81b2213c02fa78da8b6c7ab5bacbd3e4336196b4a2cdbfed2cc01133fa0776eaf7fa2f9d06a51ce6f7f9a91137bed08d11c6e
7
+ data.tar.gz: 6a20a63d7ead24231bd53a770822f9cb4ad7c817b9b631bd7242decade16aa4b66267be76f4b1e26dfcc2b343900d64bd85174358c98020049753818919d6877
@@ -21,8 +21,8 @@ module Teodoro
21
21
  def criar
22
22
  raise 'evento duplicado' if File.exist?(caminho)
23
23
 
24
- File.open(caminho, 'w') do
25
- _1.puts(conteudo_do_arquivo)
24
+ File.open(caminho, 'w') do |file|
25
+ file.puts(conteudo_do_arquivo)
26
26
  end
27
27
  end
28
28
 
@@ -36,8 +36,8 @@ module Teodoro
36
36
  itens_do_conteudo
37
37
  .map { [_1[0], _1[1], _1.size == 1 ? :vazio : _1[2]] }
38
38
  .map { |chave, valor, formato| [chave, Valor.new(valor, formato: formato)] }
39
- .reject { _2.vazio? }
40
- .map { "#{_1}=#{_2}" }
39
+ .reject { |_chave, valor| valor.vazio? }
40
+ .map { |chave, valor| "#{chave}=#{valor}" }
41
41
  end
42
42
 
43
43
  class Caminho
@@ -37,6 +37,10 @@ module Teodoro
37
37
  @tipo_de_inscricao_do_empregador ||= evento['ideEmpregador/tpInsc']
38
38
  end
39
39
 
40
+ def numero_de_inscricao_do_empregador
41
+ @numero_de_inscricao_do_empregador ||= evento['ideEmpregador/nrInsc']
42
+ end
43
+
40
44
  def numero_do_recibo
41
45
  @numero_do_recibo ||= recibo['recibo/nrRecibo']
42
46
  end
@@ -30,9 +30,9 @@ module Teodoro
30
30
  end
31
31
 
32
32
  def registrar_arquivos_data
33
- arquivos_data.each do
33
+ arquivos_data.each do |arquivo_data|
34
34
  empresa.arquivos_data.registrar(
35
- nome: _1.nome,
35
+ nome: arquivo_data.nome,
36
36
  recibo: numero_do_recibo
37
37
  )
38
38
  end
@@ -43,13 +43,13 @@ module Teodoro
43
43
  end
44
44
 
45
45
  def arquivos_data
46
- @arquivos_data ||= dados_dos_arquivos_data.map {
46
+ @arquivos_data ||= dados_dos_arquivos_data.map do |dados_do_arquivo_data|
47
47
  ArquivoData.new(
48
48
  diretorio: empresa.destino_dos_arquivos_data,
49
- nome: _1.nome,
50
- itens_do_conteudo: _1.itens_do_conteudo
49
+ nome: dados_do_arquivo_data.nome,
50
+ itens_do_conteudo: dados_do_arquivo_data.itens_do_conteudo
51
51
  )
52
- }
52
+ end
53
53
  end
54
54
  end
55
55
  end
@@ -28,9 +28,9 @@ module Teodoro
28
28
  private
29
29
 
30
30
  def extrair(entrada)
31
- File.join(destino_dos_arquivos_xml, entrada.name).then do
32
- entrada.extract(_1) unless File.exist?(_1)
33
- end
31
+ File
32
+ .join(destino_dos_arquivos_xml, entrada.name)
33
+ .then { entrada.extract(_1) unless File.exist?(_1) }
34
34
  end
35
35
  end
36
36
  end
@@ -15,7 +15,10 @@ require_relative 'leiaute/arquivo_s2190'
15
15
  require_relative 'leiaute/arquivo_s2200'
16
16
  require_relative 'leiaute/arquivo_s2205'
17
17
  require_relative 'leiaute/arquivo_s2206'
18
+ require_relative 'leiaute/arquivo_s2210'
19
+ require_relative 'leiaute/arquivo_s2220'
18
20
  require_relative 'leiaute/arquivo_s2230'
21
+ require_relative 'leiaute/arquivo_s2240'
19
22
  require_relative 'leiaute/arquivo_s2250'
20
23
  require_relative 'leiaute/arquivo_s2299'
21
24
  require_relative 'leiaute/arquivo_s2300'
@@ -40,7 +43,10 @@ module Teodoro
40
43
  S2200
41
44
  S2205
42
45
  S2206
46
+ S2210
47
+ S2220
43
48
  S2230
49
+ S2240
44
50
  S2250
45
51
  S2299
46
52
  S2300
@@ -54,7 +60,10 @@ module Teodoro
54
60
  S2200
55
61
  S2205
56
62
  S2206
63
+ S2210
64
+ S2220
57
65
  S2230
66
+ S2240
58
67
  S2250
59
68
  S2299
60
69
  S2300
@@ -33,7 +33,7 @@ module Teodoro
33
33
  end
34
34
 
35
35
  def remover(recibo)
36
- contratos_por_matricula.delete_if { _2.recibo == recibo }
36
+ contratos_por_matricula.delete_if { |_matricula, contratos| contratos.recibo == recibo }
37
37
  end
38
38
 
39
39
  private
@@ -18,10 +18,11 @@ module Teodoro
18
18
 
19
19
  def [](cpf_do_trabalhador:, categoria_do_trabalhador:, data:)
20
20
  contratos
21
- .select {
22
- _1.trabalhador.cpf == cpf_do_trabalhador && _1.categoria_do_trabalhador == categoria_do_trabalhador &&
23
- _1.ativo?(data)
24
- }
21
+ .select do |contrato|
22
+ contrato.trabalhador.cpf == cpf_do_trabalhador &&
23
+ contrato.categoria_do_trabalhador == categoria_do_trabalhador &&
24
+ contrato.ativo?(data)
25
+ end
25
26
  .max_by(&:data_de_inicio)
26
27
  end
27
28
 
@@ -173,10 +173,12 @@ module Teodoro
173
173
 
174
174
  def arquivos_data_emp
175
175
  Dir[File.join(destino_dos_arquivos_data, 'EMP*.data')]
176
- .map { ArquivoDataEMP.new(
177
- caminho: _1,
178
- proximo_identificador_de_tabela_de_rubricas: proximo_identificador_de_tabela_de_rubricas
179
- ) }
176
+ .map do |caminho|
177
+ ArquivoDataEMP.new(
178
+ caminho: caminho,
179
+ proximo_identificador_de_tabela_de_rubricas: proximo_identificador_de_tabela_de_rubricas
180
+ )
181
+ end
180
182
  end
181
183
 
182
184
  def proximo_identificador_de_tabela_de_rubricas
@@ -208,7 +210,7 @@ module Teodoro
208
210
  end
209
211
 
210
212
  def caminhos_dos_arquivos_emp_data
211
- Dir[File.join(destino_dos_arquivos_data, 'EMP*.data')]
213
+ Dir[File.join(destino_dos_arquivos_data, 'EMP*.data')].sort
212
214
  end
213
215
 
214
216
  def novo_caminho_do_ultimo_arquivo_emp_data
@@ -60,7 +60,7 @@ module Teodoro
60
60
  end
61
61
 
62
62
  def numero_de_inscricao
63
- @numero_de_inscricao ||= evento['ideEmpregador/nrInsc']
63
+ numero_de_inscricao_do_empregador
64
64
  end
65
65
 
66
66
  def cnpj_raiz
@@ -52,13 +52,15 @@ module Teodoro
52
52
  [
53
53
  [
54
54
  'DadosRubrica_CodigoIncidenciaIR',
55
- evento['infoRubrica/*/dadosRubrica/codIncIRRF'].then { {
56
- '0' => '00',
57
- '1' => '01',
58
- '9' => '09',
59
- '700' => '79',
60
- '701' => '79'
61
- }[_1] || _1 }
55
+ evento['infoRubrica/*/dadosRubrica/codIncIRRF'].then do |valor|
56
+ {
57
+ '0' => '00',
58
+ '1' => '01',
59
+ '9' => '09',
60
+ '700' => '79',
61
+ '701' => '79'
62
+ }[valor] || valor
63
+ end
62
64
  ]
63
65
  ]
64
66
  else
@@ -128,10 +128,12 @@ module Teodoro
128
128
  end
129
129
 
130
130
  def afastamento
131
- evento['vinculo/afastamento']&.then { Obj.new(
132
- data_de_inicio: _1['dtIniAfast'],
133
- codigo_do_motivo: _1['codMotAfast']
134
- ) }
131
+ evento['vinculo/afastamento']&.then do |afastamento|
132
+ Obj.new(
133
+ data_de_inicio: afastamento['dtIniAfast'],
134
+ codigo_do_motivo: afastamento['codMotAfast']
135
+ )
136
+ end
135
137
  end
136
138
 
137
139
  def dados_dos_arquivos_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
@@ -394,8 +396,10 @@ module Teodoro
394
396
 
395
397
  def condicao_de_ingresso_no_brasil_do_trabalhador
396
398
  @condicao_de_ingresso_no_brasil_do_trabalhador ||=
397
- evento['trabalhador/trabImig']&.then do
398
- Teodoro::LeiauteSimplificado::TrabalhadorImigrante.new(_1).condicao_de_ingresso_no_brasil_no_leiaute2
399
+ evento['trabalhador/trabImig']&.then do |imigrante|
400
+ Teodoro::LeiauteSimplificado::TrabalhadorImigrante
401
+ .new(imigrante)
402
+ .condicao_de_ingresso_no_brasil_no_leiaute2
399
403
  end
400
404
  end
401
405
 
@@ -24,14 +24,16 @@ module Teodoro
24
24
  pais_de_nacionalidade: pais_de_nacionalidade_do_trabalhador,
25
25
  nascimento: Obj.new(
26
26
  if leiaute_simplificado?
27
- empresa.trabalhadores[cpf_do_trabalhador].nascimento.then { {
28
- data: _1.data,
29
- pais: _1.pais,
30
- codigo_do_municipio: _1.codigo_do_municipio,
31
- uf: _1.uf,
32
- nome_da_mae: _1.nome_da_mae,
33
- nome_do_pai: _1.nome_do_pai
34
- } }
27
+ empresa.trabalhadores[cpf_do_trabalhador].nascimento.then do |nascimento|
28
+ {
29
+ data: nascimento.data,
30
+ pais: nascimento.pais,
31
+ codigo_do_municipio: nascimento.codigo_do_municipio,
32
+ uf: nascimento.uf,
33
+ nome_da_mae: nascimento.nome_da_mae,
34
+ nome_do_pai: nascimento.nome_do_pai
35
+ }
36
+ end
35
37
  else
36
38
  {
37
39
  data: evento['alteracao/dadosTrabalhador/nascimento/dtNascto'],
@@ -121,8 +123,8 @@ module Teodoro
121
123
  def leiaute
122
124
  @leiaute ||= Obj.new(
123
125
  condicao_de_ingresso_no_brasil: if leiaute_simplificado?
124
- evento['alteracao/dadosTrabalhador/trabImig']&.then do
125
- LeiauteSimplificado::TrabalhadorImigrante.new(_1)
126
+ evento['alteracao/dadosTrabalhador/trabImig']&.then do |imigrante|
127
+ LeiauteSimplificado::TrabalhadorImigrante.new(imigrante)
126
128
  .condicao_de_ingresso_no_brasil_no_leiaute2
127
129
  end
128
130
  else
@@ -0,0 +1,75 @@
1
+ module Teodoro
2
+ module Leiaute
3
+ class ArquivoS2210
4
+ include ArquivoDeEventoNaoPeriodico
5
+
6
+ private
7
+
8
+ def dados_dos_arquivos_data
9
+ [
10
+ Obj.new(
11
+ nome: "CAT_#{numero_do_recibo}",
12
+ itens_do_conteudo: itens_do_conteudo
13
+ )
14
+ ]
15
+ end
16
+
17
+ def itens_do_conteudo # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
18
+ [
19
+ ['Id', id_do_evento],
20
+ ['procEmi', processo_de_emissao_do_evento],
21
+ ['verProc', versao_do_processo_de_emissao_do_evento],
22
+ ['ideEmpregador/tpInsc', tipo_de_inscricao_do_empregador],
23
+ ['ideEmpregador/nrInsc', numero_de_inscricao_do_empregador],
24
+ ['cpfTrab', evento['ideVinculo/cpfTrab']],
25
+ ['matricula', evento['ideVinculo/matricula']],
26
+ ['codCateg', evento['ideVinculo/codCateg']],
27
+ ['dtAcid', evento['cat/dtAcid']],
28
+ ['tpAcid', evento['cat/tpAcid']],
29
+ ['hrAcid', evento['cat/hrAcid']],
30
+ ['hrsTrabAntesAcid', evento['cat/hrsTrabAntesAcid']],
31
+ ['tpCat', evento['cat/tpCat']],
32
+ ['indCatObito', evento['cat/indCatObito']],
33
+ ['dtObito', evento['cat/dtObito']],
34
+ ['indComunPolicia', evento['cat/indComunPolicia']],
35
+ ['codSitGeradora', evento['cat/codSitGeradora']],
36
+ ['iniciatCAT', evento['cat/iniciatCAT']],
37
+ ['obsCAT', evento['cat/obsCAT']],
38
+ ['tpLocal', evento['cat/localAcidente/tpLocal']],
39
+ ['dscLocal', evento['cat/localAcidente/dscLocal']],
40
+ ['tpLograd', evento['cat/localAcidente/tpLograd']],
41
+ ['dscLograd', evento['cat/localAcidente/dscLograd']],
42
+ ['nrLograd', evento['cat/localAcidente/nrLograd']],
43
+ ['complemento', evento['cat/localAcidente/complemento']],
44
+ ['bairro', evento['cat/localAcidente/bairro']],
45
+ ['cep', evento['cat/localAcidente/cep']],
46
+ ['codMunic', evento['cat/localAcidente/codMunic']],
47
+ ['uf', evento['cat/localAcidente/uf']],
48
+ ['pais', evento['cat/localAcidente/pais']],
49
+ ['codPostal', evento['cat/localAcidente/codPostal']],
50
+ ['ideLocalAcid/tpInsc', evento['cat/localAcidente/ideLocalAcid/tpInsc']],
51
+ ['ideLocalAcid/nrInsc', evento['cat/localAcidente/ideLocalAcid/nrInsc']],
52
+ ['codParteAting', evento['cat/parteAtingida/codParteAting']],
53
+ ['lateralidade', evento['cat/parteAtingida/lateralidade']],
54
+ ['codAgntCausador', evento['cat/agenteCausador/codAgntCausador']],
55
+ ['dtAtendimento', evento['cat/atestado/dtAtendimento']],
56
+ ['hrAtendimento', evento['cat/atestado/hrAtendimento']],
57
+ ['indInternacao', evento['cat/atestado/indInternacao']],
58
+ ['durTrat', evento['cat/atestado/durTrat']],
59
+ ['indAfast', evento['cat/atestado/indAfast']],
60
+ ['dscLesao', evento['cat/atestado/dscLesao']],
61
+ ['dscCompLesao', evento['cat/atestado/dscCompLesao']],
62
+ ['diagProvavel', evento['cat/atestado/diagProvavel']],
63
+ ['codCID', evento['cat/atestado/codCID']],
64
+ ['observacao', evento['cat/atestado/observacao']],
65
+ ['nmEmit', evento['cat/atestado/emitente/nmEmit']],
66
+ ['ideOC', evento['cat/atestado/emitente/ideOC']],
67
+ ['nrOC', evento['cat/atestado/emitente/nrOC']],
68
+ ['ufOC', evento['cat/atestado/emitente/ufOC']],
69
+ ['nrRecCatOrig', evento['cat/catOrigem/nrRecCatOrig']],
70
+ ['nrRecibo', numero_do_recibo]
71
+ ]
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,51 @@
1
+ module Teodoro
2
+ module Leiaute
3
+ class ArquivoS2220
4
+ include ArquivoDeEventoNaoPeriodico
5
+
6
+ private
7
+
8
+ def dados_dos_arquivos_data
9
+ [
10
+ Obj.new(
11
+ nome: "ASO_#{numero_do_recibo}",
12
+ itens_do_conteudo: itens_do_conteudo
13
+ )
14
+ ]
15
+ end
16
+
17
+ def itens_do_conteudo # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
18
+ [
19
+ ['Id', id_do_evento],
20
+ ['procEmi', processo_de_emissao_do_evento],
21
+ ['verProc', versao_do_processo_de_emissao_do_evento],
22
+ ['ideEmpregador/tpInsc', tipo_de_inscricao_do_empregador],
23
+ ['ideEmpregador/nrInsc', numero_de_inscricao_do_empregador],
24
+ ['cpfTrab', evento['ideVinculo/cpfTrab']],
25
+ ['matricula', evento['ideVinculo/matricula']],
26
+ ['codCateg', evento['ideVinculo/codCateg']],
27
+ ['tpExameOcup', evento['exMedOcup/tpExameOcup']],
28
+ ['dtAso', evento['exMedOcup/aso/dtAso']],
29
+ ['resAso', evento['exMedOcup/aso/resAso']],
30
+ *evento.*('exMedOcup/aso/exame').map.with_index(1) do |exame, seq|
31
+ [
32
+ ["exame_#{seq}_dtExm", exame['dtExm']],
33
+ ["exame_#{seq}_procRealizado", exame['procRealizado']],
34
+ ["exame_#{seq}_obsProc", exame['obsProc']],
35
+ ["exame_#{seq}_ordExame", exame['ordExame']],
36
+ ["exame_#{seq}_indResult", exame['indResult']]
37
+ ]
38
+ end.sum([]),
39
+ ['medico/nmMed', evento['exMedOcup/aso/medico/nmMed']],
40
+ ['medico/nrCRM', evento['exMedOcup/aso/medico/nrCRM']],
41
+ ['medico/ufCRM', evento['exMedOcup/aso/medico/ufCRM']],
42
+ ['respMonit/cpfResp', evento['exMedOcup/respMonit/cpfResp']],
43
+ ['respMonit/nmResp', evento['exMedOcup/respMonit/nmResp']],
44
+ ['respMonit/nrCRM', evento['exMedOcup/respMonit/nrCRM']],
45
+ ['respMonit/ufCRM', evento['exMedOcup/respMonit/ufCRM']],
46
+ ['nrRecibo', numero_do_recibo]
47
+ ]
48
+ end
49
+ end
50
+ end
51
+ end
@@ -43,10 +43,10 @@ module Teodoro
43
43
  if inicio_do_afastamento?
44
44
  inicio_do_afastamento['dtIniAfast']
45
45
  else
46
- contrato_de_trabalho.afastamento.then do
47
- raise 'término de afastamento sem início de afastamento' unless _1
46
+ contrato_de_trabalho.afastamento.then do |afastamento|
47
+ raise 'término de afastamento sem início de afastamento' unless afastamento
48
48
 
49
- _1.data_de_inicio
49
+ afastamento.data_de_inicio
50
50
  end
51
51
  end
52
52
  end
@@ -0,0 +1,75 @@
1
+ module Teodoro
2
+ module Leiaute
3
+ class ArquivoS2240
4
+ include ArquivoDeEventoNaoPeriodico
5
+
6
+ private
7
+
8
+ def dados_dos_arquivos_data
9
+ [
10
+ Obj.new(
11
+ nome: "AMB_#{numero_do_recibo}",
12
+ itens_do_conteudo: itens_do_conteudo
13
+ )
14
+ ]
15
+ end
16
+
17
+ def itens_do_conteudo # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
18
+ [
19
+ ['Id', id_do_evento],
20
+ ['procEmi', processo_de_emissao_do_evento],
21
+ ['verProc', versao_do_processo_de_emissao_do_evento],
22
+ ['ideEmpregador/tpInsc', tipo_de_inscricao_do_empregador],
23
+ ['ideEmpregador/nrInsc', numero_de_inscricao_do_empregador],
24
+ ['cpfTrab', evento['ideVinculo/cpfTrab']],
25
+ ['matricula', evento['ideVinculo/matricula']],
26
+ ['codCateg', evento['ideVinculo/codCateg']],
27
+ ['dtIniCondicao', evento['infoExpRisco/dtIniCondicao']],
28
+ ['localAmb', evento['infoExpRisco/infoAmb/localAmb']],
29
+ ['dscSetor', evento['infoExpRisco/infoAmb/dscSetor']],
30
+ ['infoAmb/tpInsc', evento['infoExpRisco/infoAmb/tpInsc']],
31
+ ['infoAmb/nrInsc', evento['infoExpRisco/infoAmb/nrInsc']],
32
+ ['dscAtivDes', evento['infoExpRisco/infoAtiv/dscAtivDes']],
33
+ *evento.*('infoExpRisco/agNoc').map.with_index(1) do |agente_nocivo, seq|
34
+ [
35
+ ["agNoc_#{seq}_codAgNoc", agente_nocivo['codAgNoc']],
36
+ ["agNoc_#{seq}_dscAgNoc", agente_nocivo['dscAgNoc']],
37
+ ["agNoc_#{seq}_tpAval", agente_nocivo['tpAval']],
38
+ ["agNoc_#{seq}_intConc", agente_nocivo['intConc']],
39
+ ["agNoc_#{seq}_limTol", agente_nocivo['limTol']],
40
+ ["agNoc_#{seq}_unMed", agente_nocivo['unMed']],
41
+ ["agNoc_#{seq}_tecMedicao", agente_nocivo['tecMedicao']],
42
+ ["agNoc_#{seq}_utilizEPC", agente_nocivo['epcEpi/utilizEPC']],
43
+ ["agNoc_#{seq}_eficEpc", agente_nocivo['epcEpi/eficEpc']],
44
+ ["agNoc_#{seq}_utilizEPI", agente_nocivo['epcEpi/utilizEPI']],
45
+ ["agNoc_#{seq}_eficEpi", agente_nocivo['epcEpi/eficEpi']],
46
+ *agente_nocivo.*('epcEpi/epi').map.with_index(1) do |epi, epi_seq|
47
+ [
48
+ ["agNoc_#{seq}_epi_#{epi_seq}_docAval", epi['docAval']],
49
+ ["agNoc_#{seq}_epi_#{epi_seq}_dscEPI", epi['dscEPI']]
50
+ ]
51
+ end.sum([]),
52
+ ["agNoc_#{seq}_medProtecao", agente_nocivo['epcEpi/epiCompl/medProtecao']],
53
+ ["agNoc_#{seq}_condFuncto", agente_nocivo['epcEpi/epiCompl/condFuncto']],
54
+ ["agNoc_#{seq}_usoInint", agente_nocivo['epcEpi/epiCompl/usoInint']],
55
+ ["agNoc_#{seq}_przValid", agente_nocivo['epcEpi/epiCompl/przValid']],
56
+ ["agNoc_#{seq}_periodicTroca", agente_nocivo['epcEpi/epiCompl/periodicTroca']],
57
+ ["agNoc_#{seq}_higienizacao", agente_nocivo['epcEpi/epiCompl/higienizacao']]
58
+ ]
59
+ end.sum([]),
60
+ *evento.*('infoExpRisco/respReg').map.with_index(1) do |responsavel, seq|
61
+ [
62
+ ["respReg_#{seq}_cpfResp", responsavel['cpfResp']],
63
+ ["respReg_#{seq}_ideOC", responsavel['ideOC']],
64
+ ["respReg_#{seq}_dscOC", responsavel['dscOC']],
65
+ ["respReg_#{seq}_nrOC", responsavel['nrOC']],
66
+ ["respReg_#{seq}_ufOC", responsavel['ufOC']]
67
+ ]
68
+ end.sum([]),
69
+ ['obsCompl', evento['infoExpRisco/obs/obsCompl']],
70
+ ['nrRecibo', numero_do_recibo]
71
+ ]
72
+ end
73
+ end
74
+ end
75
+ end
@@ -213,7 +213,7 @@ module Teodoro
213
213
  2 => por_iniciativa_do_empregador? && duracao_do_aviso_previo < 30,
214
214
  4 => %w[04 07 08 09].include?(motivo_do_desligamento),
215
215
  6 => motivo_do_desligamento == '33'
216
- }.find { _2 }&.first
216
+ }.find { |_, condicao| condicao }&.first
217
217
  end
218
218
 
219
219
  def por_iniciativa_do_empregador?
@@ -119,10 +119,12 @@ module Teodoro
119
119
  end
120
120
 
121
121
  def afastamento
122
- evento['infoTSVInicio/afastamento']&.then { Obj.new(
123
- data_de_inicio: _1['dtIniAfast'],
124
- codigo_do_motivo: _1['codMotAfast']
125
- ) }
122
+ evento['infoTSVInicio/afastamento']&.then do |afastamento|
123
+ Obj.new(
124
+ data_de_inicio: afastamento['dtIniAfast'],
125
+ codigo_do_motivo: afastamento['codMotAfast']
126
+ )
127
+ end
126
128
  end
127
129
 
128
130
  def dados_dos_arquivos_data # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
@@ -334,8 +336,10 @@ module Teodoro
334
336
 
335
337
  def condicao_de_ingresso_no_brasil_do_trabalhador
336
338
  @condicao_de_ingresso_no_brasil_do_trabalhador ||=
337
- evento['trabalhador/trabImig']&.then do
338
- Teodoro::LeiauteSimplificado::TrabalhadorImigrante.new(_1).condicao_de_ingresso_no_brasil_no_leiaute2
339
+ evento['trabalhador/trabImig']&.then do |imigrante|
340
+ Teodoro::LeiauteSimplificado::TrabalhadorImigrante
341
+ .new(imigrante)
342
+ .condicao_de_ingresso_no_brasil_no_leiaute2
339
343
  end
340
344
  end
341
345
 
@@ -1,3 +1,3 @@
1
1
  module Teodoro
2
- VERSION = '0.44.2'.freeze
2
+ VERSION = '0.45.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teodoro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.44.2
4
+ version: 0.45.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fortes Tecnologia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-04 00:00:00.000000000 Z
11
+ date: 2021-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -221,7 +221,10 @@ files:
221
221
  - lib/teodoro/leiaute/arquivo_s2200.rb
222
222
  - lib/teodoro/leiaute/arquivo_s2205.rb
223
223
  - lib/teodoro/leiaute/arquivo_s2206.rb
224
+ - lib/teodoro/leiaute/arquivo_s2210.rb
225
+ - lib/teodoro/leiaute/arquivo_s2220.rb
224
226
  - lib/teodoro/leiaute/arquivo_s2230.rb
227
+ - lib/teodoro/leiaute/arquivo_s2240.rb
225
228
  - lib/teodoro/leiaute/arquivo_s2250.rb
226
229
  - lib/teodoro/leiaute/arquivo_s2299.rb
227
230
  - lib/teodoro/leiaute/arquivo_s2300.rb