lib/wolf_core/application/barton/routing.rb
module WolfCore module Barton module Routing include WolfCore::HttpOperations include WolfCore::LambdaFunctionOperations PATH_TO_FUNCTION_NAME_MAPPING = { 'barton/import/jobseeker' => 'BartonImportJobseeker', 'barton/export/jobseeker' => 'BartonExportJobseeker', 'barton/import/order' => 'BartonImportOrder', 'barton/export/order' => 'BartonExportOrder', 'barton/import/order_description' => 'BartonImportOrderDescription', } def route_event_request(path:, body:) domain_url = ENV['CURRENT_SAM_URL'] if domain_url.present? async_http_post(url: "#{domain_url}/#{path}", body: body) else function_name = PATH_TO_FUNCTION_NAME_MAPPING[path] invoke_lambda( function_name: function_name, payload: body, ) end end end end end