DB restructure, print page
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
module IdCard
|
||||
class PrinterController < ApplicationController
|
||||
|
||||
# View Methods
|
||||
def index
|
||||
@employer_configurations = IdCard::Configuration.active.to_a.sort_by { |config| config.pl_plan_key.to_i }
|
||||
add_queued_count_to_card_configuration
|
||||
render :index
|
||||
end
|
||||
|
||||
# API Methods
|
||||
|
||||
private
|
||||
|
||||
|
||||
def add_queued_count_to_card_configuration
|
||||
@queue_counts = EmployerCards::QueueCounter.new().call
|
||||
@queue_counts.each do |qc|
|
||||
match = @employer_configurations.find { |configuration| configuration.pl_plan_key == qc["PLPlanKey"] }
|
||||
if match.present?
|
||||
match.queued_card_count = qc["QueuedCardsCount"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user