Files
baclight/app/services/sample_card_generator.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

24 lines
632 B
Ruby

class SampleCardGenerator
def initialize(employer)
@employer = employer
end
def call
SampleIdCard.where(employer_name: @employer.name).destroy_all
SampleCard::DataFormatter.new(@employer).call
group_sample_cards_pdf = CombinePDF.new
SampleIdCard.where(employer_name: @employer.name).each do |card|
url = SampleCard::JasperUrlGenerator.new(@employer, card.family_id).call
puts url
card_pdf = SampleCard::JasperPdfGenerator.new(url).call
group_sample_cards_pdf << card_pdf
end
group_sample_cards_pdf
end
end