diff --git a/.gitignore b/.gitignore index 6d20035..72f5b65 100644 --- a/.gitignore +++ b/.gitignore @@ -77,4 +77,6 @@ yarn-debug.log* /app/assets/svg/* !/app/assets/builds/.keep -/mssql-data \ No newline at end of file +/mssql-data +/logo_files +/employer_word_docs \ No newline at end of file diff --git a/app/controllers/employer_setup_controller.rb b/app/controllers/employer_setup_controller.rb index 0590d95..bf87de2 100644 --- a/app/controllers/employer_setup_controller.rb +++ b/app/controllers/employer_setup_controller.rb @@ -18,7 +18,7 @@ class EmployerSetupController < ApplicationController word_doc = params[:employer_setup_process][:import_from_word] @plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK") if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile) - @employer_setup = BenefitsWordDocProcessor.new(word_doc.tempfile).call + @employer_setup = WordDocProcessor.new(word_doc.tempfile).call render :edit else @employer_setup = EmployerSetupProcess.new diff --git a/app/controllers/employers_controller.rb b/app/controllers/employers_controller.rb index 8e43398..3cf17cf 100644 --- a/app/controllers/employers_controller.rb +++ b/app/controllers/employers_controller.rb @@ -18,7 +18,7 @@ class EmployersController < ApplicationController # word_doc = params[:employer][:import_from_word] # @plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK") # if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile) - # @employer = BenefitsWordDocProcessor.new(word_doc.tempfile).call + # @employer = WordDocProcessor.new(word_doc.tempfile).call # else # @employer = Employer.new # @employer.build_plan_with_default_benefits @@ -72,7 +72,7 @@ class EmployersController < ApplicationController def import word_doc = params[:employer][:import_from_word] if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile) - @employer = BenefitsWordDocProcessor.new(word_doc.tempfile).call + @employer = WordDocProcessor.new(word_doc.tempfile).call @employer.save redirect_to employer_path(@employer.slug), notice: 'Employer Imported' else diff --git a/app/controllers/id_card/print_controller.rb b/app/controllers/id_card/print_controller.rb index 93819e1..4ef93e4 100644 --- a/app/controllers/id_card/print_controller.rb +++ b/app/controllers/id_card/print_controller.rb @@ -3,19 +3,19 @@ module IdCard # View Methods def index - @employer_configs = IdCard::Configuration.active.to_a - @queue_counts = EmployerCards::GetQueuedCounts.new().call - add_queued_count_to_card_configuration - @queued = @employer_configs.select { |config| config.queued_card_count > 0 }.sort_by { |config| config.pl_plan_key.to_i } - @not_queued = @employer_configs.select { |config| config.queued_card_count == 0 }.sort_by { |config| config.pl_plan_key.to_i } + @employer_setups = IdCard::Setup.active.to_a + @queue_counts = IdCardQueueService::GetQueuedCounts.new().call + add_queued_count_to_card_setup + @queued = @employer_setups.select { |setup| setup.queued_card_count > 0 }.sort_by { |setup| setup.pl_plan_key.to_i } + @not_queued = @employer_setups.select { |setup| setup.queued_card_count == 0 }.sort_by { |setup| setup.pl_plan_key.to_i } render :index end # API Methods def print_all_queued - @queue_members = EmployerCards::GetQueuedCards.new().call - cards_pdf = IdCardPrinter::QueuedCardsGenerator.new(@queue_members).call + @queue_members = IdCardQueueService::GetQueuedCards.new().call + cards_pdf = IdCardPrinterService::QueuedCardsGenerator.new(@queue_members).call if cards_pdf.is_a?(CombinePDF::PDF) send_data cards_pdf.to_pdf, @@ -35,8 +35,8 @@ module IdCard def print_queued_by_employer pl_plan_key = params[:id].to_s @employer = Employer.find_by(pl_plan_key: pl_plan_key) - @queue_members = EmployerCards::GetQueuedCards.new(pl_plan_key).call - cards_pdf = IdCardPrinter::QueuedCardsGenerator.new(@queue_members).call + @queue_members = IdCardQueueService::GetQueuedCards.new(pl_plan_key).call + cards_pdf = IdCardPrinterService::QueuedCardsGenerator.new(@queue_members).call send_data cards_pdf.to_pdf, filename: "#{@employer.name.parameterize(separator: "_")}_queued_cards_#{Date.today}.pdf", @@ -46,9 +46,14 @@ module IdCard end def generate_sample - pl_plan_key = params[:id].to_s - @employer = Employer.find_by(pl_plan_key: pl_plan_key) - sample_cards_pdf = IdCardPrinter::SampleCardsGenerator.new(@employer).call + if Integer(params[:id], exception: false).is_a?(Integer) + pl_plan_key = params[:id].to_s + @employer = Employer.find_by(pl_plan_key: pl_plan_key) + else + slug = params[:id] + @employer = Employer.find_by(slug: slug) + end + sample_cards_pdf = IdCardPrinterService::SampleCardsGenerator.new(@employer).call send_data sample_cards_pdf.to_pdf, filename: "#{@employer.name.parameterize(separator: "_")}_sample_cards_#{Date.today}.pdf", @@ -58,9 +63,14 @@ module IdCard end def generate_print - pl_plan_key = params[:id].to_s - @employer = Employer.find_by(pl_plan_key: pl_plan_key) - cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "PrintCard").call + if Integer(params[:id], exception: false).is_a?(Integer) + pl_plan_key = params[:id].to_s + @employer = Employer.find_by(pl_plan_key: pl_plan_key) + else + slug = params[:id] + @employer = Employer.find_by(slug: slug) + end + cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "PrintCard").call send_data cards_pdf.to_pdf, filename: "#{@employer.name.parameterize(separator: "_")}_print_cards_#{Date.today}.pdf", @@ -70,9 +80,14 @@ module IdCard end def generate_mobile_display - pl_plan_key = params[:id].to_s - @employer = Employer.find_by(pl_plan_key: pl_plan_key) - cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call + if Integer(params[:id], exception: false).is_a?(Integer) + pl_plan_key = params[:id].to_s + @employer = Employer.find_by(pl_plan_key: pl_plan_key) + else + slug = params[:id] + @employer = Employer.find_by(slug: slug) + end + cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call send_data cards_pdf.to_pdf, filename: "#{@employer.name.parameterize(separator: "_")}_mobile_display_cards_#{Date.today}.pdf", @@ -82,9 +97,14 @@ module IdCard end def generate_full_page - pl_plan_key = params[:id].to_s - @employer = Employer.find_by(pl_plan_key: pl_plan_key) - cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call + if Integer(params[:id], exception: false).is_a?(Integer) + pl_plan_key = params[:id].to_s + @employer = Employer.find_by(pl_plan_key: pl_plan_key) + else + slug = params[:id] + @employer = Employer.find_by(slug: slug) + end + cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call cards_pdf.rewind send_data cards_pdf.sysread, @@ -97,9 +117,9 @@ module IdCard private - def add_queued_count_to_card_configuration + def add_queued_count_to_card_setup @queue_counts.each do |qc| - match = @employer_configs.find { |config| config.pl_plan_key == qc["PLPlanKey"] } + match = @employer_setups.find { |setup| setup.pl_plan_key == qc["PLPlanKey"] } if match.present? match.queued_card_count = qc["QueuedCardsCount"] end diff --git a/app/controllers/id_card/print_data_controller.rb b/app/controllers/id_card/print_data_controller.rb index 3f236ec..d2d384b 100644 --- a/app/controllers/id_card/print_data_controller.rb +++ b/app/controllers/id_card/print_data_controller.rb @@ -3,7 +3,7 @@ module IdCard def generate_sample @employer = Employer.find_by(slug: params[:employer_slug]) - sample_cards_pdf = IdCardPrinter::SampleCardsGenerator.new(@employer).call + sample_cards_pdf = IdCardPrinterService::SampleCardsGenerator.new(@employer).call send_data sample_cards_pdf.to_pdf, filename: "#{@employer.name.parameterize(separator: "_")}_sample_cards_#{Date.today}.pdf", @@ -14,7 +14,7 @@ module IdCard def generate_print @employer = Employer.find_by(slug: params[:employer_slug]) - cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "PrintCard").call + cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "PrintCard").call send_data cards_pdf.to_pdf, filename: "#{@employer.name.parameterize(separator: "_")}_print_cards_#{Date.today}.pdf", @@ -25,7 +25,7 @@ module IdCard def generate_mobile_display @employer = Employer.find_by(slug: params[:employer_slug]) - cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call + cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call send_data cards_pdf.to_pdf, filename: "#{@employer.name.parameterize(separator: "_")}_mobile_display_cards_#{Date.today}.pdf", @@ -36,7 +36,7 @@ module IdCard def generate_full_page @employer = Employer.find_by(slug: params[:employer_slug]) - cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call + cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call cards_pdf.rewind send_data cards_pdf.sysread, diff --git a/app/controllers/id_card/configuration_controller.rb b/app/controllers/id_card/setup_controller.rb similarity index 79% rename from app/controllers/id_card/configuration_controller.rb rename to app/controllers/id_card/setup_controller.rb index fe02d6b..92278df 100644 --- a/app/controllers/id_card/configuration_controller.rb +++ b/app/controllers/id_card/setup_controller.rb @@ -1,56 +1,56 @@ module IdCard - class ConfigurationController < ApplicationController + class SetupController < ApplicationController before_action :set_employer_and_setup # View Methods - def edit - @employer = Employer.find_by(slug: params[:employer_id]) - if @employer.id_card_enabled? - @configuration = @employer.id_card_configuration - else - @configuration = @employer.create_id_card_configuration - end - render :edit - end + # def edit + # @employer = Employer.find_by(slug: params[:employer_id]) + # if @employer.id_card_enabled? + # @setup = @employer.id_card_setup + # else + # @setup = @employer.create_id_card_setup + # end + # render :edit + # end - def update - setup_params = IdCard::Configuration.permitted_params(params) - @configuration = IdCard::Configuration.find(params[:id]) + # def update + # setup_params = IdCard::Setup.permitted_params(params) + # @setup = IdCard::Setup.find(params[:id]) - if @configuration.update(setup_params) - puts "sucess" - redirect_to employer_path(@configuration.employer.slug), notice: 'ID Card Configuration was successfully updated.' - else - puts "fail" - render :edit, status: :unprocessable_entity - end + # if @setup.update(setup_params) + # puts "sucess" + # redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Setup was successfully updated.' + # else + # puts "fail" + # render :edit, status: :unprocessable_entity + # end - end + # end - def general + def index provider_defaults = IdCard::ProviderSection.defaults @provider_options = provider_defaults.map { |p| ["Default #{p.title}", p.id] }.concat(provider_defaults.map { |p| ["New #{p.title}", "new|#{p.id}"] }) - if @configuration.provider_section_id.present? && provider_defaults.map(&:id).exclude?(@configuration.provider_section_id) - @provider_options.insert(0, ["#{@employer.name} Custom", @configuration.provider_section_id]) + if @setup.provider_section_id.present? && provider_defaults.map(&:id).exclude?(@setup.provider_section_id) + @provider_options.insert(0, ["#{@employer.name} Custom", @setup.provider_section_id]) end @rx_options = IdCard::RxSection.all @fairos_rx_id = IdCard::RxSection.find_by(title: "FairosRx").id - render :general + render :index end - def update_general - if params[:id_card_configuration]["provider_section_id"].include?("new|") + def update + if params[:id_card_setup]["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_configuration]["provider_section_id"] = new_provider_section.id + params[:id_card_setup]["provider_section_id"] = new_provider_section.id end - general_params = IdCard::Configuration.permitted_params(params) - if @configuration.update(general_params) + setup_params = IdCard::Setup.permitted_params(params) + if @setup.update(setup_params) puts "sucess" - redirect_to employer_path(@employer.slug), notice: 'ID Card Configuration was successfully updated.' + redirect_to employer_path(@employer.slug), notice: 'ID Card Setup was successfully updated.' else puts "fail" - render :general, status: :unprocessable_entity + render :index, status: :unprocessable_entity end end @@ -61,9 +61,9 @@ module IdCard def update_plans plans_params = IdCard::Plan.permitted_params(params) - if @configuration.update(plans_params) + if @setup.update(plans_params) puts "sucess" - redirect_to employer_path(@configuration.employer.slug), notice: 'ID Card Plans successfully updated.' + redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Plans successfully updated.' else puts "fail" render :plans, status: :unprocessable_entity @@ -77,9 +77,9 @@ module IdCard def update_field_exceptions field_exceptions_params = IdCard::FieldException.permitted_params(params) - if @configuration.update(field_exceptions_params) + if @setup.update(field_exceptions_params) puts "sucess" - redirect_to employer_path(@configuration.employer.slug), notice: 'ID Card Exceptions successfully updated.' + redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Exceptions successfully updated.' else puts "fail" render :field_exceptions, status: :unprocessable_entity @@ -99,10 +99,10 @@ module IdCard def set_employer_and_setup @employer = Employer.find_by(slug: params[:employer_id]) - if @employer.id_card_configuration.present? - @configuration = @employer.id_card_configuration + if @employer.id_card_setup.present? + @setup = @employer.id_card_setup else - @configuration = @employer.create_id_card_configuration + @setup = @employer.create_id_card_setup end end @@ -190,7 +190,7 @@ module IdCard # def form_for_step # step_name = @top_form.current_step - # form_method = "EmployerConfiguration#{step_name.camelize}Form".constantize + # form_method = "EmployerSetup#{step_name.camelize}Form".constantize # # puts "/////\\\\\\||||||" # # puts session[:employer_setup_data] # # puts session[:employer_setup_data]['employer_setup_process_id'] @@ -199,7 +199,7 @@ module IdCard # end # def process_step(step_name) - # @form_method = "EmployerConfiguration#{step_name.camelize}Form".constantize + # @form_method = "EmployerSetup#{step_name.camelize}Form".constantize # session_data_name = "#{step_name}_data" # # puts "1--------------params----" # # puts params @@ -233,7 +233,7 @@ module IdCard # def global_params(step_name) # form_name_sym = "employer_setup_#{step_name}_form".to_sym - # params.require(form_name_sym).permit(EmployerConfigurationForm.permitted_params) + # params.require(form_name_sym).permit(EmployerSetupForm.permitted_params) # end # def process_step(step_name) diff --git a/app/javascript/controllers/general_form_controller.js b/app/javascript/controllers/general_form_controller.js index 2bdecbd..9a4311a 100644 --- a/app/javascript/controllers/general_form_controller.js +++ b/app/javascript/controllers/general_form_controller.js @@ -54,7 +54,7 @@ export default class extends Controller { const providerFieldTargetsList = this.providerFieldTargets console.log(templateSectionData) providerFieldTargetsList.forEach(function(formField) { - const dbField = formField.id.replace('id_card_configuration_provider_section_', '') + const dbField = formField.id.replace('id_card_setup_provider_section_', '') const dbValue = templateSectionData[dbField] formField.value = dbValue; diff --git a/app/models/employer.rb b/app/models/employer.rb index 45958bf..2e85310 100644 --- a/app/models/employer.rb +++ b/app/models/employer.rb @@ -1,6 +1,6 @@ class Employer < ApplicationRecord has_many :members - has_one :id_card_configuration, class_name: 'IdCard::Configuration', dependent: :destroy + has_one :id_card_setup, class_name: 'IdCard::Setup', dependent: :destroy scope :active, -> { where(active: true) } scope :inactive, -> { where(active: false) } @@ -39,7 +39,7 @@ class Employer < ApplicationRecord end def id_card_enabled? - self.id_card_configuration.present? + self.id_card_setup.present? end def claims_check_enabled? diff --git a/app/models/id_card/field_exception.rb b/app/models/id_card/field_exception.rb index 14e8d4e..2ae01e8 100644 --- a/app/models/id_card/field_exception.rb +++ b/app/models/id_card/field_exception.rb @@ -1,6 +1,6 @@ module IdCard class FieldException < ApplicationRecord - belongs_to :configuration + belongs_to :setup has_many :field_exception_items, dependent: :destroy accepts_nested_attributes_for :field_exception_items, allow_destroy: true, reject_if: :all_blank @@ -13,7 +13,7 @@ module IdCard class << self def permitted_params(params) - params.require(:id_card_configuration).permit( + params.require(:id_card_setup).permit( field_exceptions_attributes: [ :exception_type, :exception_value, diff --git a/app/models/id_card/field_exception_item.rb b/app/models/id_card/field_exception_item.rb index 769ba46..30a7513 100644 --- a/app/models/id_card/field_exception_item.rb +++ b/app/models/id_card/field_exception_item.rb @@ -1,6 +1,6 @@ module IdCard - class ExceptionItem < ApplicationRecord - belongs_to :exception + class FieldExceptionItem < ApplicationRecord + belongs_to :field_exception belongs_to :network_logo, optional: true belongs_to :provider_section, optional: true diff --git a/app/models/id_card/plan.rb b/app/models/id_card/plan.rb index 78df748..a3094b4 100644 --- a/app/models/id_card/plan.rb +++ b/app/models/id_card/plan.rb @@ -1,6 +1,6 @@ module IdCard class Plan < ApplicationRecord - belongs_to :configuration, optional: true + belongs_to :setup, optional: true has_many :plan_benefits, dependent: :destroy accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank @@ -45,7 +45,7 @@ module IdCard # end def permitted_params(params) - params.require(:id_card_configuration).permit( + params.require(:id_card_setup).permit( plans_attributes: [ :id, :title, diff --git a/app/models/id_card/provider_section.rb b/app/models/id_card/provider_section.rb index af11423..4337e49 100644 --- a/app/models/id_card/provider_section.rb +++ b/app/models/id_card/provider_section.rb @@ -4,7 +4,7 @@ module IdCard scope :defaults, -> { where(default: true) } def self.permitted_params(params) - params.require(:id_card_configuration).require(:provider_section).permit( + params.require(:id_card_setup).require(:provider_section).permit( :provider_line_1, :provider_line_2, :provider_line_3, diff --git a/app/models/id_card/configuration.rb b/app/models/id_card/setup.rb similarity index 94% rename from app/models/id_card/configuration.rb rename to app/models/id_card/setup.rb index cd4a779..b6e32b4 100644 --- a/app/models/id_card/configuration.rb +++ b/app/models/id_card/setup.rb @@ -1,5 +1,5 @@ module IdCard - class Configuration < ApplicationRecord + class Setup < ApplicationRecord belongs_to :employer, class_name: 'Employer' belongs_to :employer_logo, optional: true belongs_to :network_logo, optional: true @@ -37,7 +37,7 @@ module IdCard end def self.permitted_params(params) - params.require(:id_card_configuration).permit( + params.require(:id_card_setup).permit( :print_name, :network_provider, :card_template, diff --git a/app/services/benefits_word_doc_processor.rb b/app/services/benefits_word_doc_processor.rb deleted file mode 100644 index 73d4506..0000000 --- a/app/services/benefits_word_doc_processor.rb +++ /dev/null @@ -1,33 +0,0 @@ -class BenefitsWordDocProcessor - - def initialize(word_doc, employer=nil) - @word_doc = word_doc - if employer - @employer = employer - else - @employer = Employer.new - @employer.build_id_card_configuration - end - end - - def call - doc = Docx::Document.open(@word_doc) - data_lines = doc.paragraphs.map { |p| p.to_s.squish }.reject!(&:empty?) - - employer_information, plans_and_network = data_lines.split("Medical Plan") - plan_information, network_information = plans_and_network.split("Claims Submission") - - # employer_information = data_lines.slice(0, start_of_plans_index) - # plan_information = data_lines.slice(start_of_plans_index + 1..) - # network_information = data_lines.slice(start_of_network_index + 1..) - - @employer = BenefitsWordDoc::MapEmployerInformation.new(@employer, employer_information).call - @employer = BenefitsWordDoc::MapEmployerLogo.new(@employer, @word_doc).call - @employer = BenefitsWordDoc::MapPlansInformation.new(@employer, plan_information).call - @employer = BenefitsWordDoc::MapNetworkInformation.new(@employer, network_information).call - - @employer - - end - -end \ No newline at end of file diff --git a/app/services/benefits_word_doc_processor_old.rb b/app/services/benefits_word_doc_processor_old.rb index 15c2f55..960f929 100644 --- a/app/services/benefits_word_doc_processor_old.rb +++ b/app/services/benefits_word_doc_processor_old.rb @@ -1,4 +1,4 @@ -class BenefitsWordDocProcessorOld +class WordDocProcessorOld def initialize(word_doc, process=nil) @word_doc = word_doc diff --git a/app/services/benefits_word_doc/map_employer_information.rb b/app/services/benefits_word_doc_service/map_employer_information.rb similarity index 91% rename from app/services/benefits_word_doc/map_employer_information.rb rename to app/services/benefits_word_doc_service/map_employer_information.rb index ead1fb0..27bf91d 100644 --- a/app/services/benefits_word_doc/map_employer_information.rb +++ b/app/services/benefits_word_doc_service/map_employer_information.rb @@ -1,9 +1,9 @@ -module BenefitsWordDoc +module BenefitsWordDocService class MapEmployerInformation def initialize(employer, word_doc_section) @employer = employer - @card_config = @employer.id_card_configuration + @card_setup = @employer.id_card_setup @word_doc_section = word_doc_section end @@ -28,7 +28,9 @@ module BenefitsWordDoc end end end - @card_config.rx_group_number = @employer.group_number + @card_setup.print_name = @employer.name + @employer.name = @employer.name.titleize + @card_setup.rx_group_number = @employer.group_number @employer end diff --git a/app/services/benefits_word_doc/map_employer_logo.rb b/app/services/benefits_word_doc_service/map_employer_logo.rb similarity index 95% rename from app/services/benefits_word_doc/map_employer_logo.rb rename to app/services/benefits_word_doc_service/map_employer_logo.rb index 8aaad21..377fa32 100644 --- a/app/services/benefits_word_doc/map_employer_logo.rb +++ b/app/services/benefits_word_doc_service/map_employer_logo.rb @@ -1,9 +1,9 @@ -module BenefitsWordDoc +module BenefitsWordDocService class MapEmployerLogo def initialize(employer, word_doc) @employer = employer - @card_config = @employer.id_card_configuration + @card_setup = @employer.id_card_setup @word_doc = word_doc end @@ -41,7 +41,7 @@ module BenefitsWordDoc # @employer.single_card_template = "FairosRxIDCard" # end - @card_config.employer_logo = logo + @card_setup.employer_logo = logo end end @employer diff --git a/app/services/benefits_word_doc/map_network_information.rb b/app/services/benefits_word_doc_service/map_network_information.rb similarity index 70% rename from app/services/benefits_word_doc/map_network_information.rb rename to app/services/benefits_word_doc_service/map_network_information.rb index 7acadc2..08d5d46 100644 --- a/app/services/benefits_word_doc/map_network_information.rb +++ b/app/services/benefits_word_doc_service/map_network_information.rb @@ -1,9 +1,9 @@ -module BenefitsWordDoc +module BenefitsWordDocService class MapNetworkInformation def initialize(employer, word_doc_section) @employer = employer - @card_config = @employer.id_card_configuration + @card_setup = @employer.id_card_setup @word_doc_section = word_doc_section end @@ -29,11 +29,11 @@ module BenefitsWordDoc # end if network - @card_config.network_provider = network + @card_setup.network_provider = network logo_name = "#{network}Logo.png" - @card_config.network_logo = IdCard::NetworkLogo.find_by(filename: logo_name) - @card_config.provider_section = IdCard::ProviderSection.find_by(title: network) - @card_config.rx_section = IdCard::RxSection.find_by(title: "FairosRx") + @card_setup.network_logo = IdCard::NetworkLogo.find_by(filename: logo_name) + @card_setup.provider_section = IdCard::ProviderSection.find_by(title: network) + @card_setup.rx_section = IdCard::RxSection.find_by(title: "FairosRx") end diff --git a/app/services/benefits_word_doc/map_plans_information.rb b/app/services/benefits_word_doc_service/map_plans_information.rb similarity index 98% rename from app/services/benefits_word_doc/map_plans_information.rb rename to app/services/benefits_word_doc_service/map_plans_information.rb index ee5a100..910c40c 100644 --- a/app/services/benefits_word_doc/map_plans_information.rb +++ b/app/services/benefits_word_doc_service/map_plans_information.rb @@ -1,9 +1,9 @@ -module BenefitsWordDoc +module BenefitsWordDocService class MapPlansInformation def initialize(employer, word_doc_section) @employer = employer - @card_config = @employer.id_card_configuration + @card_setup = @employer.id_card_setup @word_doc_section = word_doc_section end @@ -12,7 +12,7 @@ module BenefitsWordDoc plans_indexes = @word_doc_section.each_index.select { |index| @word_doc_section[index].match?(/\d*\.?\d+k/i) } plans_indexes.each do |plan_index| - new_plan = @card_config.plans.build(title: @word_doc_section[plan_index]) + new_plan = @card_setup.plans.build(title: @word_doc_section[plan_index]) plan_lines = @word_doc_section.slice(plan_index + 1, 14) plan_lines.each_with_index do |line, i| field_mapping = mapping_array[i] diff --git a/app/services/benefits_word_doc_service/word_doc_processor.rb b/app/services/benefits_word_doc_service/word_doc_processor.rb new file mode 100644 index 0000000..e27f39f --- /dev/null +++ b/app/services/benefits_word_doc_service/word_doc_processor.rb @@ -0,0 +1,35 @@ +module BenefitsWordDocService + class WordDocProcessor + + def initialize(word_doc, employer=nil) + @word_doc = word_doc + if employer + @employer = employer + else + @employer = Employer.new + @employer.build_id_card_setup + end + end + + def call + doc = Docx::Document.open(@word_doc) + data_lines = doc.paragraphs.map { |p| p.to_s.squish }.reject!(&:empty?) + + employer_information, plans_and_network = data_lines.split("Medical Plan") + plan_information, network_information = plans_and_network.split("Claims Submission") + + # employer_information = data_lines.slice(0, start_of_plans_index) + # plan_information = data_lines.slice(start_of_plans_index + 1..) + # network_information = data_lines.slice(start_of_network_index + 1..) + + @employer = BenefitsWordDocService::MapEmployerInformation.new(@employer, employer_information).call + @employer = BenefitsWordDocService::MapEmployerLogo.new(@employer, @word_doc).call + @employer = BenefitsWordDocService::MapPlansInformation.new(@employer, plan_information).call + @employer = BenefitsWordDocService::MapNetworkInformation.new(@employer, network_information).call + + @employer + + end + + end +end \ No newline at end of file diff --git a/app/services/employer_cards/jasper_url_generator.rb b/app/services/employer_cards/jasper_url_generator.rb index 611f92f..d8e2169 100644 --- a/app/services/employer_cards/jasper_url_generator.rb +++ b/app/services/employer_cards/jasper_url_generator.rb @@ -5,7 +5,7 @@ module EmployerCards @pl_plan_key = pl_plan_key @family_id = family_id @layout = layout - @card_config = IdCard::Configuration.find_by(pl_plan_key: pl_plan_key) + @card_setup = IdCard::Setup.find_by(pl_plan_key: pl_plan_key) end def call diff --git a/app/services/id_card_printer/employer_cards_generator.rb b/app/services/id_card_printer_service/employer_cards_generator.rb similarity index 82% rename from app/services/id_card_printer/employer_cards_generator.rb rename to app/services/id_card_printer_service/employer_cards_generator.rb index 21cc330..f5d8d36 100644 --- a/app/services/id_card_printer/employer_cards_generator.rb +++ b/app/services/id_card_printer_service/employer_cards_generator.rb @@ -1,4 +1,4 @@ -module IdCardPrinter +module IdCardPrinterService class EmployerCardsGenerator def initialize(employer, layout, zip=false) @@ -9,9 +9,9 @@ module IdCardPrinter def call IdCard::PrintData.where(pl_plan_key: @employer.pl_plan_key).destroy_all - IdCardPrinter::EmployerDataFormatter.new(@employer).call + IdCardPrinterService::EmployerDataFormatter.new(@employer).call - pdf_array = IdCardPrinter::PdfProcessor.new(@employer, @layout, @zip).call + pdf_array = IdCardPrinterService::PdfProcessor.new(@employer, @layout, @zip).call group_pdfs = combine_pdfs(pdf_array) group_pdfs diff --git a/app/services/id_card_printer/employer_data_formatter.rb b/app/services/id_card_printer_service/employer_data_formatter.rb similarity index 75% rename from app/services/id_card_printer/employer_data_formatter.rb rename to app/services/id_card_printer_service/employer_data_formatter.rb index f3f14d9..035c09b 100644 --- a/app/services/id_card_printer/employer_data_formatter.rb +++ b/app/services/id_card_printer_service/employer_data_formatter.rb @@ -1,9 +1,9 @@ -module IdCardPrinter +module IdCardPrinterService class EmployerDataFormatter def initialize(employer, member_keys = nil) @employer = employer - @card_config = @employer.id_card_configuration + @card_setup = @employer.id_card_setup if member_keys @members = @employer.members.where(pb_entity_key: member_keys).order(:name) @@ -29,20 +29,23 @@ module IdCardPrinter private def set_common_fields - employer_attributes = { - employer_name: @card_config.print_name, - pl_plan_key: @card_config.pl_plan_key, - group_number: @employer.group_number, - rx_group: @card_config.rx_group_number, - network_provider: @card_config.network_provider - } - rx_attributes = @card_config.rx_section.attributes.with_indifferent_access.slice( + employer_attributes = { + pl_plan_key: @card_setup.pl_plan_key, + group_number: @employer.group_number, + rx_group: @card_setup.rx_group_number, + network_provider: @card_setup.network_provider + } + unless @card_setup.has_divisions + employer_attributes.merge!({employer_name: @card_setup.print_name}) + end + + rx_attributes = @card_setup.rx_section.attributes.with_indifferent_access.slice( :customer_service, :web_url ) - provider_attributes = @card_config.provider_section.attributes.with_indifferent_access.slice( + provider_attributes = @card_setup.provider_section.attributes.with_indifferent_access.slice( :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12, :claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6, @@ -53,33 +56,8 @@ module IdCardPrinter @base_card.assign_attributes(selected_attributes) end - def set_common_fields_old - employer_attributes = { - employer_name: @card_config.print_name, - group_number: @employer.group_number, - rx_group: @card_config.rx_group_number - } - - rx_attributes = @card_config.rx_section.attributes.with_indifferent_access.slice( - :customer_service, - :web_url - ) - - provider_attributes = @card_config.provider_section.attributes.with_indifferent_access.slice( - :provider_code, :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6, - :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12, - :claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6, - :claim_to_7, :claim_to_8, :claim_to_9, :claim_to_10, :claim_to_11, :claim_to_12 - ) - - selected_attributes = employer_attributes.merge(rx_attributes).merge(provider_attributes) - @employer_cards.each do |card| - card.assign_attributes(selected_attributes) - end - end - def set_plan_fields - @card_config.plans.each do |plan| + @card_setup.plans.each do |plan| selected_attributes = {} plan.plan_benefits.each do |bene| selected_attributes["benefit_desc_#{bene.sequence}".to_sym] = bene.benefit_desc @@ -106,6 +84,10 @@ module IdCardPrinter medical_eff_date: effect_date.strftime("%m/%d/%Y") } + if @card_setup.has_divisions + member_attributes.merge!({employer_name: me.division}) + end + dependent_attributes = get_dependent_fields(me) if dependent_attributes.present? selected_attributes = member_attributes.merge(dependent_attributes) diff --git a/app/services/id_card_printer/jasper_pdf_generator.rb b/app/services/id_card_printer_service/jasper_pdf_generator.rb similarity index 90% rename from app/services/id_card_printer/jasper_pdf_generator.rb rename to app/services/id_card_printer_service/jasper_pdf_generator.rb index cf90c9b..206bcde 100644 --- a/app/services/id_card_printer/jasper_pdf_generator.rb +++ b/app/services/id_card_printer_service/jasper_pdf_generator.rb @@ -1,4 +1,4 @@ -module IdCardPrinter +module IdCardPrinterService class JasperPdfGenerator def initialize(jasper_url) diff --git a/app/services/id_card_printer/jasper_url_generator.rb b/app/services/id_card_printer_service/jasper_url_generator.rb similarity index 84% rename from app/services/id_card_printer/jasper_url_generator.rb rename to app/services/id_card_printer_service/jasper_url_generator.rb index d7fd5d5..4dfe513 100644 --- a/app/services/id_card_printer/jasper_url_generator.rb +++ b/app/services/id_card_printer_service/jasper_url_generator.rb @@ -1,9 +1,9 @@ -module IdCardPrinter +module IdCardPrinterService class JasperUrlGenerator def initialize(pl_plan_key, family_id, layout) @pl_plan_key = pl_plan_key - @card_config = IdCard::Configuration.find_by(pl_plan_key: pl_plan_key) + @card_setup = IdCard::Setup.find_by(pl_plan_key: pl_plan_key) @family_id = family_id @layout = layout end @@ -24,7 +24,7 @@ module IdCardPrinter # end # end # @network_logos.find_by(default: true).net_logo - @card_config.network_logo.filename + @card_setup.network_logo.filename end # http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF # http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF @@ -33,7 +33,7 @@ module IdCardPrinter host: '10.41.1.115', port: 8080, path: '/trunk/IdCardsServlet', - query: "reportConn=BrittonConnect&cardTemplate=#{@card_config.card_template}&printType=#{@layout}&family_id=#{@family_id }&employer_logo=#{@card_config.employer_logo.filename}&network_logo=#{determine_network_logo}&FileType=PDF" + query: "reportConn=BrittonConnect&cardTemplate=#{@card_setup.card_template}&printType=#{@layout}&family_id=#{@family_id }&employer_logo=#{@card_setup.employer_logo.filename}&network_logo=#{determine_network_logo}&FileType=PDF" } end diff --git a/app/services/id_card_printer/member_cards_generator.rb b/app/services/id_card_printer_service/member_cards_generator.rb similarity index 82% rename from app/services/id_card_printer/member_cards_generator.rb rename to app/services/id_card_printer_service/member_cards_generator.rb index 187d14f..ccb4e47 100644 --- a/app/services/id_card_printer/member_cards_generator.rb +++ b/app/services/id_card_printer_service/member_cards_generator.rb @@ -1,4 +1,4 @@ -module IdCardPrinter +module IdCardPrinterService class MemberCardsGenerator def initialize(member_keys, layout) @@ -10,9 +10,9 @@ module IdCardPrinter def call IdCard::PrintData.where(mb_member_key: @employer.pl_plan_key).destroy_all - IdCardPrinter::EmployerDataFormatter.new(@employer).call + IdCardPrinterService::EmployerDataFormatter.new(@employer).call - pdf_array = IdCardPrinter::PdfProcessor.new(@employer, @layout, @zip).call + pdf_array = IdCardPrinterService::PdfProcessor.new(@employer, @layout, @zip).call group_pdfs = combine_pdfs(pdf_array) group_pdfs diff --git a/app/services/id_card_printer/pdf_processor.rb b/app/services/id_card_printer_service/pdf_processor.rb similarity index 83% rename from app/services/id_card_printer/pdf_processor.rb rename to app/services/id_card_printer_service/pdf_processor.rb index 20f67be..1b0c7fa 100644 --- a/app/services/id_card_printer/pdf_processor.rb +++ b/app/services/id_card_printer_service/pdf_processor.rb @@ -1,9 +1,9 @@ -module IdCardPrinter +module IdCardPrinterService class PdfProcessor def initialize(employer, layout, zip = false) @employer = employer - @card_config = @employer.id_card_configuration + @card_setup = @employer.id_card_setup @layout = layout @zip = zip end @@ -16,9 +16,9 @@ module IdCardPrinter # end group_cards_pdf_array = [] IdCard::PrintData.where(pl_plan_key: @employer.pl_plan_key).each do |card| - url = IdCardPrinter::JasperUrlGenerator.new(@employer.pl_plan_key, card.family_id, @layout).call + url = IdCardPrinterService::JasperUrlGenerator.new(@employer.pl_plan_key, card.family_id, @layout).call puts url - card_pdf = IdCardPrinter::JasperPdfGenerator.new(url).call + card_pdf = IdCardPrinterService::JasperPdfGenerator.new(url).call if @zip card_filename = "#{card.full_name_last_name_first.gsub(", ", "_")}_digital_card_#{Date.today}.pdf" group_cards_pdf_array << { name: card_filename, data: card_pdf.to_pdf } diff --git a/app/services/id_card_printer/queued_cards_generator.rb b/app/services/id_card_printer_service/queued_cards_generator.rb similarity index 81% rename from app/services/id_card_printer/queued_cards_generator.rb rename to app/services/id_card_printer_service/queued_cards_generator.rb index caa0475..d66e96b 100644 --- a/app/services/id_card_printer/queued_cards_generator.rb +++ b/app/services/id_card_printer_service/queued_cards_generator.rb @@ -1,4 +1,4 @@ -module IdCardPrinter +module IdCardPrinterService class QueuedCardsGenerator def initialize(employer_member_keys) @@ -13,12 +13,13 @@ module IdCardPrinter IdCard::PrintData.where(pl_plan_key: @pl_plan_keys).destroy_all @employer_member_keys.each do |emk| employer = Employer.find_by(pl_plan_key: emk["PlanKey"]) + card_setup = employer.id_card_setup member_keys = emk["MemberKeys"].split(", ").map(&:to_i) - IdCardPrinter::EmployerDataFormatter.new(employer, member_keys).call - if emk["PlanKey"] == "3" - blue_card_array = IdCardPrinter::PdfProcessor.new(employer, @layout).call + IdCardPrinterService::EmployerDataFormatter.new(employer, member_keys).call + if card_setup.card_color = "blue" + blue_card_array = IdCardPrinterService::PdfProcessor.new(employer, @layout).call else - white_card_array = IdCardPrinter::PdfProcessor.new(employer, @layout).call + white_card_array = IdCardPrinterService::PdfProcessor.new(employer, @layout).call end end diff --git a/app/services/id_card_printer/sample_cards_generator.rb b/app/services/id_card_printer_service/sample_cards_generator.rb similarity index 57% rename from app/services/id_card_printer/sample_cards_generator.rb rename to app/services/id_card_printer_service/sample_cards_generator.rb index 3048b4c..a03840f 100644 --- a/app/services/id_card_printer/sample_cards_generator.rb +++ b/app/services/id_card_printer_service/sample_cards_generator.rb @@ -1,4 +1,4 @@ -module IdCardPrinter +module IdCardPrinterService class SampleCardsGenerator def initialize(employer) @@ -7,9 +7,9 @@ module IdCardPrinter def call IdCard::PrintData.where(employer_name: @employer.name).destroy_all - IdCardPrinter::SampleDataFormatter.new(@employer).call + IdCardPrinterService::SampleDataFormatter.new(@employer).call - IdCardPrinter::SamplePdfProcessor.new(@employer).call + IdCardPrinterService::SamplePdfProcessor.new(@employer).call end end end diff --git a/app/services/id_card_printer/sample_data_formatter.rb b/app/services/id_card_printer_service/sample_data_formatter.rb similarity index 84% rename from app/services/id_card_printer/sample_data_formatter.rb rename to app/services/id_card_printer_service/sample_data_formatter.rb index 44caab8..8f88b88 100644 --- a/app/services/id_card_printer/sample_data_formatter.rb +++ b/app/services/id_card_printer_service/sample_data_formatter.rb @@ -1,9 +1,9 @@ -module IdCardPrinter +module IdCardPrinterService class SampleDataFormatter def initialize(employer) @employer = employer - @card_config = @employer.id_card_configuration + @card_setup = @employer.id_card_setup end def call @@ -33,8 +33,8 @@ module IdCardPrinter def set_plan_fields plans_base_cards = [] - @card_config.plans.each do |plan| - @base_card.sample_key = @card_config.print_name.titleize.split.map(&:first).push(plan.id).join + @card_setup.plans.each do |plan| + @base_card.sample_key = @card_setup.print_name.titleize.split.map(&:first).push(plan.id).join plan_base_card = @base_card.dup plan_name = plan.title.split(/(?<=\d[kK])/).first plan.plan_benefits.each do |bene| @@ -58,23 +58,23 @@ module IdCardPrinter end def set_network_fields - selected_attributes = @card_config.provider_section.attributes.with_indifferent_access.slice( + selected_attributes = @card_setup.provider_section.attributes.with_indifferent_access.slice( :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12, :claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6, :claim_to_7, :claim_to_8, :claim_to_9, :claim_to_10, :claim_to_11, :claim_to_12 ) - # if @card_config.network_provider == "Cigna" + # if @card_setup.network_provider == "Cigna" # @base_card.provider_code = "5" # end - @base_card.network_provider = @card_config.network_provider + @base_card.network_provider = @card_setup.network_provider @base_card.assign_attributes(selected_attributes) end def set_rx_fields # fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first - selected_attributes = @card_config.rx_section.attributes.with_indifferent_access.slice( + selected_attributes = @card_setup.rx_section.attributes.with_indifferent_access.slice( :customer_service, :web_url ) diff --git a/app/services/id_card_printer/sample_jasper_url_generator.rb b/app/services/id_card_printer_service/sample_jasper_url_generator.rb similarity index 84% rename from app/services/id_card_printer/sample_jasper_url_generator.rb rename to app/services/id_card_printer_service/sample_jasper_url_generator.rb index 6a68151..283af00 100644 --- a/app/services/id_card_printer/sample_jasper_url_generator.rb +++ b/app/services/id_card_printer_service/sample_jasper_url_generator.rb @@ -1,10 +1,10 @@ -module IdCardPrinter +module IdCardPrinterService class SampleJasperUrlGenerator def initialize(employer, sample_key, sample_title) @sample_key = sample_key @sample_title = sample_title - @card_config = employer.id_card_configuration + @card_setup = employer.id_card_setup end def call @@ -25,7 +25,7 @@ module IdCardPrinter # end # end # @network_logos.find_by(default: true).net_logo - @card_config.network_logo.filename + @card_setup.network_logo.filename end # http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF # http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF @@ -34,7 +34,7 @@ module IdCardPrinter host: '10.41.1.115', port: 8080, path: '/trunk/IdCardsServlet', - query: "reportConn=BrittonConnect&cardTemplate=#{@card_config.card_template}&printType=SampleCard&sample_key=#{@sample_key}&sample_plan_title=#{@sample_title}&employer_logo=#{@card_config.employer_logo.filename}&network_logo=#{determine_network_logo}&FileType=PDF" + query: "reportConn=BrittonConnect&cardTemplate=#{@card_setup.card_template}&printType=SampleCard&sample_key=#{@sample_key}&sample_plan_title=#{@sample_title}&employer_logo=#{@card_setup.employer_logo.filename}&network_logo=#{determine_network_logo}&FileType=PDF" } end diff --git a/app/services/id_card_printer/sample_pdf_processor.rb b/app/services/id_card_printer_service/sample_pdf_processor.rb similarity index 66% rename from app/services/id_card_printer/sample_pdf_processor.rb rename to app/services/id_card_printer_service/sample_pdf_processor.rb index 82e9075..f7f0325 100644 --- a/app/services/id_card_printer/sample_pdf_processor.rb +++ b/app/services/id_card_printer_service/sample_pdf_processor.rb @@ -1,17 +1,17 @@ -module IdCardPrinter +module IdCardPrinterService class SamplePdfProcessor def initialize(employer) @employer = employer - @card_config = @employer.id_card_configuration + @card_setup = @employer.id_card_setup end def call group_cards_pdf = CombinePDF.new IdCard::PrintData.where(employer_name: @employer.name).each do |card| - url = IdCardPrinter::SampleJasperUrlGenerator.new(@employer, card.sample_key, card.sample_plan_title).call + url = IdCardPrinterService::SampleJasperUrlGenerator.new(@employer, card.sample_key, card.sample_plan_title).call puts url - card_pdf = IdCardPrinter::JasperPdfGenerator.new(url).call + card_pdf = IdCardPrinterService::JasperPdfGenerator.new(url).call group_cards_pdf << card_pdf end diff --git a/app/services/employer_cards/get_queued_cards.rb b/app/services/id_card_queue_service/get_queued_cards.rb similarity index 75% rename from app/services/employer_cards/get_queued_cards.rb rename to app/services/id_card_queue_service/get_queued_cards.rb index 43f6fe3..3667d18 100644 --- a/app/services/employer_cards/get_queued_cards.rb +++ b/app/services/id_card_queue_service/get_queued_cards.rb @@ -1,11 +1,11 @@ -module EmployerCards +module IdCardQueueService class GetQueuedCards def initialize(pl_plan_keys = nil) if pl_plan_keys @employer_pl_plan_keys = pl_plan_keys else - @employer_pl_plan_keys = IdCard::Configuration.active.pluck(:pl_plan_key).join(',') + @employer_pl_plan_keys = IdCard::Setup.active.pluck(:pl_plan_key).join(',') end end diff --git a/app/services/employer_cards/get_queued_counts.rb b/app/services/id_card_queue_service/get_queued_counts.rb similarity index 66% rename from app/services/employer_cards/get_queued_counts.rb rename to app/services/id_card_queue_service/get_queued_counts.rb index d94048e..389369f 100644 --- a/app/services/employer_cards/get_queued_counts.rb +++ b/app/services/id_card_queue_service/get_queued_counts.rb @@ -1,8 +1,8 @@ -module EmployerCards +module IdCardQueueService class GetQueuedCounts def initialize() - @employer_pl_plan_keys = IdCard::Configuration.active.pluck(:pl_plan_key).join(',') + @employer_pl_plan_keys = IdCard::Setup.active.pluck(:pl_plan_key).join(',') end def call diff --git a/app/services/image_processor.rb b/app/services/image_processor_service.rb similarity index 97% rename from app/services/image_processor.rb rename to app/services/image_processor_service.rb index fc8365e..3506114 100644 --- a/app/services/image_processor.rb +++ b/app/services/image_processor_service.rb @@ -1,4 +1,4 @@ -class ImageProcessor +class ImageProcessorService ALLOWED_LOGO_TYPES = ['Network', 'Employer'].freeze def initialize(image_path, logo_type, new_filename = nil) diff --git a/app/services/sample_card/data_formatter.rb b/app/services/sample_card/data_formatter.rb index 56112b3..1e75adc 100644 --- a/app/services/sample_card/data_formatter.rb +++ b/app/services/sample_card/data_formatter.rb @@ -32,7 +32,7 @@ module SampleCard def set_plan_fields plans_sample_cards = [] - @employer.id_card_configuration.plans.each do |plan| + @employer.id_card_setup.plans.each do |plan| plan_sample_card = @sample_card.dup plan_name = plan.title.split(/(?<=\d[kK])/).first plan_sample_card.family_id = plan_name @@ -56,7 +56,7 @@ module SampleCard end def set_network_fields - selected_attributes = @employer.id_card_configuration.provider_section.attributes.with_indifferent_access.slice( + selected_attributes = @employer.id_card_setup.provider_section.attributes.with_indifferent_access.slice( :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12, :claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6, @@ -71,7 +71,7 @@ module SampleCard def set_rx_fields # fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first - selected_attributes = @employer.id_card_configuration.rx_section.attributes.with_indifferent_access.slice( + selected_attributes = @employer.id_card_setup.rx_section.attributes.with_indifferent_access.slice( :customer_service, :web_url ) diff --git a/app/views/employer_setup/_first_plan_fields.html.erb b/app/views/employer_setup/_first_plan_fields.html.erb index 5e3eb78..a276125 100644 --- a/app/views/employer_setup/_first_plan_fields.html.erb +++ b/app/views/employer_setup/_first_plan_fields.html.erb @@ -4,8 +4,8 @@ <% end %>
-
rounded-bl-lg">
-
-ml-[6px] z-2 w-full"> +
rounded-bl-lg">
+
-ml-[6px] z-2 w-full"> <%= "Plan #{i + 1}" %>
diff --git a/app/views/employer_setup/edit.html.erb b/app/views/employer_setup/edit.html.erb index 09c8d7e..538d140 100644 --- a/app/views/employer_setup/edit.html.erb +++ b/app/views/employer_setup/edit.html.erb @@ -1,6 +1,6 @@

Edit Employer

- <%= form_with model: @employer_configuration, url: employer_configuration_index_path, local: true, multipart: true do |f| %> + <%= form_with model: @employer_setup, url: employer_setup_index_path, local: true, multipart: true do |f| %>

General Information

@@ -51,17 +51,17 @@

Plans Information

-
+
- <% @employer_configuration.plans.each_with_index do |plan, index| %> + <% @employer_setup.plans.each_with_index do |plan, index| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
-
">
-
-ml-[6px] z-2 w-full"> +
">
+
-ml-[6px] z-2 w-full"> <%= "Plan #{index + 1}" %>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> -
"> +
"> Benefit Values
ml-[3px]">
@@ -106,7 +106,7 @@

Alternative Network Information

-
+
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
diff --git a/app/views/employer_setup/index.html.erb b/app/views/employer_setup/index.html.erb index a14b1d2..5e28f74 100644 --- a/app/views/employer_setup/index.html.erb +++ b/app/views/employer_setup/index.html.erb @@ -1,6 +1,6 @@

Employer Setups

- <% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %> + <% plan_colors = IdCard::Setup::FORM_COLORS.push('copper', 'bronze').shuffle %> <% @employer_setups.each_with_index do |es, index| %> <% item_color_index = index == 0 ? 0 : index % plan_colors.length %>
"> diff --git a/app/views/employer_setup/network_exceptions.html.erb b/app/views/employer_setup/network_exceptions.html.erb index 478dc55..e0c7442 100644 --- a/app/views/employer_setup/network_exceptions.html.erb +++ b/app/views/employer_setup/network_exceptions.html.erb @@ -1,4 +1,4 @@ -
+

New Employer Setup

Provider Network

<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %> diff --git a/app/views/employer_setup/new.html.erb b/app/views/employer_setup/new.html.erb index b624e2f..39c708b 100644 --- a/app/views/employer_setup/new.html.erb +++ b/app/views/employer_setup/new.html.erb @@ -57,16 +57,16 @@

Plans Information

-
+
<%= f.fields_for :plans, @employer_setup.plans.first, child_index: 0 do |plan_fields| %>
-
">
-
-ml-[6px] z-2 w-full"> +
">
+
-ml-[6px] z-2 w-full"> <%= "Plan 1" %>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: 0 %> -
"> +
"> Benefit Values
@@ -110,7 +110,7 @@

Alternative Network Information

-
+
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
diff --git a/app/views/employer_setup/plans.html.erb b/app/views/employer_setup/plans.html.erb index 4c68935..9e9f92e 100644 --- a/app/views/employer_setup/plans.html.erb +++ b/app/views/employer_setup/plans.html.erb @@ -1,4 +1,4 @@ -
+

New Employer Setup

Medical Plans

@@ -17,8 +17,8 @@
<% @form.plans.each_with_index do |plan, i| %>
-
rounded-bl-lg">
-
-ml-[6px] z-2 w-full"> +
rounded-bl-lg">
+
-ml-[6px] z-2 w-full"> <%= "Plan #{i + 1}" %>
<%= f.fields_for :plans, index: i do |plan_fields| %> diff --git a/app/views/employers/index.html.erb b/app/views/employers/index.html.erb index 6fba19d..75a1c0c 100644 --- a/app/views/employers/index.html.erb +++ b/app/views/employers/index.html.erb @@ -6,7 +6,7 @@ <% end %>
- <% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %> + <% plan_colors = IdCard::Setup::FORM_COLORS.push('copper', 'bronze').shuffle %> <% @color_index = 0 %>

In Process:

<% @employers.inactive.each_with_index do |emp, index| %> diff --git a/app/views/employers/show.html.erb b/app/views/employers/show.html.erb index d3c4cc5..97bff89 100644 --- a/app/views/employers/show.html.erb +++ b/app/views/employers/show.html.erb @@ -2,13 +2,16 @@ <%= link_to employers_path, class: "flex h-10 w-10 text-xl transition duration-100" do %> <%= icon "arrow-big-left-dash", library: "lucide", class: "h-full w-full text-center text-bluemana hover:text-bronze" %> <% end %> -
+

<%= @employer.name %>

- <% if @employer&.id_card_configuration&.employer_logo&.filename %> - <%= image_tag image_id_card_employer_logo_path(@employer.id_card_configuration.employer_logo.id), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd]" %> + <% if @employer&.id_card_setup&.employer_logo&.filename %> + <%= image_tag image_id_card_employer_logo_path(@employer.id_card_setup.employer_logo.id), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd] bg-platinum" %> <% end %>
+
+ <%= link_to 'Edit Employer', edit_employer_path(@employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-1/3 cursor-pointer bg-bluetang hover:bg-deepcove border-2 border-bluetang text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %> +
@@ -22,9 +25,9 @@ <%= @employer.active == false ? "inactive" : "active" %>

- ├── Effective Date: - <%= @employer.effective_date %> -

+ ├── Effective Date: + <%= @employer.effective_date %> +

└── Key Chain
@@ -34,11 +37,11 @@ <%= attribute_value.present? ? attribute_value.to_s : "waiting" %>

<% end %> - <% if @employer&.id_card_configuration&.plans.present? %> + <% if @employer&.id_card_setup&.plans.present? %>
└── Plans
- <% @employer.id_card_configuration.plans.pluck(:title, :pb_product_key).each do |plan| %> + <% @employer.id_card_setup.plans.pluck(:title, :pb_product_key).each do |plan| %>
├── <%= plan.first %>
@@ -48,13 +51,22 @@

<% end %> <% end %> -
- <%= link_to 'Edit Employer', edit_employer_path(@employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-brightlava hover:bg-deepcove border-2 border-brightlava text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %> +
+
+
+
+ Admin +
+ +
+
+ <%= link_to 'Sync Employer with VHCS', generate_sample_id_card_print_path(id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-brightlava hover:bg-deepcove border-2 border-brightlava text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %> + <%= link_to 'Sync Members with VHCS', generate_print_id_card_print_path(id: @employer.slug),data: { turbo: false }, class: "flex justify-center items-center w-full bg-brightlava hover:bg-deepcove border-2 border-brightlava text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %> +
-
- <% module_color = IdCard::Configuration::MODULE_COLOR %> + <% module_color = IdCard::Setup::MODULE_COLOR %>

ID Card Module

@@ -69,9 +81,9 @@
- <%= link_to "General", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> - <%= link_to "Plans", plans_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> - <%= link_to 'Exceptions (Optional)', field_exceptions_employer_id_card_configuration_index_path(employer_id: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> + <%= link_to "General", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> + <%= link_to "Plans", plans_employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> + <%= link_to 'Exceptions (Optional)', field_exceptions_employer_id_card_setup_index_path(employer_id: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
@@ -82,40 +94,43 @@
- <%= link_to 'Generate Sample Cards', generate_sample_id_card_print_path(@employer.pl_plan_key), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> - <%= link_to 'Generate Group Cards (for print)', generate_print_id_card_print_path(@employer.pl_plan_key),data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> - <%= link_to 'Generate Group Cards (for display)', generate_mobile_display_id_card_print_path(@employer.pl_plan_key), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> - <%= link_to 'Generate Group Cards (for download)', generate_full_page_id_card_print_path(@employer.pl_plan_key), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> -
-
-
-
-
- Admin -
- -
-
- <%= link_to 'Sync Employer with VHCS', generate_sample_id_card_print_path(@employer.pl_plan_key), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> - <%= link_to 'Sync Members with VHCS', generate_print_id_card_print_path(@employer.pl_plan_key),data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> + <%= link_to 'Generate Sample Cards', generate_sample_id_card_print_path(id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> + <%= link_to 'Generate Group Cards (for print)', generate_print_id_card_print_path(id: @employer.slug),data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> + <%= link_to 'Generate Group Cards (for display)', generate_mobile_display_id_card_print_path(id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> + <%= link_to 'Generate Group Cards (for download)', generate_full_page_id_card_print_path(id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<% else %> - <%= link_to "Enable ID Card", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-4 border-atmosphere text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %> + <%= link_to "Enable ID Card", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-4 border-atmosphere text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %> <% end %>
-
-

Claims Check Module

-
-
-
- <% if @employer.claims_check_enabled? %> +
+
+

Britton Web Module

+
+
+
+ <% if @employer.claims_check_enabled? %> - <% else %> - <%= link_to "Enable Claims Check", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-cobalt-vivid hover:bg-deepcove border-4 border-cobalt-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %> - <% end %> + <% else %> + <%= link_to "Enable Britton Web", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-copper hover:bg-deepcove border-4 border-copper text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %> + <% end %> +
+
+
+
+

Claims Check Module

+
+
+
+ <% if @employer.claims_check_enabled? %> + + <% else %> + <%= link_to "Enable Claims Check", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-cobalt-vivid hover:bg-deepcove border-4 border-cobalt-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100 pointer-events-none opacity-50 cursor-not-allowed" %> + <% end %> +
@@ -127,7 +142,7 @@ <% if @employer.claims_check_enabled? %> <% else %> - <%= link_to "Enable FairosRx Eligibility", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-verdigris-vivid hover:bg-deepcove border-4 border-verdigris-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %> + <%= link_to "Enable FairosRx Eligibility", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-verdigris-vivid hover:bg-deepcove border-4 border-verdigris-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100 pointer-events-none opacity-50 cursor-not-allowed" %> <% end %>
diff --git a/app/views/employers_old/_first_plan_fields.html.erb b/app/views/employers_old/_first_plan_fields.html.erb index 5e3eb78..a276125 100644 --- a/app/views/employers_old/_first_plan_fields.html.erb +++ b/app/views/employers_old/_first_plan_fields.html.erb @@ -4,8 +4,8 @@ <% end %>
-
rounded-bl-lg">
-
-ml-[6px] z-2 w-full"> +
rounded-bl-lg">
+
-ml-[6px] z-2 w-full"> <%= "Plan #{i + 1}" %>
diff --git a/app/views/employers_old/_plan_fields.html.erb b/app/views/employers_old/_plan_fields.html.erb index d7a5a35..0666b22 100644 --- a/app/views/employers_old/_plan_fields.html.erb +++ b/app/views/employers_old/_plan_fields.html.erb @@ -5,9 +5,10 @@
<%= plan_fields.text_field :pb_product_key, label: { text: "Plan Product Key" }, class: "w-full" %>
+<% else %> +
+ <%= f.select :template_id, options_from_collection_for_select(@plan_templates, :id, :title), { prompt: "Select Plan Template", class: "w-full" }, { data: { action: "benefits-template-picker#fetchData" }} %> +
<% end %> -
- <%= f.select :template_id, options_from_collection_for_select(@plan_templates, :id, :title), { prompt: "Select Plan Template", class: "w-full" }, { data: { action: "benefits-template-picker#fetchData" }} %> -
diff --git a/app/views/employers_old/edit.html.erb b/app/views/employers_old/edit.html.erb index eec77ac..e5e8037 100644 --- a/app/views/employers_old/edit.html.erb +++ b/app/views/employers_old/edit.html.erb @@ -51,17 +51,17 @@

Plans Information

-
+
<% @employer.plans.each_with_index do |plan, index| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
-
">
-
-ml-[6px] z-2 w-full"> +
">
+
-ml-[6px] z-2 w-full"> <%= "Plan #{index + 1}" %>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> -
"> +
"> Benefit Values
ml-[3px]">
@@ -106,7 +106,7 @@

Alternative Network Information

-
+
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
diff --git a/app/views/employers_old/index.html.erb b/app/views/employers_old/index.html.erb index ecf4281..aece1dd 100644 --- a/app/views/employers_old/index.html.erb +++ b/app/views/employers_old/index.html.erb @@ -6,7 +6,7 @@ <% end %>
- <% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %> + <% plan_colors = IdCard::Setup::FORM_COLORS.push('copper', 'bronze').shuffle %> <% @color_index = 0 %>

In Process:

<% @employers.inactive.each_with_index do |emp, index| %> diff --git a/app/views/employers_old/network_exceptions.html.erb b/app/views/employers_old/network_exceptions.html.erb index 478dc55..e0c7442 100644 --- a/app/views/employers_old/network_exceptions.html.erb +++ b/app/views/employers_old/network_exceptions.html.erb @@ -1,4 +1,4 @@ -
+

New Employer Setup

Provider Network

<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %> diff --git a/app/views/employers_old/new.html.erb b/app/views/employers_old/new.html.erb index da0ba82..9b7d5c3 100644 --- a/app/views/employers_old/new.html.erb +++ b/app/views/employers_old/new.html.erb @@ -61,17 +61,17 @@

Plans Information

-
+
<% @employer.plans.each_with_index do |plan, index| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
-
">
-
-ml-[6px] z-2 w-full"> +
">
+
-ml-[6px] z-2 w-full"> <%= "Plan #{index + 1}" %>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> -
"> +
"> Benefit Values
ml-[3px]">
@@ -116,7 +116,7 @@

Alternative Network Information

-
+
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
diff --git a/app/views/employers_old/new_new.html.erb b/app/views/employers_old/new_new.html.erb index 5707c34..e7b5f09 100644 --- a/app/views/employers_old/new_new.html.erb +++ b/app/views/employers_old/new_new.html.erb @@ -61,17 +61,17 @@

Plans Information

-
+
<% @employer.plans.each_with_index do |plan, index| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
-
">
-
-ml-[6px] z-2 w-full"> +
">
+
-ml-[6px] z-2 w-full"> <%= "Plan #{index + 1}" %>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> -
"> +
"> Benefit Values
ml-[3px]">
@@ -116,7 +116,7 @@

ID Card Exceptions Information

-
+
<%= button_tag "Add an Exception", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-35 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-exception#addExemption", add_exception_target: "exceptionButton" } %>