working on data printer

This commit is contained in:
Jason Jordan
2026-03-16 12:09:45 -04:00
parent 8c885b3e76
commit 011ee91707
26 changed files with 357 additions and 214 deletions
@@ -6,9 +6,9 @@ module IdCard
def edit
@employer = Employer.find_by(slug: params[:employer_id])
if @employer.id_card_enabled?
@setup = @employer.id_card_setup
@setup = @employer.id_card_configuration
else
@setup = @employer.create_id_card_setup
@setup = @employer.create_id_card_configuration
end
render :edit
end
@@ -39,10 +39,10 @@ module IdCard
end
def update_general
if params[:id_card_setup]["provider_section_id"].include?("new|")
if params[:id_card_configuration]["provider_section_id"].include?("new|")
new_provider_section_params = IdCard::ProviderSection.permitted_params(params)
new_provider_section = IdCard::ProviderSection.create(new_provider_section_params)
params[:id_card_setup]["provider_section_id"] = new_provider_section.id
params[:id_card_configuration]["provider_section_id"] = new_provider_section.id
end
general_params = IdCard::Configuration.permitted_params(params)
if @setup.update(general_params)
@@ -99,10 +99,10 @@ module IdCard
def set_employer_and_setup
@employer = Employer.find_by(slug: params[:employer_id])
if @employer.id_card_setup.present?
@setup = @employer.id_card_setup
if @employer.id_card_configuration.present?
@setup = @employer.id_card_configuration
else
@setup = @employer.create_id_card_setup
@setup = @employer.create_id_card_configuration
end
end
@@ -10,11 +10,16 @@ module IdCard
# API Methods
def print_queued
@queue_counts = EmployerCards::GetQueuedCards.new().call
end
private
def add_queued_count_to_card_configuration
@queue_counts = EmployerCards::QueueCounter.new().call
@queue_counts = EmployerCards::GetQueuedCounts.new().call
@queue_counts.each do |qc|
match = @employer_configurations.find { |configuration| configuration.pl_plan_key == qc["PLPlanKey"] }
if match.present?