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
@@ -0,0 +1,39 @@
module Api
module V1
class WebIdCardsController < ApplicationController
def member_card
pb_entity_key = params[:id]
layout = params[:layout]
member = Member.find_by(pb_entity_key: pb_entity_key)
if member.present?
member_card = IdCardPrinterService::CardsGenerator.new(member.member_key, layout).call
send_data member_card.to_pdf,
filename: "#{member.name.gsub(", ", "_")}_digital_card_#{Date.today}.pdf",
type: "application/pdf",
disposition: 'inline'
else
render json: { error: "Member not found" }, status: :not_found
end
end
def employer_cards
pl_plan_key = params[:id]
employer = Employer.find_by(pl_plan_key: pl_plan_key)
if employer.present?
employer_cards = IdCardPrinterService::CardsGenerator.new(employer.employer_member_keys, "FullPageCard", true).call
employer_cards.rewind
send_data employer_cards.sysread,
filename: "#{employer.name.parameterize(separator: "_")}_full_page_cards_#{Date.today}.zip",
type: 'application/zip',
disposition: 'inline'
else
render json: { error: "Employer not found" }, status: :not_found
end
end
end
end
end