Prod build process

This commit is contained in:
Jason Jordan
2026-05-06 13:28:16 -04:00
parent 1d9025276d
commit e0101be567
223 changed files with 1861 additions and 7105 deletions
@@ -18,41 +18,14 @@ module IdCardPrinterService
template_groups = break_up_by_template(pl_plan_keys)
template_groups.each do |card_template, template_pl_plan_keys|
batch = IdCard::PrintData.where(pl_plan_key: template_pl_plan_keys)
# all_template_cards.in_batches(of: 75).each_with_index do |batch, index|
jasper_batch_id = "#{template_pl_plan_keys.join('_')}-#{Time.current.utc.to_i}"
# binding.pry
batch.update!(jasper_batch_id: jasper_batch_id)
if @layout == "PrintCard"
add_dependent_cards(batch)
end
batch_pdf = IdCardPrinterService::PdfBatchProcessor.new(card_template, jasper_batch_id, @layout).call
pdf_array << batch_pdf
# end
# jasper_batches = break_into_jasper_batches(group_pl_plan_keys)
# jasper_batches.each_with_index do |batch, index|
# jasper_batch_id = "#{group_pl_plan_keys.join('_')}-#{index + 1}-#{Time.current.utc.to_i}"
# binding.pry
# batch.update!(jasper_batch_id: jasper_batch_id)
# if @layout == "PrintCard"
# add_dependent_cards(batch)
# end
# batch_pdf = IdCardPrinterService::PdfBatchProcessor.new(card_template, jasper_batch_id, @layout).call
# pdf_array << batch_pdf
# end
jasper_batch_id = "#{template_pl_plan_keys.join('_')}-#{Time.current.utc.to_i}"
batch.update!(jasper_batch_id: jasper_batch_id)
if @layout == "PrintCard"
add_dependent_cards(batch)
end
batch_pdf = IdCardPrinterService::PdfBatchProcessor.new(card_template, jasper_batch_id, @layout).call
pdf_array << batch_pdf
end
# @employers_member_keys.each do |emk|
# employer_jasper_batches = IdCard::PrintData.where(pl_plan_key: emk[:pl_plan_key]).pluck(:network_logo_id).uniq
# employer_jasper_batches.each do |batch_network_logo|
# jasper_batch_id = "#{emk[:pl_plan_key]}-#{Time.current.utc.to_i}"
# batch = IdCard::PrintData.where(pl_plan_key: emk[:pl_plan_key], network_logo_id: batch_network_logo)
# # batch = employer_card_data.where(network_logo_id: batch_network_logo)
# batch.update!(jasper_batch_id: jasper_batch_id)
# batch_pdf = IdCardPrinterService::PdfBatchProcessor.new(emk[:pl_plan_key], batch_network_logo, jasper_batch_id, @layout).call
# pdf_array << batch_pdf
# end
# end
group_pdfs = combine_pdfs(pdf_array)
group_pdfs
@@ -67,13 +40,6 @@ module IdCardPrinterService
.compact_blank
end
def break_into_jasper_batches(pl_plan_keys)
all_cards = IdCard::PrintData.where(pl_plan_key: pl_plan_keys)
binding.pry
jasper_batches = all_cards.each_slice(75).to_a
jasper_batches
end
def add_dependent_cards(batch)
batch.where.not(dependent_1: [nil, ""]).find_each do |member_card|
dependent_card = member_card.dup