Production Build Working
This commit is contained in:
@@ -6,10 +6,10 @@ module Baclight
|
||||
has_many :baclight_brokers, class_name: "Baclight::Broker", foreign_key: "carrier_id", primary_key: "id"
|
||||
has_many :baclight_employers,
|
||||
through: :baclight_brokers,
|
||||
source: :baclight_employer
|
||||
source: :baclight_employers
|
||||
has_many :baclight_members,
|
||||
through: :baclight_employers,
|
||||
source: :baclight_member
|
||||
source: :baclight_members
|
||||
|
||||
alias_attribute :id, :id
|
||||
alias_attribute :name, :name
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
module Baclight
|
||||
class DocumentCategory < BaclightRecord
|
||||
|
||||
self.table_name = 'document_categories'
|
||||
|
||||
alias_attribute :id, :id
|
||||
alias_attribute :display_name, :display_name
|
||||
alias_attribute :created_at, :created_at
|
||||
alias_attribute :updated_at, :updated_at
|
||||
|
||||
has_many :document_uploads, class_name: "Baclight::DocumentUpload", foreign_key: "category_id", primary_key: "id"
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
module Baclight
|
||||
class DocumentUpload < BaclightRecord
|
||||
|
||||
self.table_name = 'document_uploads'
|
||||
|
||||
alias_attribute :id, :id
|
||||
alias_attribute :filename, :filename
|
||||
alias_attribute :file_type, :file_type
|
||||
alias_attribute :file_data, :file_data
|
||||
alias_attribute :pl_plan_key, :pl_plan_key
|
||||
alias_attribute :active, :active
|
||||
alias_attribute :category_id, :category_id
|
||||
alias_attribute :created_at, :created_at
|
||||
alias_attribute :updated_at, :updated_at
|
||||
|
||||
belongs_to :document_category, class_name: "Baclight::DocumentUpload", foreign_key: "category_id"
|
||||
|
||||
end
|
||||
end
|
||||
@@ -3,22 +3,27 @@ module Baclight
|
||||
|
||||
self.table_name = 'Employers'
|
||||
|
||||
has_one :baclight_carrier, through: :baclight_broker
|
||||
belongs_to :baclight_broker, class_name: "Baclight::Broker", foreign_key: "broker_id"
|
||||
has_many :baclight_members, class_name: "Baclight::Member", foreign_key: "employer_id", primary_key: "id"
|
||||
|
||||
alias_attribute :id, :id
|
||||
alias_attribute :name, :name
|
||||
alias_attribute :slug, :slug
|
||||
alias_attribute :pl_plan_key, :pl_plan_key
|
||||
alias_attribute :company_pb_entity_key, :company_pb_entity_key
|
||||
alias_attribute :plan_id, :plan_id
|
||||
alias_attribute :group_number, :group_number
|
||||
alias_attribute :effective_date, :effective_date
|
||||
alias_attribute :active, :active
|
||||
alias_attribute :initialized, :initialized
|
||||
alias_attribute :broker_id, :broker_id
|
||||
alias_attribute :created_at, :created_at
|
||||
alias_attribute :updated_at, :updated_at
|
||||
# alias_attribute :id, :id
|
||||
# alias_attribute :name, :name
|
||||
# alias_attribute :slug, :slug
|
||||
# alias_attribute :pl_plan_key, :pl_plan_key
|
||||
# alias_attribute :company_pb_entity_key, :company_pb_entity_key
|
||||
# alias_attribute :plan_id, :plan_id
|
||||
# alias_attribute :group_number, :group_number
|
||||
# alias_attribute :effective_date, :effective_date
|
||||
# alias_attribute :active, :active
|
||||
# alias_attribute :initialized, :initialized
|
||||
# alias_attribute :broker_id, :broker_id
|
||||
# alias_attribute :created_at, :created_at
|
||||
# alias_attribute :updated_at, :updated_at
|
||||
|
||||
def carrier_id
|
||||
self.baclight_broker.carrier_id
|
||||
end
|
||||
|
||||
def belongs_to_levels
|
||||
self.joins(baclight_broker: :baclight_carrier).select(
|
||||
|
||||
@@ -5,14 +5,14 @@ module Baclight
|
||||
|
||||
has_many :baclight_id_card_plan_benefits, class_name: "Baclight::IdCardPlanBenefit", foreign_key: "plan_id", primary_key: "id"
|
||||
|
||||
alias_attribute :id, :id
|
||||
alias_attribute :title, :title
|
||||
alias_attribute :pb_product_key, :pb_product_key
|
||||
alias_attribute :pl_plan_key, :pl_plan_key
|
||||
alias_attribute :template, :template
|
||||
alias_attribute :setup_id, :setup_id
|
||||
alias_attribute :created_at, :created_at
|
||||
alias_attribute :updated_at, :updated_at
|
||||
# alias_attribute :id, :id
|
||||
# alias_attribute :title, :title
|
||||
# alias_attribute :pb_product_key, :pb_product_key
|
||||
# alias_attribute :pl_plan_key, :pl_plan_key
|
||||
# alias_attribute :template, :template
|
||||
# alias_attribute :setup_id, :setup_id
|
||||
# alias_attribute :created_at, :created_at
|
||||
# alias_attribute :updated_at, :updated_at
|
||||
|
||||
end
|
||||
end
|
||||
@@ -6,7 +6,7 @@ module Baclight
|
||||
belongs_to :baclight_employer, class_name: "Baclight::Employer", foreign_key: "employer_id"
|
||||
|
||||
scope :active, -> {
|
||||
where(active: true)
|
||||
where(active: true)
|
||||
}
|
||||
|
||||
# alias_attribute :id, :id
|
||||
@@ -40,5 +40,19 @@ module Baclight
|
||||
baclight_employer&.baclight_broker&.carrier_id
|
||||
end
|
||||
|
||||
def eff_date
|
||||
participation = Vhcs::PbProductParticipation.joins('INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey"').where('"PBCoveredEntities"."PBEntityKey" = ?', pb_entity_key).order(out_of_effect: :desc).first
|
||||
eff_date = nil
|
||||
if participation
|
||||
in_effect = participation.in_effect
|
||||
out_of_effect = participation.out_of_effect
|
||||
|
||||
if in_effect <= (Date.today + 90.days) && (out_of_effect - 1.day) > Date.today && out_of_effect > in_effect
|
||||
eff_date = in_effect.strftime("%m/%d/%Y")
|
||||
end
|
||||
end
|
||||
eff_date
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user