Files
baclight/app/services/sample_card_generator_local.rb
Jason Jordan 4fac3b1036
CI / scan_ruby (push) Failing after 10m41s
CI / lint (push) Failing after 7m31s
CI / test (push) Failing after 8m29s
Docker / build-and-test-image (push) Failing after 11m32s
Employers working - onboarding to card print
2026-01-15 11:37:50 -05:00

27 lines
739 B
Ruby

class SampleCardGeneratorLocal
def initialize(process)
@process = process
end
def call
# SampleCard::DataFormatter.new(@process).call
group_sample_cards_pdf = CombinePDF.new
SampleIdCard.where(employer_name: @process.employer_name).each do |card|
url = SampleCard::JasperUrlGenerator.new(@process, card.family_id).call
puts url
card_pdf = SampleCard::JasperPdfGenerator.new(url).call
group_sample_cards_pdf << card_pdf
end
todays_date = DateTime.current.strftime('%Y%m%d%H%M%S')
group_sample_cards_pdf.save("tmp/#{@process.employer_name}_sample_cards_#{todays_date}.pdf")
group_sample_cards_pdf
end
end