From be4404b380a464d4b8efb00bc1cd43f62151086e Mon Sep 17 00:00:00 2001 From: Casey Williams Date: Fri, 5 Apr 2024 13:19:02 -0700 Subject: [PATCH] API-34202 Rename AppealsApi::AppealSubmittedJob to AppealReceivedJob --- .../models/appeals_api/higher_level_review.rb | 2 +- .../appeals_api/notice_of_disagreement.rb | 2 +- .../models/appeals_api/supplemental_claim.rb | 2 +- ...ubmitted_job.rb => appeal_received_job.rb} | 3 +-- ...ob_spec.rb => appeal_received_job_spec.rb} | 2 +- ...ared_examples_for_appeal_status_updates.rb | 20 +++++++++---------- 6 files changed, 15 insertions(+), 16 deletions(-) rename modules/appeals_api/app/sidekiq/appeals_api/{appeal_submitted_job.rb => appeal_received_job.rb} (96%) rename modules/appeals_api/spec/sidekiq/{appeal_submitted_job_spec.rb => appeal_received_job_spec.rb} (99%) diff --git a/modules/appeals_api/app/models/appeals_api/higher_level_review.rb b/modules/appeals_api/app/models/appeals_api/higher_level_review.rb index 4275e6cc55d..0a6251cda7a 100644 --- a/modules/appeals_api/app/models/appeals_api/higher_level_review.rb +++ b/modules/appeals_api/app/models/appeals_api/higher_level_review.rb @@ -256,7 +256,7 @@ def update_status(status:, code: nil, detail: nil, raise_on_error: false) return if auth_headers.blank? # Go no further if we've removed PII if status == 'submitted' && email_present? - AppealsApi::AppealSubmittedJob.perform_async(id, self.class.name, appellant_local_time.iso8601) + AppealsApi::AppealReceivedJob.perform_async(id, self.class.name, appellant_local_time.iso8601) end end end diff --git a/modules/appeals_api/app/models/appeals_api/notice_of_disagreement.rb b/modules/appeals_api/app/models/appeals_api/notice_of_disagreement.rb index 06619a0b940..31a07d91ec8 100644 --- a/modules/appeals_api/app/models/appeals_api/notice_of_disagreement.rb +++ b/modules/appeals_api/app/models/appeals_api/notice_of_disagreement.rb @@ -269,7 +269,7 @@ def update_status(status:, code: nil, detail: nil, raise_on_error: false) return if auth_headers.blank? # Go no further if we've removed PII if status == 'submitted' && email_present? - AppealsApi::AppealSubmittedJob.perform_async(id, self.class.name, appellant_local_time.iso8601) + AppealsApi::AppealReceivedJob.perform_async(id, self.class.name, appellant_local_time.iso8601) end end end diff --git a/modules/appeals_api/app/models/appeals_api/supplemental_claim.rb b/modules/appeals_api/app/models/appeals_api/supplemental_claim.rb index cc282b272fe..2bfafbf9bae 100644 --- a/modules/appeals_api/app/models/appeals_api/supplemental_claim.rb +++ b/modules/appeals_api/app/models/appeals_api/supplemental_claim.rb @@ -255,7 +255,7 @@ def update_status(status:, code: nil, detail: nil, raise_on_error: false) return if auth_headers.blank? # Go no further if we've removed PII if status == 'submitted' && email_present? - AppealsApi::AppealSubmittedJob.perform_async(id, self.class.name, appellant_local_time.iso8601) + AppealsApi::AppealReceivedJob.perform_async(id, self.class.name, appellant_local_time.iso8601) end end end diff --git a/modules/appeals_api/app/sidekiq/appeals_api/appeal_submitted_job.rb b/modules/appeals_api/app/sidekiq/appeals_api/appeal_received_job.rb similarity index 96% rename from modules/appeals_api/app/sidekiq/appeals_api/appeal_submitted_job.rb rename to modules/appeals_api/app/sidekiq/appeals_api/appeal_received_job.rb index d1a109e0c9d..d9577e8c866 100644 --- a/modules/appeals_api/app/sidekiq/appeals_api/appeal_submitted_job.rb +++ b/modules/appeals_api/app/sidekiq/appeals_api/appeal_received_job.rb @@ -4,9 +4,8 @@ require 'feature_flipper' module AppealsApi - class AppealSubmittedJob + class AppealReceivedJob include Sidekiq::Job - # These constants are set to match the previous version of this job, which was AppealsApi::AppealReceivedJob STATSD_KEY_PREFIX = 'api.appeals.received' STATSD_CLAIMANT_EMAIL_SENT = "#{STATSD_KEY_PREFIX}.claimant.email.sent".freeze diff --git a/modules/appeals_api/spec/sidekiq/appeal_submitted_job_spec.rb b/modules/appeals_api/spec/sidekiq/appeal_received_job_spec.rb similarity index 99% rename from modules/appeals_api/spec/sidekiq/appeal_submitted_job_spec.rb rename to modules/appeals_api/spec/sidekiq/appeal_received_job_spec.rb index 8d53dea4d7c..d9443f499f4 100644 --- a/modules/appeals_api/spec/sidekiq/appeal_submitted_job_spec.rb +++ b/modules/appeals_api/spec/sidekiq/appeal_received_job_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AppealsApi::AppealSubmittedJob, type: :job do +describe AppealsApi::AppealReceivedJob, type: :job do let(:job) { described_class.new } let(:appeal) { create(:higher_level_review_v2) } let(:hlr_template_name) { 'higher_level_review_received' } diff --git a/modules/appeals_api/spec/support/shared_examples_for_appeal_status_updates.rb b/modules/appeals_api/spec/support/shared_examples_for_appeal_status_updates.rb index 2fff8eec427..5ee0c1be981 100644 --- a/modules/appeals_api/spec/support/shared_examples_for_appeal_status_updates.rb +++ b/modules/appeals_api/spec/support/shared_examples_for_appeal_status_updates.rb @@ -71,9 +71,9 @@ context "when status has updated to 'submitted' and claimant or veteran email data present" do it 'enqueues the appeal received job' do - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 0 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 0 example_instance.update_status(status: 'submitted') - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 1 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 1 end end @@ -81,25 +81,25 @@ before { example_instance.update(status: 'submitted') } it 'does not enqueue the appeal received job' do - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 0 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 0 example_instance.update_status(status: 'submitted') - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 0 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 0 end end context "when incoming status is not 'submitted' and claimant or veteran email data present" do it 'does not enqueue the appeal received job' do - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 0 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 0 example_instance.update_status(status: 'pending') - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 0 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 0 end end context 'when veteran appellant without email provided' do it 'gets the ICN and enqueues the appeal received job' do - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 0 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 0 instance_without_email.update_status(status: 'submitted') - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 1 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 1 end end @@ -111,9 +111,9 @@ end it 'does not enqueue the appeal received job' do - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 0 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 0 example_instance.update_status(status: 'submitted') - expect(AppealsApi::AppealSubmittedJob.jobs.size).to eq 0 + expect(AppealsApi::AppealReceivedJob.jobs.size).to eq 0 end end end