Class: Teodoro::Leiaute::ArquivoS2200::LeiauteSimplificado

Inherits:
Object
  • Object
show all
Includes:
Leiaute
Defined in:
lib/teodoro/leiaute/arquivo_s2200.rb

Instance Method Summary collapse

Methods included from Leiaute

#[]

Instance Method Details

#categoria_do_trabalhadorObject



414
415
416
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 414

def categoria_do_trabalhador
  evento['vinculo/infoContrato/codCateg']
end

#condicao_de_ingresso_no_brasil_do_trabalhadorObject



390
391
392
393
394
395
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 390

def condicao_de_ingresso_no_brasil_do_trabalhador
  @condicao_de_ingresso_no_brasil_do_trabalhador ||=
    evento['trabalhador/trabImig']&.then do
      Teodoro::LeiauteSimplificado::TrabalhadorImigrante.new(_1).condicao_de_ingresso_no_brasil_no_leiaute2
    end
end

#data_de_admissaoObject



406
407
408
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 406

def data_de_admissao
  evento['vinculo/infoRegimeTrab/infoCeletista/dtAdm']
end

#data_de_opcao_pelo_fgtsObject



418
419
420
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 418

def data_de_opcao_pelo_fgts
  @data_de_opcao_pelo_fgts ||= evento['vinculo/infoRegimeTrab/infoCeletista/FGTS/dtOpcFGTS']
end

#empregado_domestico?Boolean



410
411
412
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 410

def empregado_domestico?
  categoria_do_trabalhador == '104'
end

#opcao_pelo_fgtsObject



397
398
399
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 397

def opcao_pelo_fgts
  @opcao_pelo_fgts ||= optante_pelo_fgts? ? 1 : 2
end

#optante_pelo_fgts?Boolean



401
402
403
404
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 401

def optante_pelo_fgts?
  data_de_admissao >= (empregado_domestico? ? '2015-10-01' : '1988-10-05') ||
    evento['vinculo/infoRegimeTrab/infoCeletista/FGTS']
end