Class: LighthouseGeneratePdfProvider

Inherits:
Object
  • Object
show all
Includes:
GeneratePdfProvider
Defined in:
lib/disability_compensation/providers/generate_pdf/lighthouse_generate_pdf_provider.rb

Instance Method Summary collapse

Methods included from GeneratePdfProvider

generate_526_pdf

Constructor Details

#initialize(icn) ⇒ LighthouseGeneratePdfProvider

Returns a new instance of LighthouseGeneratePdfProvider.



8
9
10
# File 'lib/disability_compensation/providers/generate_pdf/lighthouse_generate_pdf_provider.rb', line 8

def initialize(icn)
  @icn = icn
end

Instance Method Details

#generate_526_pdf(form_content, transaction_id) ⇒ Object



12
13
14
15
# File 'lib/disability_compensation/providers/generate_pdf/lighthouse_generate_pdf_provider.rb', line 12

def generate_526_pdf(form_content, transaction_id)
  body = transform_service.transform(JSON.parse(form_content))
  service.submit526(body, nil, nil, { generate_pdf: true, transaction_id: })
end

#serviceObject



21
22
23
# File 'lib/disability_compensation/providers/generate_pdf/lighthouse_generate_pdf_provider.rb', line 21

def service
  @service ||= BenefitsClaims::Service.new(@icn)
end

#transform_serviceObject



17
18
19
# File 'lib/disability_compensation/providers/generate_pdf/lighthouse_generate_pdf_provider.rb', line 17

def transform_service
  @transform_service ||= EVSS::DisabilityCompensationForm::Form526ToLighthouseTransform.new
end