Production Build Working
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
module EmployersService
|
||||
class Coverage
|
||||
|
||||
def initialize(employer)
|
||||
@employer = employer
|
||||
end
|
||||
|
||||
def call
|
||||
employer_plans = Baclight::IdCardPlan.where(pl_plan_key: @employer.pl_plan_key).to_a
|
||||
employer_members = @employer.baclight_members.active.order(:name).to_a
|
||||
employer_members.map! do |member|
|
||||
eff_date = member.eff_date
|
||||
if eff_date
|
||||
plan_title = employer_plans.select { |plan| plan.id == member.id_card_plan_id }&.first&.title
|
||||
{
|
||||
name: member.name,
|
||||
pb_entity_key: member.pb_entity_key,
|
||||
plan_title: plan_title,
|
||||
effective_date: eff_date,
|
||||
dependents: JSON.parse(member.dependents)
|
||||
}
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
employer_members.compact
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user