Skip to content

Commit

Permalink
Merge pull request #3062 from DFE-Digital/CAPT-1497/minimum-teaching-…
Browse files Browse the repository at this point in the history
…task

Add teaching hours task
  • Loading branch information
rjlynch authored Aug 13, 2024
2 parents f6eed83 + 90d3905 commit 80f4767
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/claim_checking_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def applicable_task_names
task_names.delete("employment_contract")
task_names.delete("employment_start")
task_names.delete("subject")
task_names.delete("teaching_hours")
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ def visa
]
end

# We don't have a specific teaching hours question so we show the subject
# to admins
def teaching_hours
[
["Subject", eligibility.subject.humanize]
]
end

private

delegate :eligibility, to: :claim
Expand Down
1 change: 1 addition & 0 deletions app/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Task < ApplicationRecord
subject
student_loan_amount
student_loan_plan
teaching_hours
payroll_details
matching_details
payroll_gender
Expand Down
25 changes: 25 additions & 0 deletions app/views/admin/tasks/teaching_hours.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<% content_for(:page_title) { page_title("Claim #{@claim.reference} teaching_hours check for #{@claim.policy.short_name}") } %>
<%= link_to "Back", admin_claim_tasks_path(claim_id: @claim.id), class: "govuk-back-link" %>
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim, heading: "Subject check" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
</div>

<div class="govuk-grid-column-two-thirds">
<%= render "admin/claims/answers", answers: @tasks_presenter.teaching_hours %>
</div>

<div class="govuk-grid-column-two-thirds">
<% if !@task.passed.nil? %>
<%= render "task_outcome", task: @task %>
<% else %>
<%= render "form", task_name: "teaching_hours", claim: @claim %>
<% end %>

<%= render partial: "admin/task_pagination" %>
</div>
</div>
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ en:
employment_contract: "Check employment contract"
employment_start: "Check employment start date"
subject: "Check subject"
teaching_hours: "Check teaching hours"
undo_decision:
approved: "Undo approval"
rejected: "Undo rejection"
Expand Down Expand Up @@ -818,6 +819,8 @@ en:
title: "Does the claimant’s employment start date match the above information from their claim?"
subject:
title: "Does the claimant’s subject match the above information from their claim?"
teaching_hours:
title: "Does the teacher meet the minimum 50% teaching time requirement in their role?"
further_education_payments:
landing_page: Find out if you are eligible for any incentive payments for further education teachers
claim_description: for further education payments
Expand Down
2 changes: 1 addition & 1 deletion spec/support/admin_view_claim_feature_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def expect_page_to_have_policy_sections(policy)
when Policies::EarlyCareerPayments
["Identity confirmation", "Qualifications", "Induction confirmation", "Census subjects taught", "Employment", "Student loan plan", "Decision"]
when Policies::InternationalRelocationPayments
["Identity confirmation", "Visa", "Arrival date", "Employment", "Employment contract", "Employment start", "Subject", "Decision"]
["Identity confirmation", "Visa", "Arrival date", "Employment", "Employment contract", "Employment start", "Subject", "Teaching hours", "Decision"]
else
raise "Unimplemented policy: #{policy}"
end
Expand Down

0 comments on commit 80f4767

Please sign in to comment.