From 75ac1bd0c2cca98af2ddc8cda93b9c7cbe7b060e Mon Sep 17 00:00:00 2001 From: YANG YANG Date: Tue, 9 Jul 2024 15:50:37 -0400 Subject: [PATCH] Expand EP400 Merge eligibility to multi-contention claims (#17440) * Expand EP400 Merge eligibility to multi-contention claims * Fix lint warning --- .../concerns/form526_claim_fast_tracking_concern.rb | 4 +++- config/features.yml | 3 +++ spec/models/form526_submission_spec.rb | 12 +++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/form526_claim_fast_tracking_concern.rb b/app/models/concerns/form526_claim_fast_tracking_concern.rb index 6af5d5e1172..91c5ed43f37 100644 --- a/app/models/concerns/form526_claim_fast_tracking_concern.rb +++ b/app/models/concerns/form526_claim_fast_tracking_concern.rb @@ -121,9 +121,11 @@ def diagnostic_codes end def eligible_for_ep_merge? + user = User.find(user_uuid) + return true if Flipper.enabled?(:disability_526_ep_merge_multi_contention, user) return false unless disabilities.count == 1 - Flipper.enabled?(:disability_526_ep_merge_new_claims, User.find(user_uuid)) ? increase_or_new? : increase_only? + Flipper.enabled?(:disability_526_ep_merge_new_claims, user) ? increase_or_new? : increase_only? end def prepare_for_evss! diff --git a/config/features.yml b/config/features.yml index 127fcc5c261..29c7d9d7431 100644 --- a/config/features.yml +++ b/config/features.yml @@ -388,6 +388,9 @@ features: disability_526_ep_merge_new_claims: actor_type: user description: enables EP Merge for single-contention 526 claims for a new condition + disability_526_ep_merge_multi_contention: + actor_type: user + description: enables EP Merge for multi-contention 526 claims disability_526_toxic_exposure: actor_type: user description: enables new pages, processing, and submission of toxic exposure claims diff --git a/spec/models/form526_submission_spec.rb b/spec/models/form526_submission_spec.rb index a247728a8da..aa025aa167d 100644 --- a/spec/models/form526_submission_spec.rb +++ b/spec/models/form526_submission_spec.rb @@ -1274,10 +1274,20 @@ def expect_max_cfi_logged(max_cfi_enabled, disability_claimed, diagnostic_code, describe '#eligible_for_ep_merge?' do subject { Form526Submission.create(form_json: File.read(path)).eligible_for_ep_merge? } + before { Flipper.disable(:disability_526_ep_merge_multi_contention) } + context 'when there are multiple contentions' do let(:path) { 'spec/support/disability_compensation_form/submissions/only_526_mixed_action_disabilities.json' } - it { is_expected.to be_falsey } + context 'when multi-contention claims are not eligible' do + it { is_expected.to be_falsey } + end + + context 'when multi-contention claims are eligible' do + before { Flipper.enable(:disability_526_ep_merge_multi_contention) } + + it { is_expected.to be_truthy } + end end context 'when there is a single new contention' do