teodoro 0.0.9 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/teodoro.rb +3 -9
- data/lib/teodoro/arquivo_de_evento.rb +22 -8
- data/lib/teodoro/arquivo_de_evento_de_tabela.rb +1 -11
- data/lib/teodoro/arquivo_de_evento_exceto_de_exclusao.rb +1 -7
- data/lib/teodoro/arquivo_de_evento_nao_periodico.rb +5 -18
- data/lib/teodoro/arquivo_de_evento_processador_de_arquivo_data.rb +30 -0
- data/lib/teodoro/arquivo_de_origem.rb +1 -1
- data/lib/teodoro/arquivo_xml.rb +49 -74
- data/lib/teodoro/console.rb +2 -6
- data/lib/teodoro/empresa.rb +74 -15
- data/lib/teodoro/leiaute.rb +24 -0
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1000.rb +7 -9
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1005.rb +4 -4
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1010.rb +3 -5
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1020.rb +4 -4
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1030.rb +4 -4
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1040.rb +2 -4
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1050.rb +4 -4
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s1070.rb +2 -4
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2190.rb +2 -2
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2200.rb +131 -22
- data/lib/teodoro/leiaute/arquivo_s2205.rb +254 -0
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2206.rb +18 -7
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2230.rb +56 -12
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2250.rb +25 -9
- data/lib/teodoro/leiaute/arquivo_s2299.rb +313 -0
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2300.rb +24 -5
- data/lib/teodoro/{leiaute_2_4_1 → leiaute}/arquivo_s2306.rb +27 -7
- data/lib/teodoro/leiaute/arquivo_s2399.rb +306 -0
- data/lib/teodoro/leiaute/arquivo_s3000.rb +41 -0
- data/lib/teodoro/obj.rb +5 -0
- metadata +24 -20
- data/lib/teodoro/leiaute_2_4_1.rb +0 -22
- data/lib/teodoro/leiaute_2_4_1/arquivo_s2205.rb +0 -157
- data/lib/teodoro/leiaute_2_4_1/arquivo_s3000.rb +0 -45
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'leiaute/arquivo_s1000'
|
2
|
+
require_relative 'leiaute/arquivo_s1005'
|
3
|
+
require_relative 'leiaute/arquivo_s1010'
|
4
|
+
require_relative 'leiaute/arquivo_s1020'
|
5
|
+
require_relative 'leiaute/arquivo_s1030'
|
6
|
+
require_relative 'leiaute/arquivo_s1040'
|
7
|
+
require_relative 'leiaute/arquivo_s1050'
|
8
|
+
require_relative 'leiaute/arquivo_s1070'
|
9
|
+
require_relative 'leiaute/arquivo_s2190'
|
10
|
+
require_relative 'leiaute/arquivo_s2200'
|
11
|
+
require_relative 'leiaute/arquivo_s2205'
|
12
|
+
require_relative 'leiaute/arquivo_s2206'
|
13
|
+
require_relative 'leiaute/arquivo_s2230'
|
14
|
+
require_relative 'leiaute/arquivo_s2250'
|
15
|
+
require_relative 'leiaute/arquivo_s2299'
|
16
|
+
require_relative 'leiaute/arquivo_s2300'
|
17
|
+
require_relative 'leiaute/arquivo_s2306'
|
18
|
+
require_relative 'leiaute/arquivo_s2399'
|
19
|
+
require_relative 'leiaute/arquivo_s3000'
|
20
|
+
|
21
|
+
module Teodoro
|
22
|
+
module Leiaute
|
23
|
+
end
|
24
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
3
|
-
# rubocop:disable Metrics/ClassLength
|
4
|
-
class ArquivoS1000
|
2
|
+
module Leiaute
|
3
|
+
class ArquivoS1000 # rubocop:disable Metrics/ClassLength
|
5
4
|
include ArquivoDeEventoDeTabela
|
6
5
|
|
7
6
|
private
|
@@ -64,9 +63,9 @@ module Teodoro
|
|
64
63
|
'idePeriodo'
|
65
64
|
end
|
66
65
|
|
67
|
-
# rubocop:disable
|
68
|
-
def itens_do_conteudo_do_arquivo_data
|
66
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
69
67
|
[
|
68
|
+
# rubocop:disable Layout/LineLength
|
70
69
|
['TipoInscricaoEmpregador', tipo_de_inscricao],
|
71
70
|
['FapBdContrib'],
|
72
71
|
['AlteracaoEmPeriodoExistente'],
|
@@ -84,8 +83,8 @@ module Teodoro
|
|
84
83
|
['ExibeModoCompleto'],
|
85
84
|
['InicioValidade', inicio_da_validade],
|
86
85
|
['FimValidade', fim_da_validade],
|
87
|
-
['NovaValidade_InicioValidade'],
|
88
|
-
['NovaValidade_FimValidade'],
|
86
|
+
['NovaValidade_InicioValidade'],
|
87
|
+
['NovaValidade_FimValidade'],
|
89
88
|
['NomeRazaoSocial', evento['evtInfoEmpregador/infoEmpregador/*/infoCadastro/nmRazao']],
|
90
89
|
['ClassificacaoTributaria', evento['evtInfoEmpregador/infoEmpregador/*/infoCadastro/classTrib']],
|
91
90
|
['NaturezaJuridica', evento['evtInfoEmpregador/infoEmpregador/*/infoCadastro/natJurid']],
|
@@ -150,14 +149,13 @@ module Teodoro
|
|
150
149
|
["ListaSoftHouses_#{seq}_Email", software_house['email']]
|
151
150
|
]
|
152
151
|
end.sum([])
|
152
|
+
# rubocop:enable Layout/LineLength
|
153
153
|
]
|
154
154
|
end
|
155
|
-
# rubocop:enable Layout/LineLength, Metrics/MethodLength, Metrics/AbcSize
|
156
155
|
|
157
156
|
def softwares_house
|
158
157
|
evento.*('evtInfoEmpregador/infoEmpregador/*/infoCadastro/softwareHouse')
|
159
158
|
end
|
160
159
|
end
|
161
|
-
# rubocop:enable Metrics/ClassLength
|
162
160
|
end
|
163
161
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS1005
|
4
4
|
include ArquivoDeEventoDeTabela
|
5
5
|
|
@@ -25,9 +25,9 @@ module Teodoro
|
|
25
25
|
'ideEstab'
|
26
26
|
end
|
27
27
|
|
28
|
-
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
29
|
-
def itens_do_conteudo_do_arquivo_data
|
28
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
30
29
|
[
|
30
|
+
# rubocop:disable Layout/LineLength
|
31
31
|
['RequestVerificationToken'],
|
32
32
|
['SomenteVisualizacao'],
|
33
33
|
['BloquearCodigo'],
|
@@ -75,9 +75,9 @@ module Teodoro
|
|
75
75
|
['VerProc', versao_do_aplicativo_de_processamento_do_evento],
|
76
76
|
['idEdicaoSH'],
|
77
77
|
['ExibirContribuicaoPatronal']
|
78
|
+
# rubocop:enable Layout/LineLength
|
78
79
|
]
|
79
80
|
end
|
80
|
-
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Layout/LineLength
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS1010
|
4
4
|
include ArquivoDeEventoDeTabela
|
5
5
|
|
@@ -18,7 +18,7 @@ module Teodoro
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def identificacao_do_arquivo_data
|
21
|
-
['RUB', "#{identificador_da_tabela_de_rubricas}
|
21
|
+
['RUB', "#{identificador_da_tabela_de_rubricas}#{codigo}"]
|
22
22
|
end
|
23
23
|
|
24
24
|
def identificador_da_tabela_de_rubricas
|
@@ -29,8 +29,7 @@ module Teodoro
|
|
29
29
|
@codigo ||= evento['evtTabRubrica/infoRubrica/*/ideRubrica/codRubr']
|
30
30
|
end
|
31
31
|
|
32
|
-
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
33
|
-
def itens_do_conteudo_do_arquivo_data
|
32
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
34
33
|
[
|
35
34
|
['RequestVerificationToken'],
|
36
35
|
['SomenteVisualizacao'],
|
@@ -59,7 +58,6 @@ module Teodoro
|
|
59
58
|
['hd_ProcessoSindicato']
|
60
59
|
]
|
61
60
|
end
|
62
|
-
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
63
61
|
end
|
64
62
|
end
|
65
63
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS1020
|
4
4
|
include ArquivoDeEventoDeTabela
|
5
5
|
|
@@ -25,9 +25,9 @@ module Teodoro
|
|
25
25
|
@codigo_da_lotacao_tributaria ||= evento['evtTabLotacao/infoLotacao/*/ideLotacao/codLotacao']
|
26
26
|
end
|
27
27
|
|
28
|
-
# rubocop:disable Metrics/MethodLength,
|
29
|
-
def itens_do_conteudo_do_arquivo_data
|
28
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
30
29
|
[
|
30
|
+
# rubocop:disable Layout/LineLength
|
31
31
|
['RequestVerificationToken'],
|
32
32
|
['SomenteVisualizacao'],
|
33
33
|
['BloquearCodigo'],
|
@@ -60,9 +60,9 @@ module Teodoro
|
|
60
60
|
['VerProc', versao_do_aplicativo_de_processamento_do_evento],
|
61
61
|
['idEdicaoProcesso'],
|
62
62
|
['ExibirContribuicaoPatronal']
|
63
|
+
# rubocop:enable Layout/LineLength
|
63
64
|
]
|
64
65
|
end
|
65
|
-
# rubocop:enable Metrics/MethodLength, Layout/LineLength, Metrics/AbcSize
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS1030
|
4
4
|
include ArquivoDeEventoDeTabela
|
5
5
|
|
@@ -25,9 +25,9 @@ module Teodoro
|
|
25
25
|
@codigo_do_cargo ||= evento['evtTabCargo/infoCargo/*/ideCargo/codCargo']
|
26
26
|
end
|
27
27
|
|
28
|
-
# rubocop:disable Metrics/MethodLength,
|
29
|
-
def itens_do_conteudo_do_arquivo_data
|
28
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
30
29
|
[
|
30
|
+
# rubocop:disable Layout/LineLength
|
31
31
|
['RequestVerificationToken'],
|
32
32
|
['SomenteVisualizacao'],
|
33
33
|
['BloquearCodigo'],
|
@@ -51,9 +51,9 @@ module Teodoro
|
|
51
51
|
['NrReciboEventoOriginal'],
|
52
52
|
['DescricaoProcEmi'],
|
53
53
|
['VerProc', versao_do_aplicativo_de_processamento_do_evento]
|
54
|
+
# rubocop:enable Layout/LineLength
|
54
55
|
]
|
55
56
|
end
|
56
|
-
# rubocop:enable Metrics/MethodLength, Layout/LineLength, Metrics/AbcSize
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS1040
|
4
4
|
include ArquivoDeEventoDeTabela
|
5
5
|
|
@@ -23,8 +23,7 @@ module Teodoro
|
|
23
23
|
@codigo_da_funcao ||= evento['evtTabFuncao/infoFuncao/*/ideFuncao/codFuncao']
|
24
24
|
end
|
25
25
|
|
26
|
-
# rubocop:disable Metrics/MethodLength
|
27
|
-
def itens_do_conteudo_do_arquivo_data
|
26
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength
|
28
27
|
[
|
29
28
|
['RequestVerificationToken'],
|
30
29
|
['SomenteVisualizacao'],
|
@@ -43,7 +42,6 @@ module Teodoro
|
|
43
42
|
['VerProc', versao_do_aplicativo_de_processamento_do_evento]
|
44
43
|
]
|
45
44
|
end
|
46
|
-
# rubocop:enable Metrics/MethodLength
|
47
45
|
end
|
48
46
|
end
|
49
47
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS1050
|
4
4
|
include ArquivoDeEventoDeTabela
|
5
5
|
|
@@ -25,9 +25,9 @@ module Teodoro
|
|
25
25
|
@codigo_do_horario ||= evento['evtTabHorTur/infoHorContratual/*/ideHorContratual/codHorContrat']
|
26
26
|
end
|
27
27
|
|
28
|
-
# rubocop:disable Metrics/MethodLength,
|
29
|
-
def itens_do_conteudo_do_arquivo_data
|
28
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
30
29
|
[
|
30
|
+
# rubocop:disable Layout/LineLength
|
31
31
|
['RequestVerificationToken'],
|
32
32
|
['SomenteVisualizacao'],
|
33
33
|
['BloquearCodigo'],
|
@@ -60,9 +60,9 @@ module Teodoro
|
|
60
60
|
["DadosHorario_ListaHorarioIntervalo_#{seq}_DuracaoIntervalo", intervalo['durInterv']]
|
61
61
|
]
|
62
62
|
end.sum([])
|
63
|
+
# rubocop:enable Layout/LineLength
|
63
64
|
]
|
64
65
|
end
|
65
|
-
# rubocop:enable Metrics/MethodLength, Layout/LineLength, Metrics/AbcSize
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS1070
|
4
4
|
include ArquivoDeEventoDeTabela
|
5
5
|
|
@@ -25,8 +25,7 @@ module Teodoro
|
|
25
25
|
@numero_do_processo ||= evento['evtTabProcesso/infoProcesso/*/ideProcesso/nrProc']
|
26
26
|
end
|
27
27
|
|
28
|
-
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
29
|
-
def itens_do_conteudo_do_arquivo_data
|
28
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
30
29
|
[
|
31
30
|
['RequestVerificationToken'],
|
32
31
|
['SomenteVisualizacao'],
|
@@ -69,7 +68,6 @@ module Teodoro
|
|
69
68
|
end.sum([])
|
70
69
|
]
|
71
70
|
end
|
72
|
-
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
73
71
|
end
|
74
72
|
end
|
75
73
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS2190
|
4
4
|
include ArquivoDeEventoNaoPeriodico
|
5
5
|
|
@@ -8,7 +8,7 @@ module Teodoro
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def nome_do_arquivo_data
|
11
|
-
"PRE[#{cpf_do_trabalhador}]"
|
11
|
+
@nome_do_arquivo_data ||= "PRE[#{cpf_do_trabalhador}]"
|
12
12
|
end
|
13
13
|
|
14
14
|
def cpf_do_trabalhador
|
@@ -1,10 +1,37 @@
|
|
1
1
|
module Teodoro
|
2
|
-
module
|
2
|
+
module Leiaute
|
3
3
|
class ArquivoS2200 # rubocop:disable Metrics/ClassLength
|
4
4
|
include ArquivoDeEventoNaoPeriodico
|
5
5
|
|
6
|
+
def processar
|
7
|
+
super
|
8
|
+
|
9
|
+
registrar_admissao
|
10
|
+
end
|
11
|
+
|
6
12
|
private
|
7
13
|
|
14
|
+
def registrar_admissao
|
15
|
+
contratos_de_emprego[matricula_do_trabalhador] = Obj.new(
|
16
|
+
matricula: matricula_do_trabalhador,
|
17
|
+
data_de_admissao: data_de_admissao,
|
18
|
+
categoria_do_trabalhador: categoria_do_trabalhador,
|
19
|
+
cpf_do_trabalhador: cpf_do_trabalhador
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
def contratos_de_emprego
|
24
|
+
empresa.contratos_de_emprego
|
25
|
+
end
|
26
|
+
|
27
|
+
def data_de_admissao
|
28
|
+
@data_de_admissao ||= evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/dtAdm']
|
29
|
+
end
|
30
|
+
|
31
|
+
def categoria_do_trabalhador
|
32
|
+
@categoria_do_trabalhador ||= evento['evtAdmissao/vinculo/infoContrato/codCateg']
|
33
|
+
end
|
34
|
+
|
8
35
|
def noh_principal_do_evento
|
9
36
|
'evtAdmissao'
|
10
37
|
end
|
@@ -22,13 +49,9 @@ module Teodoro
|
|
22
49
|
@matricula_do_trabalhador ||= evento['evtAdmissao/vinculo/matricula']
|
23
50
|
end
|
24
51
|
|
25
|
-
def
|
26
|
-
@data_de_admissao ||= evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/dtAdm']
|
27
|
-
end
|
28
|
-
|
29
|
-
# rubocop:disable Metrics/MethodLength, Layout/LineLength, Metrics/AbcSize
|
30
|
-
def itens_do_conteudo_do_arquivo_data
|
52
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
31
53
|
[
|
54
|
+
# rubocop:disable Layout/LineLength
|
32
55
|
['ESX_CPF', cpf_do_trabalhador],
|
33
56
|
['ESX_MATRICULA', matricula_do_trabalhador],
|
34
57
|
['ESX_CATEGORIA', categoria_do_trabalhador],
|
@@ -39,7 +62,7 @@ module Teodoro
|
|
39
62
|
['NrReciboEventoOriginal'],
|
40
63
|
['EventoAdmissao_TipoEventoEnviado'],
|
41
64
|
['TipoInscricaoEmpregador', tipo_de_inscricao_do_empregador],
|
42
|
-
['EventoAdmissao_NrRecibo',
|
65
|
+
['EventoAdmissao_NrRecibo', numero_do_recibo],
|
43
66
|
['EventoAdmissao_DataAlteracaoCadastral'],
|
44
67
|
['EventoAdmissao_InformacoesInicio_IndicativoCadastramentoInicial', evento['evtAdmissao/vinculo/cadIni']],
|
45
68
|
['EventoAdmissao_InformacoesInicio_DataInicio'],
|
@@ -137,7 +160,7 @@ module Teodoro
|
|
137
160
|
['EventoAdmissao_EnderecoResidencialEX_PaisResidencia_TEXT'],
|
138
161
|
['SemNumeroLogradouroEnderecoEX'],
|
139
162
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_CasadoComBrasileiro', evento['evtAdmissao/trabalhador/trabEstrangeiro/casadoBr']],
|
140
|
-
|
163
|
+
item_do_conteudo_do_arquivo_data('EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_ClassificacaoCondicao'),
|
141
164
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_ClassificacaoCondicao_TEXT'],
|
142
165
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_DataChegada', evento['evtAdmissao/trabalhador/trabEstrangeiro/dtChegada']],
|
143
166
|
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_FilhosBrasileiros', evento['evtAdmissao/trabalhador/trabEstrangeiro/filhosBr']],
|
@@ -230,19 +253,19 @@ module Teodoro
|
|
230
253
|
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoGeral_DescricaoComplementar', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabGeral/descComp']],
|
231
254
|
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoGeral_NumeroInscricao', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabGeral/nrInsc']],
|
232
255
|
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoGeral_TipoInscricao', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabGeral/tpInsc']],
|
233
|
-
|
234
|
-
|
256
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Uf'),
|
257
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_TipoLogradouro'),
|
235
258
|
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_TipoLogradouro_TEXT'],
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
259
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_NumeroLogradouro'),
|
260
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_DescricaoLogradouro'),
|
261
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Complemento'),
|
262
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_CodigoMunicipio'),
|
263
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Cep'),
|
264
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Bairro'),
|
242
265
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_NumeroInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideTomadorServ/nrInsc']],
|
243
266
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_TipoInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideTomadorServ/tpInsc']],
|
244
|
-
|
245
|
-
|
267
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_NumeroInscricao'),
|
268
|
+
item_do_conteudo_do_arquivo_data('InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_TipoInscricao'),
|
246
269
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_HipoteseLegal', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/hipLeg']],
|
247
270
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_JustificaHipoteseLegal', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/justContr']],
|
248
271
|
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_TipoInclusaoContrato', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/tpInclContr']],
|
@@ -288,12 +311,98 @@ module Teodoro
|
|
288
311
|
["InfoVinculo_InfoContrato_FiliacaoSindical_#{seq}_CnpjSindicatoTrabalhador", filiacao['cnpjSindTrab']]
|
289
312
|
]
|
290
313
|
end.sum([])
|
314
|
+
# rubocop:enable Layout/LineLength
|
291
315
|
]
|
292
316
|
end
|
293
|
-
# rubocop:enable Metrics/MethodLength, Layout/LineLength, Metrics/AbcSize
|
294
317
|
|
295
|
-
def
|
296
|
-
|
318
|
+
def item_do_conteudo_do_arquivo_data(chave)
|
319
|
+
chaves_valores_de_acordo_com_a_versao_do_leiaute[chave]
|
320
|
+
end
|
321
|
+
|
322
|
+
def chaves_valores_de_acordo_com_a_versao_do_leiaute
|
323
|
+
@chaves_valores_de_acordo_com_a_versao_do_leiaute ||=
|
324
|
+
(leiaute_simplificado? ? ChavesValoresDoLeiauteSimplificado : ChavesValoresDoLeiaute2).new(evento)
|
325
|
+
end
|
326
|
+
|
327
|
+
module ChavesValores
|
328
|
+
private
|
329
|
+
|
330
|
+
def initialize(evento)
|
331
|
+
@evento = evento
|
332
|
+
end
|
333
|
+
|
334
|
+
attr_reader :evento
|
335
|
+
|
336
|
+
public
|
337
|
+
|
338
|
+
def [](chave)
|
339
|
+
de_chave_para_chave_valor[chave]
|
340
|
+
end
|
341
|
+
|
342
|
+
private
|
343
|
+
|
344
|
+
def de_chave_para_chave_valor
|
345
|
+
@de_chave_para_chave_valor ||=
|
346
|
+
itens_do_conteudo_do_arquivo_data.map { |chave, valor| [chave, [chave, valor]] }.to_h
|
347
|
+
end
|
348
|
+
end
|
349
|
+
|
350
|
+
class ChavesValoresDoLeiaute2
|
351
|
+
include ChavesValores
|
352
|
+
|
353
|
+
private
|
354
|
+
|
355
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
356
|
+
[
|
357
|
+
# rubocop:disable Layout/LineLength
|
358
|
+
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_ClassificacaoCondicao', evento['evtAdmissao/trabalhador/trabEstrangeiro/classTrabEstrang']],
|
359
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Uf', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/uf']],
|
360
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_TipoLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/tpLograd']],
|
361
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_NumeroLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/nrLograd']],
|
362
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_DescricaoLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/dscLograd']],
|
363
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Complemento', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/complemento']],
|
364
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_CodigoMunicipio', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/codMunic']],
|
365
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Cep', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/cep']],
|
366
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Bairro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTrabDom/bairro']],
|
367
|
+
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_NumeroInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideTomadorServ/ideEstabVinc/nrInsc']],
|
368
|
+
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_TipoInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideTomadorServ/ideEstabVinc/tpInsc']]
|
369
|
+
# rubocop:enable Layout/LineLength
|
370
|
+
]
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
class ChavesValoresDoLeiauteSimplificado
|
375
|
+
include ChavesValores
|
376
|
+
|
377
|
+
private
|
378
|
+
|
379
|
+
def itens_do_conteudo_do_arquivo_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
380
|
+
[
|
381
|
+
# rubocop:disable Layout/LineLength
|
382
|
+
['EventoAdmissao_InfoTrabalhador_TrabalhadorEstrangeiro_ClassificacaoCondicao', condicao_de_ingresso_do_trabalhador_imigrante],
|
383
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Uf', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/uf']],
|
384
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_TipoLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/tpLograd']],
|
385
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_NumeroLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/nrLograd']],
|
386
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_DescricaoLogradouro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/dscLograd']],
|
387
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Complemento', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/complemento']],
|
388
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_CodigoMunicipio', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/codMunic']],
|
389
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Cep', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/cep']],
|
390
|
+
['InfoVinculo_InfoContrato_LocalTrabalho_LocalTrabalhoDomestico_Bairro', evento['evtAdmissao/vinculo/infoContrato/localTrabalho/localTempDom/bairro']],
|
391
|
+
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_NumeroInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideEstabVinc/nrInsc']],
|
392
|
+
['InfoVinculo_InformacoesRegimeTrabalhista_InformacoesTrabalhadorCeletista_TrabalhoTemporario_EmpresaContratante_EstabelecimentoVinculadoTemporario_TipoInscricao', evento['evtAdmissao/vinculo/infoRegimeTrab/infoCeletista/trabTemporario/ideEstabVinc/tpInsc']]
|
393
|
+
# rubocop:enable Layout/LineLength
|
394
|
+
]
|
395
|
+
end
|
396
|
+
|
397
|
+
def condicao_de_ingresso_do_trabalhador_imigrante
|
398
|
+
{
|
399
|
+
'1' => 4,
|
400
|
+
'2' => 5,
|
401
|
+
'4' => 10,
|
402
|
+
'5' => 11,
|
403
|
+
'6' => 12
|
404
|
+
}[evento['evtAdmissao/trabalhador/trabImig/condIng']] || evento['evtAdmissao/trabalhador/trabImig/tmpResid']
|
405
|
+
end
|
297
406
|
end
|
298
407
|
end
|
299
408
|
end
|