diff --git a/app/jobs/integrations/aggregator/sync_custom_objects_and_properties_job.rb b/app/jobs/integrations/aggregator/sync_custom_objects_and_properties_job.rb index 776f0b927d0..9eb3950564e 100644 --- a/app/jobs/integrations/aggregator/sync_custom_objects_and_properties_job.rb +++ b/app/jobs/integrations/aggregator/sync_custom_objects_and_properties_job.rb @@ -16,4 +16,4 @@ def perform(integration:) end end end -end \ No newline at end of file +end diff --git a/app/jobs/integrations/hubspot/properties/deploy_contacts_job.rb b/app/jobs/integrations/hubspot/properties/deploy_contacts_job.rb new file mode 100644 index 00000000000..588373f51bf --- /dev/null +++ b/app/jobs/integrations/hubspot/properties/deploy_contacts_job.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Integrations + module Hubspot + module Properties + class DeployContactsJobs < ApplicationJob + queue_as 'integrations' + + retry_on LagoHttpClient::HttpError, wait: :polynomially_longer, attempts: 3 + retry_on RequestLimitError, wait: :polynomially_longer, attempts: 10 + + def perform(integration:) + pp "job que faz cenas" + #result = Integrations::Hubspot::Properties::DeployContactsService.call(integration:) + #result.raise_if_error! + end + end + end + end +end \ No newline at end of file diff --git a/spec/jobs/integrations/aggregator/sync_custom_objects_and_properties_job_spec.rb b/spec/jobs/integrations/aggregator/sync_custom_objects_and_properties_job_spec.rb new file mode 100644 index 00000000000..d4adef217ea --- /dev/null +++ b/spec/jobs/integrations/aggregator/sync_custom_objects_and_properties_job_spec.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe Integrations::Aggregator::SyncCustomObjectsAndPropertiesJob, type: :job do + describe '#perform' do + subject(:sync_custom_objects_job) { described_class } + + let(:integration) { create(:hubspot_integration) } + + it 'enqueues the jobs to send objects and properties to hubspot' do + described_class.perform_now(integration:) + end + end +end