Prod build process
This commit is contained in:
@@ -24,8 +24,8 @@ class UpdateEmployerJob < ApplicationJob
|
||||
|
||||
plan_code = Vhcs::HlPlanCode.find_by(plan_key: pl_plan_key)
|
||||
pb_company_plan = Vhcs::PbCompanyPlans.find_by(pl_plan_key: pl_plan_key)
|
||||
employer = Employer.find_or_create_by!(employer_identifier)
|
||||
id_card_setup = employer.id_card_setup || employer.create_id_card_setup!(pl_plan_key: employer.pl_plan_key)
|
||||
employer = Employer.find_or_create_by(employer_identifier)
|
||||
id_card_setup = employer.id_card_setup || employer.build_id_card_setup(pl_plan_key: employer.pl_plan_key)
|
||||
full_sync = employer.previously_new_record? || full_sync
|
||||
unless group_number.present?
|
||||
group_number = Vhcs::PlPlanGroupCode.find_by(pl_plan_key: pl_plan_key).group_code
|
||||
@@ -51,9 +51,12 @@ class UpdateEmployerJob < ApplicationJob
|
||||
})
|
||||
end
|
||||
|
||||
employer.update(employer_update_attrs)
|
||||
employer.assign_attributes(employer_update_attrs)
|
||||
if !employer.save && full_sync
|
||||
employer.save(validate: false)
|
||||
end
|
||||
|
||||
if [employer.pl_plan_key, employer.group_number, employer.company_pb_entity_key, employer.plan_id].all?(&:present?)
|
||||
if !employer.initialized && [employer.pl_plan_key, employer.group_number, employer.company_pb_entity_key, employer.plan_id].all?(&:present?)
|
||||
employer.update(active: true)
|
||||
end
|
||||
|
||||
@@ -64,13 +67,22 @@ class UpdateEmployerJob < ApplicationJob
|
||||
})
|
||||
end
|
||||
|
||||
if full_sync
|
||||
if full_sync || id_card_setup.print_name.blank?
|
||||
setup_update_attrs.merge!({
|
||||
print_name: determine_card_print_name(pb_company_plan.company_pb_entity_key, pl_plan_key)
|
||||
})
|
||||
end
|
||||
|
||||
id_card_setup.update(setup_update_attrs)
|
||||
if id_card_setup.pl_plan_key.blank? && employer.pl_plan_key.present?
|
||||
setup_update_attrs.merge!({
|
||||
pl_plan_key: employer.pl_plan_key
|
||||
})
|
||||
end
|
||||
|
||||
id_card_setup.assign_attributes(setup_update_attrs)
|
||||
if !id_card_setup.save && full_sync
|
||||
id_card_setup.save(validate: false)
|
||||
end
|
||||
|
||||
# plan_code = Vhcs::HlPlanCode.find_by(plan_key: employer.pl_plan_key)
|
||||
# employer.group_number = plan_code.group_number
|
||||
|
||||
Reference in New Issue
Block a user