automation and view updates

This commit is contained in:
Jason Jordan
2026-04-17 15:35:10 -04:00
parent 247a075c9c
commit 7ab1143db8
30 changed files with 124704 additions and 602 deletions
@@ -0,0 +1,27 @@
module AutomationService
class BatchEmployerUpdate
def initialize(pl_plan_keys)
@pl_plan_keys = pl_plan_keys
end
def call
sql_query = "SELECT PLPlanKey, PlanId, ShortDesc FROM PLPlanHeader
WHERE ActiveInactive = 'Active' AND PLPlanKey IN (#{@pl_plan_keys.join(',')})"
employer_plan_headers = VhcsRecord.connection.select_all(sql_query)
employer_update_futures = employer_plan_headers.map do |employer_plan_header|
Concurrent::Future.execute do
ActiveRecord::Base.connection_pool.with_connection do
UpdateEmployerJob.perform_later(employer_plan_header: employer_plan_header)
end
end
end
employer_update_futures.map(&:value)
end
end
end
# AutomationService::MemberUpdate('13', 337710)