Skip to content

Commit

Permalink
CRIMAPP-1583 skip mark_as_ready if CIFC (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
timpeat authored Jan 21, 2025
1 parent c641495 commit 87d1e0a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
13 changes: 13 additions & 0 deletions app/aggregates/reviewing/available_reviewer_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ class AvailableReviewerActions
open: [:mark_as_ready, :send_back],
marked_as_ready: [:complete, :send_back],
},
cifc: {
open: [:complete, :send_back],
marked_as_ready: [:complete, :send_back]
},
non_means: {
open: [:complete, :send_back],
},
Expand All @@ -18,6 +22,10 @@ class AvailableReviewerActions
open: [:mark_as_ready, :send_back],
marked_as_ready: [:send_back],
},
cifc: {
open: [:send_back],
marked_as_ready: [:send_back]
},
non_means: {
open: [:send_back],
},
Expand Down Expand Up @@ -47,6 +55,7 @@ def config
end

def review_type
return Types::ReviewType[:cifc] if cifc?
return Types::ReviewType[:pse] if pse?
return Types::ReviewType[:non_means] if non_means?

Expand All @@ -57,6 +66,10 @@ def pse?
application_type == Types::ApplicationType['post_submission_evidence']
end

def cifc?
application_type == Types::ApplicationType['change_in_financial_circumstances']
end

def non_means?
work_stream == Types::WorkStreamType['non_means_tested']
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module Types

DecisionState = Symbol.enum(*%i[draft sent_to_provider])

ReviewType = Symbol.enum(*%i[means non_means pse])
ReviewType = Symbol.enum(*%i[means non_means pse cifc])

CourtType = String.enum('crown', 'magistrates')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
let(:application_type) { Types::ApplicationType['change_in_financial_circumstances'] }
let(:work_stream) { WorkStream.new('criminal_applications_team') }

it { is_expected.to eq %i[mark_as_ready send_back] }
it { is_expected.to eq %i[complete send_back] }
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
before do
visit crime_application_path(application_id)
click_button 'Assign to your list'
click_button 'Mark as ready for MAAT'
find('p', text: 'To add the funding decision, update the origional application in MAAT first.')
click_button 'Add funding decision from MAAT'
fill_in('MAAT ID', with: maat_id)
Expand Down
1 change: 0 additions & 1 deletion spec/system/casework/reviewing/a_cifc_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

it 'can be completed by the caseworker' do
expect(page).to have_content('Change in financial circumstances')
click_button 'Mark as ready for MAAT'
click_button 'Mark as completed'
expect(page).to have_content('You marked the application as complete')
end
Expand Down

0 comments on commit 87d1e0a

Please sign in to comment.