automate employer setup import from word and manual entry working
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
module BrittonWeb
|
||||
class Employers < BrittonWebRecord
|
||||
|
||||
# self.table_name = 'employers'
|
||||
|
||||
alias_attribute :id, :id
|
||||
alias_attribute :name, :name
|
||||
alias_attribute :pl_plan_key, :pl_plan_key
|
||||
alias_attribute :plan_id, :plan_id
|
||||
alias_attribute :dental_plan, :dental_plan
|
||||
alias_attribute :single_card_template, :single_card_template
|
||||
alias_attribute :multiple_card_template, :multiple_card_template
|
||||
alias_attribute :logo, :logo
|
||||
alias_attribute :active, :active
|
||||
alias_attribute :broker_id, :broker_id
|
||||
alias_attribute :created_at, :created_at
|
||||
alias_attribute :updated_at, :updated_at
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
module BrittonWeb
|
||||
class NetworkLogos < BrittonWebRecord
|
||||
|
||||
self.table_name = 'network_logos'
|
||||
|
||||
alias_attribute :id, :id
|
||||
alias_attribute :net_logo, :net_logo
|
||||
alias_attribute :exception_type, :exception_type
|
||||
alias_attribute :exception_value, :exception_value
|
||||
alias_attribute :default, :default
|
||||
alias_attribute :employer_id, :employer_id
|
||||
alias_attribute :created_at, :created_at
|
||||
alias_attribute :updated_at, :updated_at
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
class BrittonWebRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
connects_to database: { writing: :britton_web, reading: :britton_web }
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
class EmployerSetupProcess < ApplicationRecord
|
||||
has_many :plans
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
class Plan < ApplicationRecord
|
||||
belongs_to :employer_setup_process
|
||||
has_many :plan_benefits
|
||||
|
||||
after_create :create_default_benefits
|
||||
|
||||
|
||||
|
||||
private
|
||||
|
||||
def create_default_benefits
|
||||
benefits = IdCardBenefitsTemplate.find_by(title: "BLANK").id_card_benefits.sort_by(&:sequence)
|
||||
benefits.each do |ben|
|
||||
plan_benefits.create(benefit_desc: ben.benefit_desc, sequence: ben.sequence)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
class PlanBenefit < ApplicationRecord
|
||||
belongs_to :plan
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
module VHCS
|
||||
module Vhcs
|
||||
class HlPlanCode < VhcsRecord
|
||||
|
||||
self.table_name = 'HlPlanCode'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module Vhcs
|
||||
class HLRXCrosRef < VhcsRecord
|
||||
class HlrxCrosRef < VhcsRecord
|
||||
|
||||
self.table_name = 'HLRXCrosRef'
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class VhcsRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
# establish_connection :vhcs
|
||||
connects_to database: { writing: :vhcs, reading: :vhcs }
|
||||
end
|
||||
Reference in New Issue
Block a user