Its been a while

This commit is contained in:
Jason Jordan
2026-07-23 10:32:51 -04:00
parent 5a90ea6e14
commit 56009fa158
70 changed files with 686 additions and 147 deletions
@@ -57,22 +57,24 @@ module IdCardPrinterService
)
selected_attributes = employer_attributes.merge(rx_attributes).merge(provider_attributes)
IdCard::PrintData.new(selected_attributes)
IdCard::PrintData.create(selected_attributes)
end
def create_plan_base_cards(common_fields_card)
needed_plans_ids = @employer.members.where(pb_entity_key: @member_keys).distinct.pluck(:id_card_plan_id)
needed_plans = @card_setup.plans.where(id: needed_plans_ids)
needed_plans.each do |plan|
selected_attributes = { plan_id: plan.id }
plan.plan_benefits.each do |bene|
selected_attributes["benefit_desc_#{bene.sequence}".to_sym] = bene.benefit_desc
selected_attributes["benefit_#{bene.sequence}".to_sym] = bene.benefit
end
if needed_plans_ids.present?
needed_plans = @card_setup.plans.where(id: needed_plans_ids)
needed_plans.each do |plan|
selected_attributes = { plan_id: plan.id }
plan.plan_benefits.each do |bene|
selected_attributes["benefit_desc_#{bene.sequence}".to_sym] = bene.benefit_desc
selected_attributes["benefit_#{bene.sequence}".to_sym] = bene.benefit
end
plan_base_card = common_fields_card.dup
plan_base_card.assign_attributes(selected_attributes)
plan_base_card.save
plan_base_card = common_fields_card.dup
plan_base_card.assign_attributes(selected_attributes)
plan_base_card.save
end
end
end