Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new provider verification questions #3260

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ module Provider
class VerifyClaimForm < Form
include CoursesHelper

# When adding new assertions, try to use the same name as the attribute
# in the eligibility model. This simplifies displaying the
# corresponding claimant answer in the admin ui.
ASSERTIONS = {
fixed_contract: %i[
contract_type
Expand All @@ -12,6 +15,8 @@ class VerifyClaimForm < Form
teaching_hours_per_week
half_teaching_hours
subjects_taught
subject_to_formal_performance_action
subject_to_disciplinary_action
],
variable_contract: %i[
contract_type
Expand All @@ -22,6 +27,8 @@ class VerifyClaimForm < Form
half_teaching_hours
subjects_taught
teaching_hours_per_week_next_term
subject_to_formal_performance_action
subject_to_disciplinary_action
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,22 @@ def verification
@verification ||= claim.eligibility.verification
end

# See the `courses_taught_assertion` method for more information on why
# that assertion is different to the others.
# We need to make sure that when presenting the list of assertions to the
# admin that the courses taught assertion is displayed after the subjects
# taught assertion.
def assertions
verification["assertions"] + [courses_taught_assertion]
return @assertions if @assertions

subjects_taught_index = verification["assertions"].find_index do |h|
h["name"] == "subjects_taught"
end

@assertions = verification["assertions"].dup.insert(
subjects_taught_index + 1,
courses_taught_assertion
)
end

# The provider verifies the courses taught question as part of verifying the
Expand Down Expand Up @@ -101,7 +115,14 @@ def claimant_answer(assertion)
end

def provider_answer(assertion)
assertion["outcome"] ? "Yes" : "No"
case assertion["name"]
when "subject_to_formal_performance_action", "subject_to_disciplinary_action"
# Due to the phrasing of the question to the provider, we need to
# negate their answer when displaying it in the admin ui.
assertion["outcome"] ? "No" : "Yes"
else
assertion["outcome"] ? "Yes" : "No"
end
end

def subjects_taught
Expand Down
26 changes: 26 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,16 @@ en:
claimant_answers:
true: "Yes"
false: "No"
subject_to_formal_performance_action:
label: "Performance measures"
claimant_answers:
true: "Yes"
false: "No"
subject_to_disciplinary_action:
label: "Disciplinary action"
claimant_answers:
true: "Yes"
false: "No"
forms:
ineligible:
courses:
Expand Down Expand Up @@ -1247,6 +1257,14 @@ en:
label: "For at least half of their timetabled teaching hours, does %{claimant} teach:"
errors:
inclusion: "Select yes if %{claimant} teaches this course for at least half their timetabled teaching hours"
subject_to_formal_performance_action:
label: "Can you confirm that %{claimant} is not currently subject to any performance measures?"
errors:
inclusion: "Select yes if %{claimant} is not currently subject to any performance measures"
subject_to_disciplinary_action:
label: "Can you confirm that %{claimant} is not currently subject to disciplinary action?"
errors:
inclusion: "Select yes if %{claimant} is not currently subject to disciplinary action"
variable_contract:
contract_type:
label: "Does %{claimant} have a %{type_of_contract} of employment at %{provider}?"
Expand Down Expand Up @@ -1280,6 +1298,14 @@ en:
label: "Will %{claimant} be timetabled to teach at least 2.5 hours per week next term?"
errors:
inclusion: "Select yes if %{claimant} will be timetabled to teach at least 2.5 hours per week next term"
subject_to_formal_performance_action:
label: "Can you confirm that %{claimant} is not currently subject to any performance measures?"
errors:
inclusion: "Select yes if %{claimant} is not currently subject to any performance measures"
subject_to_disciplinary_action:
label: "Can you confirm that %{claimant} is not currently subject to disciplinary action?"
errors:
inclusion: "Select yes if %{claimant} is not currently subject to disciplinary action"

early_years_payment:
claim_description: for an early years financial incentive payment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,20 @@
choose "Yes"
end

within_fieldset(
"Can you confirm that Edna Krabappel is not currently subject to any " \
"performance measures?"
) do
choose "Yes"
end

within_fieldset(
"Can you confirm that Edna Krabappel is not currently subject to " \
"disciplinary action?"
) do
choose "Yes"
end

check "To the best of my knowledge, I confirm that the information provided in this form is correct."

click_on "Submit"
Expand Down Expand Up @@ -639,6 +653,20 @@
choose "Yes"
end

within_fieldset(
"Can you confirm that Edna Krabappel is not currently subject to any " \
"performance measures?"
) do
choose "Yes"
end

within_fieldset(
"Can you confirm that Edna Krabappel is not currently subject to " \
"disciplinary action?"
) do
choose "Yes"
end

check(
"To the best of my knowledge, I confirm that the information " \
"provided in this form is correct."
Expand Down Expand Up @@ -779,6 +807,20 @@
choose "Yes"
end

within_fieldset(
"Can you confirm that Edna Krabappel is not currently subject to any " \
"performance measures?"
) do
choose "Yes"
end

within_fieldset(
"Can you confirm that Edna Krabappel is not currently subject to " \
"disciplinary action?"
) do
choose "Yes"
end

check(
"To the best of my knowledge, I confirm that the information " \
"provided in this form is correct."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
teaching_hours_per_week
half_teaching_hours
subjects_taught
subject_to_formal_performance_action
subject_to_disciplinary_action
]
)
end
Expand All @@ -132,6 +134,8 @@
half_teaching_hours
subjects_taught
teaching_hours_per_week_next_term
subject_to_formal_performance_action
subject_to_disciplinary_action
]
)
end
Expand Down Expand Up @@ -267,7 +271,9 @@
"2": {name: "further_education_teaching_start_year", outcome: "1"},
"3": {name: "teaching_hours_per_week", outcome: "1"},
"4": {name: "half_teaching_hours", outcome: "0"},
"5": {name: "subjects_taught", outcome: "0"}
"5": {name: "subjects_taught", outcome: "0"},
"6": {name: "subject_to_formal_performance_action", outcome: "0"},
"7": {name: "subject_to_disciplinary_action", outcome: "0"}
}
}
}
Expand Down Expand Up @@ -317,6 +323,14 @@
{
"name" => "subjects_taught",
"outcome" => false
},
{
"name" => "subject_to_formal_performance_action",
"outcome" => false
},
{
"name" => "subject_to_disciplinary_action",
"outcome" => false
}
],
"verifier" => {
Expand Down