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
