diff --git a/Gemfile.lock b/Gemfile.lock
index 63451c77b3..c4166d55c0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -320,7 +320,7 @@ GEM
validate_url
webfinger (~> 1.2)
os (1.1.4)
- pagy (8.4.5)
+ pagy (8.5.0)
parallel (1.25.1)
parallel_tests (4.7.1)
parallel
diff --git a/app/forms/journeys/get_a_teacher_relocation_payment/employment_details_form.rb b/app/forms/journeys/get_a_teacher_relocation_payment/employment_details_form.rb
new file mode 100644
index 0000000000..636472afca
--- /dev/null
+++ b/app/forms/journeys/get_a_teacher_relocation_payment/employment_details_form.rb
@@ -0,0 +1,62 @@
+module Journeys
+ module GetATeacherRelocationPayment
+ class EmploymentDetailsForm < Form
+ attribute :school_headteacher_name, :string
+ attribute :school_name, :string
+ attribute :school_address_line_1, :string
+ attribute :school_address_line_2, :string
+ attribute :school_city, :string
+ attribute :school_postcode, :string
+
+ validates :school_headteacher_name,
+ presence: {
+ message: i18n_error_message(:school_headteacher_name)
+ }
+
+ validates :school_name,
+ presence: {
+ message: i18n_error_message(:school_name)
+ }
+
+ validates :school_address_line_1,
+ presence: {
+ message: i18n_error_message(:school_address_line_1)
+ }
+
+ validates :school_city,
+ presence: {
+ message: i18n_error_message(:school_city)
+ }
+
+ validates :school_postcode,
+ presence: {
+ message: i18n_error_message(:school_postcode)
+ }
+
+ validate :school_postcode_is_valid, if: -> { school_postcode.present? }
+
+ def save
+ return false unless valid?
+
+ journey_session.answers.assign_attributes(
+ school_headteacher_name: school_headteacher_name,
+ school_name: school_name,
+ school_address_line_1: school_address_line_1,
+ school_address_line_2: school_address_line_2,
+ school_city: school_city,
+ school_postcode: school_postcode
+ )
+
+ journey_session.save!
+ end
+
+ private
+
+ def school_postcode_is_valid
+ unless UKPostcode.parse(school_postcode).full_valid?
+ errors.add(:school_postcode, i18n_errors_path(:school_postcode))
+ end
+ end
+ end
+ end
+end
diff --git a/app/models/base_policy.rb b/app/models/base_policy.rb
index da9f4a0c42..a9a327a0be 100644
--- a/app/models/base_policy.rb
+++ b/app/models/base_policy.rb
@@ -46,4 +46,8 @@ def searchable_eligibility_attributes
self::SEARCHABLE_ELIGIBILITY_ATTRIBUTES
end
+
+ def international_relocation_payments?
+ to_s == "InternationalRelocationPayments"
+ end
end
diff --git a/app/models/claim_checking_tasks.rb b/app/models/claim_checking_tasks.rb
index 676e641e71..2fcdbc5620 100644
--- a/app/models/claim_checking_tasks.rb
+++ b/app/models/claim_checking_tasks.rb
@@ -9,7 +9,11 @@ def initialize(claim)
@claim = claim
end
+ delegate :policy, to: :claim
+
def applicable_task_names
+ return [] if policy.international_relocation_payments?
+
@applicable_task_names ||= Task::NAMES.dup.tap do |task_names|
task_names.delete("induction_confirmation") unless claim.policy == Policies::EarlyCareerPayments
task_names.delete("student_loan_amount") unless claim.policy == Policies::StudentLoans
diff --git a/app/models/concerns/eligibility_checkable.rb b/app/models/concerns/eligibility_checkable.rb
index 4d77e87140..77cd0f2dda 100644
--- a/app/models/concerns/eligibility_checkable.rb
+++ b/app/models/concerns/eligibility_checkable.rb
@@ -121,10 +121,18 @@ def sufficient_teaching?
end
def common_eligible_later_attributes?
- any_future_policy_years? && indicated_eligible_school?
+ any_future_combined_policy_years? && indicated_eligible_school?
+ end
+
+ def policy_end_year
+ policy::POLICY_END_YEAR
end
def any_future_policy_years?
+ claim_year < policy_end_year
+ end
+
+ def any_future_combined_policy_years?
claim_year < FINAL_COMBINED_ECP_AND_LUP_POLICY_YEAR
end
end
diff --git a/app/models/concerns/policies/early_career_payments/eligible.rb b/app/models/concerns/policies/early_career_payments/eligible.rb
index 6e76ff7152..6899541abb 100644
--- a/app/models/concerns/policies/early_career_payments/eligible.rb
+++ b/app/models/concerns/policies/early_career_payments/eligible.rb
@@ -42,7 +42,7 @@ def itt_subject_eligible_now?
end
def specific_ineligible_attributes?
- trainee_teacher? || (induction_not_completed? && !ecp_only_school?) || itt_subject_ineligible_now_and_in_the_future?
+ trainee_teacher? || (induction_not_completed? && !any_future_policy_years?) || itt_subject_ineligible_now_and_in_the_future?
end
def itt_subject_ineligible_now_and_in_the_future?
@@ -55,7 +55,7 @@ def itt_subject_ineligible_now_and_in_the_future?
end
def specific_eligible_later_attributes?
- newly_qualified_teacher? && ((induction_not_completed? && ecp_only_school?) || (!itt_subject_eligible_now? && itt_subject_eligible_later?))
+ newly_qualified_teacher? && ((induction_not_completed? && any_future_policy_years?) || (!itt_subject_eligible_now? && itt_subject_eligible_later?))
end
def itt_subject_eligible_later?
diff --git a/app/models/journeys/additional_payments_for_teaching/slug_sequence.rb b/app/models/journeys/additional_payments_for_teaching/slug_sequence.rb
index 29cea1c0b8..2581ae2f17 100644
--- a/app/models/journeys/additional_payments_for_teaching/slug_sequence.rb
+++ b/app/models/journeys/additional_payments_for_teaching/slug_sequence.rb
@@ -184,12 +184,13 @@ def personal_details_form
end
def replace_ecp_only_induction_not_completed_slugs(sequence)
+ dead_end_slug = (ecp_eligibility_checker.status == :eligible_later) ? "eligible-later" : "ineligible"
+
slugs = %w[
current-school
nqt-in-academic-year-after-itt
induction-completed
- eligible-later
- ]
+ ] << dead_end_slug
sequence.replace(slugs)
end
diff --git a/app/models/journeys/get_a_teacher_relocation_payment.rb b/app/models/journeys/get_a_teacher_relocation_payment.rb
index 4a6157eb03..72851e25f9 100644
--- a/app/models/journeys/get_a_teacher_relocation_payment.rb
+++ b/app/models/journeys/get_a_teacher_relocation_payment.rb
@@ -17,7 +17,8 @@ module GetATeacherRelocationPayment
"visa" => VisaForm,
"entry-date" => EntryDateForm,
"nationality" => NationalityForm,
- "passport-number" => PassportNumberForm
+ "passport-number" => PassportNumberForm,
+ "employment-details" => EmploymentDetailsForm
}
}
end
diff --git a/app/models/journeys/get_a_teacher_relocation_payment/answers_presenter.rb b/app/models/journeys/get_a_teacher_relocation_payment/answers_presenter.rb
index ab1b813591..15bd6c7382 100644
--- a/app/models/journeys/get_a_teacher_relocation_payment/answers_presenter.rb
+++ b/app/models/journeys/get_a_teacher_relocation_payment/answers_presenter.rb
@@ -22,6 +22,17 @@ def identity_answers
end
end
+ def employment_answers
+ [].tap do |a|
+ a << school_headteacher_name
+ a << school_name
+ a << school_address_line_1
+ a << school_address_line_2 if answers.school_address_line_2.present?
+ a << school_city
+ a << school_postcode
+ end
+ end
+
private
def application_route
@@ -95,6 +106,54 @@ def passport_number
"passport-number"
]
end
+
+ def school_headteacher_name
+ [
+ t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_headteacher_name"),
+ answers.school_headteacher_name,
+ "employment-details"
+ ]
+ end
+
+ def school_name
+ [
+ t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_name"),
+ answers.school_name,
+ "employment-details"
+ ]
+ end
+
+ def school_address_line_1
+ [
+ t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_address_line_1"),
+ answers.school_address_line_1,
+ "employment-details"
+ ]
+ end
+
+ def school_address_line_2
+ [
+ t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_address_line_2"),
+ answers.school_address_line_2,
+ "employment-details"
+ ]
+ end
+
+ def school_city
+ [
+ t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_city"),
+ answers.school_city,
+ "employment-details"
+ ]
+ end
+
+ def school_postcode
+ [
+ t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_postcode"),
+ answers.school_postcode,
+ "employment-details"
+ ]
+ end
end
end
end
diff --git a/app/models/journeys/get_a_teacher_relocation_payment/session_answers.rb b/app/models/journeys/get_a_teacher_relocation_payment/session_answers.rb
index db7ff32547..bd2b9f7fda 100644
--- a/app/models/journeys/get_a_teacher_relocation_payment/session_answers.rb
+++ b/app/models/journeys/get_a_teacher_relocation_payment/session_answers.rb
@@ -10,6 +10,12 @@ class SessionAnswers < Journeys::SessionAnswers
attribute :date_of_entry, :date
attribute :nationality, :string
attribute :passport_number, :string
+ attribute :school_headteacher_name, :string
+ attribute :school_name, :string
+ attribute :school_address_line_1, :string
+ attribute :school_address_line_2, :string
+ attribute :school_city, :string
+ attribute :school_postcode, :string
def policy
Policies::InternationalRelocationPayments
diff --git a/app/models/journeys/get_a_teacher_relocation_payment/slug_sequence.rb b/app/models/journeys/get_a_teacher_relocation_payment/slug_sequence.rb
index 7c7c8e9068..e73418a031 100644
--- a/app/models/journeys/get_a_teacher_relocation_payment/slug_sequence.rb
+++ b/app/models/journeys/get_a_teacher_relocation_payment/slug_sequence.rb
@@ -15,6 +15,7 @@ class SlugSequence
PERSONAL_DETAILS_SLUGS = [
"nationality",
"passport-number",
+ "employment-details",
"personal-details",
"postcode-search",
"select-home-address",
diff --git a/app/models/policies.rb b/app/models/policies.rb
index c155fd43bf..d51f30fa9a 100644
--- a/app/models/policies.rb
+++ b/app/models/policies.rb
@@ -2,7 +2,8 @@ module Policies
POLICIES = [
StudentLoans,
EarlyCareerPayments,
- LevellingUpPremiumPayments
+ LevellingUpPremiumPayments,
+ InternationalRelocationPayments
].freeze
AMENDABLE_ELIGIBILITY_ATTRIBUTES = POLICIES.map do |policy|
diff --git a/app/models/policies/early_career_payments.rb b/app/models/policies/early_career_payments.rb
index 946a59b1c0..8d6bffbe94 100644
--- a/app/models/policies/early_career_payments.rb
+++ b/app/models/policies/early_career_payments.rb
@@ -23,6 +23,7 @@ module EarlyCareerPayments
].freeze
POLICY_START_YEAR = AcademicYear.new(2021).freeze
+ POLICY_END_YEAR = AcademicYear.new(2024).freeze
# Used in
# - checking payments with multiple policies: ClaimsPreventingPaymentFinder
@@ -48,14 +49,6 @@ def notify_reply_to_id
"3f85a1f7-9400-4b48-9a31-eaa643d6b977"
end
- def first_eligible_qts_award_year(claim_year = nil)
- POLICY_START_YEAR
- end
-
- def last_ineligible_qts_award_year
- first_eligible_qts_award_year - 1
- end
-
def student_loan_balance_url
"https://www.gov.uk/sign-in-to-manage-your-student-loan-balance"
end
diff --git a/app/models/policies/early_career_payments/eligibility.rb b/app/models/policies/early_career_payments/eligibility.rb
index b01583141e..d55458fdd8 100644
--- a/app/models/policies/early_career_payments/eligibility.rb
+++ b/app/models/policies/early_career_payments/eligibility.rb
@@ -16,7 +16,6 @@ def policy
self.table_name = "early_career_payments_eligibilities"
FIRST_ITT_AY = "2016/2017"
- LAST_POLICY_YEAR = "2024/2025"
# Generates an object similar to
# {
@@ -31,7 +30,7 @@ def policy
# and the enums would be stale until after a server restart.
# Make all valid ITT values based on the last known policy year.
ITT_ACADEMIC_YEARS =
- (AcademicYear.new(FIRST_ITT_AY)...AcademicYear.new(LAST_POLICY_YEAR)).each_with_object({}) do |year, hsh|
+ (AcademicYear.new(FIRST_ITT_AY)...POLICY_END_YEAR).each_with_object({}) do |year, hsh|
hsh[year] = AcademicYear::Type.new.serialize(year)
end.merge({AcademicYear.new => AcademicYear::Type.new.serialize(AcademicYear.new)})
diff --git a/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb b/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb
new file mode 100644
index 0000000000..e50adb3676
--- /dev/null
+++ b/app/models/policies/international_relocation_payments/admin_tasks_presenter.rb
@@ -0,0 +1,13 @@
+module Policies
+ module InternationalRelocationPayments
+ class AdminTasksPresenter
+ include Admin::PresenterMethods
+
+ attr_reader :claim
+
+ def initialize(claim)
+ @claim = claim
+ end
+ end
+ end
+end
diff --git a/app/models/policies/international_relocation_payments/eligibility.rb b/app/models/policies/international_relocation_payments/eligibility.rb
index 932d3c009f..d8e9912135 100644
--- a/app/models/policies/international_relocation_payments/eligibility.rb
+++ b/app/models/policies/international_relocation_payments/eligibility.rb
@@ -3,8 +3,21 @@ module InternationalRelocationPayments
class Eligibility < ApplicationRecord
self.table_name = "international_relocation_payments_eligibilities"
+ AMENDABLE_ATTRIBUTES = %i[].freeze
+
has_one :claim, as: :eligibility, inverse_of: :eligibility
+ attr_accessor :teacher_reference_number
+
+ def award_amount
+ 0
+ end
+
+ # No current_school attribute on the model. This method is for compatibility with the admin UI.
+ def current_school
+ nil
+ end
+
def ineligible?
false
end
diff --git a/app/models/policies/international_relocation_payments/eligibility_admin_answers_presenter.rb b/app/models/policies/international_relocation_payments/eligibility_admin_answers_presenter.rb
new file mode 100644
index 0000000000..9849566d4c
--- /dev/null
+++ b/app/models/policies/international_relocation_payments/eligibility_admin_answers_presenter.rb
@@ -0,0 +1,28 @@
+module Policies
+ module InternationalRelocationPayments
+ class EligibilityAdminAnswersPresenter
+ include Admin::PresenterMethods
+
+ attr_reader :eligibility
+
+ def initialize(eligibility)
+ @eligibility = eligibility
+ end
+
+ def answers
+ [].tap do |a|
+ a << current_school
+ end
+ end
+
+ private
+
+ def current_school
+ [
+ translate("admin.current_school"),
+ eligibility.current_school.present? ? display_school(eligibility.current_school) : "No"
+ ]
+ end
+ end
+ end
+end
diff --git a/app/models/policies/levelling_up_premium_payments.rb b/app/models/policies/levelling_up_premium_payments.rb
index 57c9072399..052fa437bb 100644
--- a/app/models/policies/levelling_up_premium_payments.rb
+++ b/app/models/policies/levelling_up_premium_payments.rb
@@ -24,6 +24,9 @@ module LevellingUpPremiumPayments
SEARCHABLE_ELIGIBILITY_ATTRIBUTES = %w[teacher_reference_number].freeze
+ POLICY_START_YEAR = AcademicYear.new(2022).freeze
+ POLICY_END_YEAR = AcademicYear.new(2024).freeze
+
def notify_reply_to_id
"03ece7eb-2a5b-461b-9c91-6630d0051aa6"
end
@@ -33,7 +36,7 @@ def eligibility_page_url
end
def eligibility_criteria_url
- eligibility_page_url + "#eligibility-criteria-for-teachers"
+ eligibility_page_url + "#eligibility-criteria"
end
def payment_and_deductions_info_url
diff --git a/app/models/policies/levelling_up_premium_payments/eligibility.rb b/app/models/policies/levelling_up_premium_payments/eligibility.rb
index 042b95ba67..4010fef8d1 100644
--- a/app/models/policies/levelling_up_premium_payments/eligibility.rb
+++ b/app/models/policies/levelling_up_premium_payments/eligibility.rb
@@ -24,7 +24,6 @@ def policy
AMENDABLE_ATTRIBUTES = [:teacher_reference_number, :award_amount].freeze
FIRST_ITT_AY = "2017/2018"
- LAST_POLICY_YEAR = "2024/2025"
# Generates an object similar to
# {
@@ -39,7 +38,7 @@ def policy
# and the enums would be stale until after a server restart.
# Make all valid ITT values based on the last known policy year.
ITT_ACADEMIC_YEARS =
- (AcademicYear.new(FIRST_ITT_AY)...AcademicYear.new(LAST_POLICY_YEAR)).each_with_object({}) do |year, hsh|
+ (AcademicYear.new(FIRST_ITT_AY)...POLICY_END_YEAR).each_with_object({}) do |year, hsh|
hsh[year] = AcademicYear::Type.new.serialize(year)
end.merge({AcademicYear.new => AcademicYear::Type.new.serialize(AcademicYear.new)})
diff --git a/app/views/additional_payments/claims/_ineligibility_ecp_only_induction_not_completed.html.erb b/app/views/additional_payments/claims/_ineligibility_ecp_only_induction_not_completed.html.erb
new file mode 100644
index 0000000000..4496c285ff
--- /dev/null
+++ b/app/views/additional_payments/claims/_ineligibility_ecp_only_induction_not_completed.html.erb
@@ -0,0 +1,17 @@
+
+ You are not eligible for the
+ <%= link_to("early-career payment (opens in new tab)", Policies::EarlyCareerPayments.eligibility_criteria_url, class: "govuk-link", target: "_blank") %>
+ because you have not completed your induction.
+
+
+ You are not eligible for the
+ <%= link_to("levelling up premium payment (opens in new tab)", Policies::LevellingUpPremiumPayments.eligibility_criteria_url, class: "govuk-link", target: "_blank") %>
+ because the school you teach in is not eligible. Levelling up premium payments are offered in schools identified as having a higher need for teachers.
+
+
+
+ For more information, check the eligibility criteria for
+ <%= link_to("early-career payments", Policies::EarlyCareerPayments.eligibility_criteria_url, class: "govuk-link") %>
+ and
+ <%= link_to("levelling up premium payments", Policies::LevellingUpPremiumPayments.eligibility_criteria_url, class: "govuk-link") %>.
+
diff --git a/app/views/additional_payments/claims/_ineligibility_trainee_in_last_policy_year.html.erb b/app/views/additional_payments/claims/_ineligibility_trainee_in_last_policy_year.html.erb
index 9a9c4aac8d..ae8a10e8e6 100644
--- a/app/views/additional_payments/claims/_ineligibility_trainee_in_last_policy_year.html.erb
+++ b/app/views/additional_payments/claims/_ineligibility_trainee_in_last_policy_year.html.erb
@@ -6,7 +6,7 @@
You will not be eligible for the
<%= link_to("early-career payment", Policies::EarlyCareerPayments.eligibility_criteria_url, class: "govuk-link") %>
or the
- <%= link_to("levelling up premium payment", LevellingUpPremiumPayments.eligibility_criteria_url, class: "govuk-link") %>
+ <%= link_to("levelling up premium payment", Policies::LevellingUpPremiumPayments.eligibility_criteria_url, class: "govuk-link") %>
once you start work as a qualified teacher.
diff --git a/app/views/get_a_teacher_relocation_payment/claims/check_your_answers.html.erb b/app/views/get_a_teacher_relocation_payment/claims/check_your_answers.html.erb
index 7ec5c0d37c..b611eb0d72 100644
--- a/app/views/get_a_teacher_relocation_payment/claims/check_your_answers.html.erb
+++ b/app/views/get_a_teacher_relocation_payment/claims/check_your_answers.html.erb
@@ -23,6 +23,14 @@
}
) %>
+ <%= render(
+ partial: "claims/check_your_answers_section",
+ locals: {
+ heading: "Employment information",
+ answers: journey.answers_for_claim(@form.journey_session).employment_answers
+ }
+ ) %>
+
<%= render(
partial: "claims/check_your_answers_section",
locals: {
diff --git a/app/views/get_a_teacher_relocation_payment/claims/employment_details.html.erb b/app/views/get_a_teacher_relocation_payment/claims/employment_details.html.erb
new file mode 100644
index 0000000000..069916b530
--- /dev/null
+++ b/app/views/get_a_teacher_relocation_payment/claims/employment_details.html.erb
@@ -0,0 +1,73 @@
+<% content_for(
+ :page_title,
+ page_title(
+ t("get_a_teacher_relocation_payment.forms.employment_details.title"),
+ journey: current_journey_routing_name,
+ show_error: @form.errors.any?
+ )
+) %>
+
+
+
+ <%= t("get_a_teacher_relocation_payment.forms.employment_details.title") %>
+
+
+ <%= form_for(
+ @form,
+ url: claim_path(current_journey_routing_name),
+ builder: GOVUKDesignSystemFormBuilder::FormBuilder
+ ) do |f| %>
+ <%= f.govuk_error_summary %>
+
+ <%= f.govuk_text_field(
+ :school_headteacher_name,
+ label: {
+ text: t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_headteacher_name"),
+ },
+ ) %>
+
+ <%= f.govuk_text_field(
+ :school_name,
+ label: {
+ text: t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_name"),
+ },
+ ) %>
+
+ <%= f.govuk_fieldset(
+ legend: {
+ text: t("get_a_teacher_relocation_payment.forms.employment_details.school_address_legend"),
+ },
+ ) do %>
+ <%= f.govuk_text_field(
+ :school_address_line_1,
+ label: {
+ text: t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_address_line_1"),
+ },
+ ) %>
+
+ <%= f.govuk_text_field(
+ :school_address_line_2,
+ label: {
+ text: t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_address_line_2"),
+ },
+ ) %>
+
+ <%= f.govuk_text_field(
+ :school_city,
+ label: {
+ text: t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_city"),
+ },
+ ) %>
+
+ <%= f.govuk_text_field(
+ :school_postcode,
+ label: {
+ text: t("get_a_teacher_relocation_payment.forms.employment_details.questions.school_postcode"),
+ },
+ ) %>
+ <% end %>
+
+ <%= f.govuk_submit %>
+ <% end %>
+
+
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 0fa70dcf98..295ca84de2 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -25,7 +25,7 @@ stages:
- stage: ProductionRelease
lockBehavior: sequential
- condition: and(succeeded('TestRelease'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
+ condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
jobs:
- deployment: ProductionRelease
displayName: Deploy to production environment
diff --git a/config/analytics_blocklist.yml b/config/analytics_blocklist.yml
index e353302397..ba7e227dd4 100644
--- a/config/analytics_blocklist.yml
+++ b/config/analytics_blocklist.yml
@@ -98,6 +98,12 @@
- gender_digit
:international_relocation_payments_eligibilities:
- passport_number
+ - school_headteacher_name
+ - school_name
+ - school_address_line_1
+ - school_address_line_2
+ - school_city
+ - school_postcode
:levelling_up_premium_payments_eligibilities:
- teacher_reference_number
:early_career_payments_eligibilities:
diff --git a/config/analytics_pii.yml b/config/analytics_pii.yml
index 2f56046b2b..3a42532a18 100644
--- a/config/analytics_pii.yml
+++ b/config/analytics_pii.yml
@@ -1,2 +1,2 @@
---
-shared:
+shared: {}
diff --git a/config/locales/en.yml b/config/locales/en.yml
index fe475c9927..4dcef1e6f8 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -751,6 +751,23 @@ en:
errors:
presence: "Enter your passport number"
invalid: "Invalid passport number"
+ employment_details:
+ title: "Employment information"
+ school_address_legend: "Enter the school address"
+ questions:
+ school_headteacher_name: "Enter the name of the headteacher of the school where you are employed as a teacher"
+ school_name: "Enter the name of the school"
+ school_address_line_1: "Address line 1"
+ school_address_line_2: "Address line 2"
+ school_city: "Town or city"
+ school_postcode: "Postcode"
+ errors:
+ school_headteacher_name: "Enter the headteacher's name"
+ school_name: "Enter the school name"
+ school_address_line_1: "Enter your school's address"
+ school_city: "Enter your school's city"
+ school_postcode: "Enter a valid postcode (for example, BN1 1AA)"
+
check_your_answers:
part_one:
primary_heading: "Check your answers"
@@ -759,6 +776,8 @@ en:
"By selecting continue you are confirming that, to the best of your knowledge, the details you are providing are correct."
international_relocation_payments:
<<: *get_a_teacher_relocation_payment
+ policy_short_name: "International Relocation Payments"
+ policy_acronym: "IRP"
further_education_payments:
landing_page: Find out if you are eligible for any incentive payments for further education teachers
diff --git a/db/migrate/20240625135618_add_employment_details_to_international_relocation_payments_eligibilities.rb b/db/migrate/20240625135618_add_employment_details_to_international_relocation_payments_eligibilities.rb
new file mode 100644
index 0000000000..6135194908
--- /dev/null
+++ b/db/migrate/20240625135618_add_employment_details_to_international_relocation_payments_eligibilities.rb
@@ -0,0 +1,10 @@
+class AddEmploymentDetailsToInternationalRelocationPaymentsEligibilities < ActiveRecord::Migration[7.0]
+ def change
+ add_column :international_relocation_payments_eligibilities, :school_headteacher_name, :string
+ add_column :international_relocation_payments_eligibilities, :school_name, :string
+ add_column :international_relocation_payments_eligibilities, :school_address_line_1, :string
+ add_column :international_relocation_payments_eligibilities, :school_address_line_2, :string
+ add_column :international_relocation_payments_eligibilities, :school_city, :string
+ add_column :international_relocation_payments_eligibilities, :school_postcode, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 2db075d1f0..8a94175eae 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.0].define(version: 2024_06_24_105924) do
+ActiveRecord::Schema[7.0].define(version: 2024_06_25_135618) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
enable_extension "pgcrypto"
@@ -199,6 +199,12 @@
t.date "date_of_entry"
t.string "nationality"
t.string "passport_number"
+ t.string "school_headteacher_name"
+ t.string "school_name"
+ t.string "school_address_line_1"
+ t.string "school_address_line_2"
+ t.string "school_city"
+ t.string "school_postcode"
end
create_table "journey_configurations", primary_key: "routing_name", id: :string, force: :cascade do |t|
diff --git a/lib/ineligibility_reason_checker.rb b/lib/ineligibility_reason_checker.rb
index c9085659ea..8362bbf821 100644
--- a/lib/ineligibility_reason_checker.rb
+++ b/lib/ineligibility_reason_checker.rb
@@ -16,6 +16,8 @@ def reason
:generic
elsif trainee_teacher_last_policy_year?
:trainee_in_last_policy_year
+ elsif ecp_only_induction_not_completed?
+ :ecp_only_induction_not_completed
elsif ecp_only_trainee_teacher?
:ecp_only_trainee_teacher
elsif trainee_teaching_lacking_both_valid_itt_subject_and_degree?
@@ -83,6 +85,13 @@ def generic?
].any?
end
+ def ecp_only_induction_not_completed?
+ [
+ school_eligible_for_ecp_but_not_lup?(@answers.current_school),
+ @answers.induction_not_completed?
+ ].all?
+ end
+
def ecp_only_trainee_teacher?
[
!Policies::LevellingUpPremiumPayments::SchoolEligibility.new(@answers.current_school).eligible?,
@@ -181,8 +190,8 @@ def no_ecp_subjects_that_itt_year?
def trainee_teacher_last_policy_year?
[
@answers.nqt_in_academic_year_after_itt == false,
- @answers.academic_year >= AcademicYear.new(Policies::LevellingUpPremiumPayments::Eligibility::LAST_POLICY_YEAR),
- @answers.academic_year >= AcademicYear.new(Policies::EarlyCareerPayments::Eligibility::LAST_POLICY_YEAR)
+ @answers.academic_year >= AcademicYear.new(Policies::LevellingUpPremiumPayments::POLICY_END_YEAR),
+ @answers.academic_year >= AcademicYear.new(Policies::EarlyCareerPayments::POLICY_END_YEAR)
].all?
end
end
diff --git a/spec/factories/journey_configurations.rb b/spec/factories/journey_configurations.rb
index 0cc791d529..2212a19d64 100644
--- a/spec/factories/journey_configurations.rb
+++ b/spec/factories/journey_configurations.rb
@@ -14,6 +14,10 @@
routing_name { Journeys::GetATeacherRelocationPayment::ROUTING_NAME }
end
+ trait :international_relocation_payments do
+ routing_name { Journeys::GetATeacherRelocationPayment::ROUTING_NAME }
+ end
+
trait :early_career_payments do
additional_payments
end
diff --git a/spec/factories/journeys/additional_payments_for_teaching/session_answers.rb b/spec/factories/journeys/additional_payments_for_teaching/session_answers.rb
index 6847b81ba5..1c051a91e8 100644
--- a/spec/factories/journeys/additional_payments_for_teaching/session_answers.rb
+++ b/spec/factories/journeys/additional_payments_for_teaching/session_answers.rb
@@ -179,6 +179,12 @@
end
end
+ trait :eligible_school_ecp_only do
+ current_school_id do
+ create(:school, :early_career_payments_eligible, :levelling_up_premium_payments_ineligible).id
+ end
+ end
+
trait :short_term_supply_teacher do
employed_as_supply_teacher { true }
has_entire_term_contract { false }
diff --git a/spec/factories/journeys/get_a_teacher_relocation_payment/get_a_teacher_relocation_payment_answers.rb b/spec/factories/journeys/get_a_teacher_relocation_payment/get_a_teacher_relocation_payment_answers.rb
index 2ebd10b624..fc70a880c8 100644
--- a/spec/factories/journeys/get_a_teacher_relocation_payment/get_a_teacher_relocation_payment_answers.rb
+++ b/spec/factories/journeys/get_a_teacher_relocation_payment/get_a_teacher_relocation_payment_answers.rb
@@ -66,6 +66,15 @@
bank_account_number { rand(10000000..99999999) }
end
+ trait :with_employment_details do
+ school_headteacher_name { "Seymour Skinner" }
+ school_name { "Springfield Elementary School" }
+ school_address_line_1 { "Springfield Elementary School" }
+ school_address_line_2 { "Plympton Street" }
+ school_city { "Springfield" }
+ school_postcode { "TE57 1NG" }
+ end
+
trait :eligible_teacher do
with_teacher_application_route
with_state_funded_secondary_school
diff --git a/spec/factories/policies/international_relocation_payments/eligibilities.rb b/spec/factories/policies/international_relocation_payments/eligibilities.rb
index c1a58415af..70242c6942 100644
--- a/spec/factories/policies/international_relocation_payments/eligibilities.rb
+++ b/spec/factories/policies/international_relocation_payments/eligibilities.rb
@@ -1,4 +1,6 @@
FactoryBot.define do
factory :international_relocation_payments_eligibility, class: "Policies::InternationalRelocationPayments::Eligibility" do
+ trait :eligible do
+ end
end
end
diff --git a/spec/features/admin_claim_allocation_spec.rb b/spec/features/admin_claim_allocation_spec.rb
index d55e122cb4..d894dcccc0 100644
--- a/spec/features/admin_claim_allocation_spec.rb
+++ b/spec/features/admin_claim_allocation_spec.rb
@@ -4,6 +4,7 @@
before do
create(:journey_configuration, :student_loans)
create(:journey_configuration, :additional_payments)
+ create(:journey_configuration, :get_a_teacher_relocation_payment)
submitted_claims = []
@signed_in_user = sign_in_as_service_operator
@@ -29,6 +30,9 @@
# index: 35-38
submitted_claims << create_list(:claim, 4, :submitted, policy: Policies::LevellingUpPremiumPayments)
+ # index: 39
+ submitted_claims << create_list(:claim, 1, :submitted, policy: Policies::InternationalRelocationPayments)
+
@submitted_claims = submitted_claims.flatten
end
@@ -60,6 +64,7 @@
let(:twenty_sixth_claim) { @submitted_claims[25] }
let(:thirtieth_claim) { @submitted_claims[29] }
let(:thirty_fifth_claim) { @submitted_claims[34] }
+ let(:thirty_ninth_claim) { @submitted_claims[38] }
let(:student_loan_claims) do
[
@@ -83,6 +88,8 @@
].flatten
end
+ let(:international_relocation_payment_claims) { [thirty_ninth_claim] }
+
let(:levelling_up_premium_payments) { @submitted_claims.slice(36...35) }
let!(:sarah) { create(:dfe_signin_user, given_name: "Sarah", family_name: "Strawbridge", organisation_name: "Department for Education", role_codes: [DfeSignIn::User::SERVICE_OPERATOR_DFE_SIGN_IN_ROLE_CODE]) }
@@ -97,11 +104,11 @@
within("#allocations") do
expect(page).to have_select("allocate_to_team_member", options: ["Aaron Admin", "Sarah Strawbridge", "Frank Yee", "Abdul Rafiq"])
- expect(page).to have_select("allocate_to_policy", options: ["All", "Student Loans", "Early-Career Payments", "Levelling Up Premium Payments"])
+ expect(page).to have_select("allocate_to_policy", options: ["All", "Student Loans", "Early-Career Payments", "Levelling Up Premium Payments", "International Relocation Payments"])
expect(page).to have_button("Allocate claims", disabled: false)
expect(page).to have_button("Unallocate claims")
end
- expect(@submitted_claims.size).to eq 39
+ expect(@submitted_claims.size).to eq 40
@submitted_claims.each do |claim|
expect(claim.assigned_to).to be_nil
@@ -152,7 +159,7 @@
within(".govuk-flash__notice") do
expect(page).to have_text I18n.t(
"admin.allocations.bulk_allocate.success",
- quantity: 14,
+ quantity: 15,
pluralized_or_singular_claim: "claims",
allocate_to_policy: "",
dfe_user: frank.full_name.titleize
@@ -171,11 +178,11 @@
scenario "Student Loans" do
click_on "View claims"
- expect(@submitted_claims.size).to eq 39
+ expect(@submitted_claims.size).to eq 40
within("#allocations") do
expect(page).to have_select("allocate_to_team_member", options: ["Aaron Admin", "Sarah Strawbridge", "Frank Yee", "Abdul Rafiq"])
- expect(page).to have_select("allocate_to_policy", options: ["All", "Student Loans", "Early-Career Payments", "Levelling Up Premium Payments"])
+ expect(page).to have_select("allocate_to_policy", options: ["All", "Student Loans", "Early-Career Payments", "Levelling Up Premium Payments", "International Relocation Payments"])
expect(page).to have_button("Allocate claims", disabled: false)
expect(page).to have_button("Unallocate claims")
end
@@ -207,6 +214,19 @@
end
end
+ scenario "International Relocation Payments" do
+ click_on "View claims"
+
+ within("#allocations") do
+ expect(page).to have_select("allocate_to_team_member", options: ["Aaron Admin", "Sarah Strawbridge", "Frank Yee", "Abdul Rafiq"])
+ expect(page).to have_select("allocate_to_policy", options: ["All", "Student Loans", "Early-Career Payments", "Levelling Up Premium Payments", "International Relocation Payments"])
+ expect(page).to have_button("Allocate claims", disabled: false)
+ expect(page).to have_button("Unallocate claims")
+ end
+
+ expect(thirty_ninth_claim.assigned_to).to be_nil
+ end
+
scenario "when no claims for specified policy awaiting assignment" do
[
first_claim,
diff --git a/spec/features/get_a_teacher_relocation_payment/teacher_route_completing_the_form_spec.rb b/spec/features/get_a_teacher_relocation_payment/teacher_route_completing_the_form_spec.rb
index ab047c414f..c4a62f6ffd 100644
--- a/spec/features/get_a_teacher_relocation_payment/teacher_route_completing_the_form_spec.rb
+++ b/spec/features/get_a_teacher_relocation_payment/teacher_route_completing_the_form_spec.rb
@@ -41,6 +41,7 @@
it "submits an application" do
and_i_complete_the_nationality_step_with(option: "Australian")
and_i_complete_the_passport_number_step_with(options: "123456789")
+ and_i_complete_the_employment_details_step
and_i_complete_the_personal_details_step
and_i_complete_the_postcode_step
and_i_complete_the_email_address_step
@@ -58,6 +59,7 @@
it "submits an application" do
and_i_complete_the_nationality_step_with(option: "Australian")
and_i_complete_the_passport_number_step_with(options: "123456789")
+ and_i_complete_the_employment_details_step
and_i_complete_the_personal_details_step
and_i_complete_the_manual_address_step
and_i_complete_the_email_address_step
@@ -75,6 +77,7 @@
it "submits an application" do
and_i_complete_the_nationality_step_with(option: "Australian")
and_i_complete_the_passport_number_step_with(options: "123456789")
+ and_i_complete_the_employment_details_step
and_i_complete_the_personal_details_step
and_i_complete_the_manual_address_step
and_i_complete_the_email_address_step
@@ -92,6 +95,7 @@
it "submits an application" do
and_i_complete_the_nationality_step_with(option: "Australian")
and_i_complete_the_passport_number_step_with(options: "123456789")
+ and_i_complete_the_employment_details_step
and_i_complete_the_personal_details_step
and_i_complete_the_manual_address_step
and_i_complete_the_email_address_step
@@ -168,6 +172,22 @@ def then_the_check_your_answers_part_page_shows_my_answers(mobile_number: false,
"Enter your passport number, as it appears on your passport 123456789"
)
+ expect(page).to have_text(
+ "Enter the name of the headteacher of the school where you are employed as a teacher Seymour Skinner"
+ )
+
+ expect(page).to have_text(
+ "Enter the name of the school Springfield Elementary School"
+ )
+
+ expect(page).to have_text("Address line 1 Springfield Elementary School")
+
+ expect(page).to have_text("Address line 2 Plympton Street")
+
+ expect(page).to have_text("Town or city Springfield")
+
+ expect(page).to have_text("Postcode TE57 1NG")
+
if mobile_number
expect(page).to have_text("Mobile number 01234567890")
else
diff --git a/spec/features/ineligible_early_career_payments_claims_spec.rb b/spec/features/ineligible_early_career_payments_claims_spec.rb
index 0974155eee..67b558c0de 100644
--- a/spec/features/ineligible_early_career_payments_claims_spec.rb
+++ b/spec/features/ineligible_early_career_payments_claims_spec.rb
@@ -20,6 +20,27 @@
expect(page).to have_text("The school you have selected is not eligible")
end
+ scenario "induction not completed and it's the last policy year" do
+ Journeys.for_policy(Policies::EarlyCareerPayments).configuration.update!(current_academic_year: Policies::EarlyCareerPayments::POLICY_END_YEAR)
+
+ start_early_career_payments_claim
+
+ skip_tid
+
+ choose_school eligible_school
+
+ # - Are you currently teaching as a qualified teacher?
+ choose "Yes"
+ click_on "Continue"
+
+ # - Have you completed your induction as an early-career teacher?
+ choose "No"
+ click_on "Continue"
+
+ expect(page).to have_text(I18n.t("additional_payments.ineligible.heading"))
+ expect(page).to have_css("div#ecp_only_induction_not_completed")
+ end
+
scenario "when poor performance - subject to formal performance action" do
start_early_career_payments_claim
diff --git a/spec/forms/journeys/get_a_teacher_relocation_payment/employment_details_form_spec.rb b/spec/forms/journeys/get_a_teacher_relocation_payment/employment_details_form_spec.rb
new file mode 100644
index 0000000000..fd30f27460
--- /dev/null
+++ b/spec/forms/journeys/get_a_teacher_relocation_payment/employment_details_form_spec.rb
@@ -0,0 +1,101 @@
+require "rails_helper"
+
+RSpec.describe Journeys::GetATeacherRelocationPayment::EmploymentDetailsForm, type: :model do
+ let(:journey_session) { create(:get_a_teacher_relocation_payment_session) }
+
+ let(:params) { ActionController::Parameters.new(claim: {}) }
+
+ let(:form) do
+ described_class.new(
+ journey_session: journey_session,
+ journey: Journeys::GetATeacherRelocationPayment,
+ params: params
+ )
+ end
+
+ describe "validations" do
+ subject { form }
+
+ it do
+ is_expected.to(
+ validate_presence_of(:school_headteacher_name)
+ .with_message("Enter the headteacher's name")
+ )
+ end
+
+ it do
+ is_expected.to(
+ validate_presence_of(:school_name)
+ .with_message("Enter the school name")
+ )
+ end
+
+ it do
+ is_expected.to(
+ validate_presence_of(:school_address_line_1)
+ .with_message("Enter your school's address")
+ )
+ end
+
+ it do
+ is_expected.to(
+ validate_presence_of(:school_city)
+ .with_message("Enter your school's city")
+ )
+ end
+
+ it do
+ is_expected.not_to(
+ allow_value(nil)
+ .for(:school_postcode)
+ .with_message("Enter a valid postcode (for example, BN1 1AA)")
+ )
+ end
+
+ it do
+ is_expected.not_to(
+ allow_value("fff fff")
+ .for(:school_postcode)
+ .with_message("Enter a valid postcode (for example, BN1 1AA)")
+ )
+ end
+
+ it { is_expected.to(allow_value("BN1 1AA").for(:school_postcode)) }
+ end
+
+ describe "#save" do
+ let(:params) do
+ ActionController::Parameters.new(claim: {
+ school_headteacher_name: "Seymour Skinner",
+ school_name: "Springfield Elementary School",
+ school_address_line_1: "19",
+ school_address_line_2: "Plympton Street",
+ school_city: "Springfield",
+ school_postcode: "TE57 1NG"
+ })
+ end
+
+ it "updates the journey session" do
+ expect { expect(form.save).to be(true) }.to(
+ change { journey_session.reload.answers.school_headteacher_name }
+ .to("Seymour Skinner")
+ .and(
+ change { journey_session.reload.answers.school_name }
+ .to("Springfield Elementary School")
+ ).and(
+ change { journey_session.reload.answers.school_address_line_1 }
+ .to("19")
+ ).and(
+ change { journey_session.reload.answers.school_address_line_2 }
+ .to("Plympton Street")
+ ).and(
+ change { journey_session.reload.answers.school_city }
+ .to("Springfield")
+ ).and(
+ change { journey_session.reload.answers.school_postcode }
+ .to("TE57 1NG")
+ )
+ )
+ end
+ end
+end
diff --git a/spec/mailers/payment_mailer_spec.rb b/spec/mailers/payment_mailer_spec.rb
index 90e3f04de0..60ebf2e3a4 100644
--- a/spec/mailers/payment_mailer_spec.rb
+++ b/spec/mailers/payment_mailer_spec.rb
@@ -16,7 +16,7 @@
end
it "sets the GOV.UK Notify reply_to_id according to the policy" do
- expect(mail["reply_to_id"].first.value).to eql(policy.notify_reply_to_id)
+ expect(mail["reply_to_id"]&.first&.value).to eql(policy.notify_reply_to_id)
end
it "mentions the type of claim in the subject" do
diff --git a/spec/models/early_career_payments_spec.rb b/spec/models/early_career_payments_spec.rb
index 1b30620d50..1c71e9cffd 100644
--- a/spec/models/early_career_payments_spec.rb
+++ b/spec/models/early_career_payments_spec.rb
@@ -26,12 +26,6 @@
)
}
- describe ".first_eligible_qts_award_year" do
- it "can return the AcademicYear based on a passed-in academic year" do
- expect(described_class.first_eligible_qts_award_year(AcademicYear.new(2024))).to eq AcademicYear.new(2021)
- end
- end
-
describe ".payroll_file_name" do
subject(:payroll_file_name) { described_class.payroll_file_name }
it { is_expected.to eq("EarlyCareerPayments") }
diff --git a/spec/models/journeys/get_a_teacher_relocation_payment/answers_presenter_spec.rb b/spec/models/journeys/get_a_teacher_relocation_payment/answers_presenter_spec.rb
index 7bf3d90938..54190e5b58 100644
--- a/spec/models/journeys/get_a_teacher_relocation_payment/answers_presenter_spec.rb
+++ b/spec/models/journeys/get_a_teacher_relocation_payment/answers_presenter_spec.rb
@@ -91,4 +91,50 @@
)
end
end
+
+ describe "#employment_answers" do
+ subject { presenter.employment_answers }
+
+ let(:answers) do
+ build(
+ :get_a_teacher_relocation_payment_answers,
+ :with_employment_details
+ )
+ end
+
+ it do
+ is_expected.to include(
+ [
+ "Enter the name of the headteacher of the school where you are employed as a teacher",
+ "Seymour Skinner",
+ "employment-details"
+ ],
+ [
+ "Enter the name of the school",
+ "Springfield Elementary School",
+ "employment-details"
+ ],
+ [
+ "Address line 1",
+ "Springfield Elementary School",
+ "employment-details"
+ ],
+ [
+ "Address line 2",
+ "Plympton Street",
+ "employment-details"
+ ],
+ [
+ "Town or city",
+ "Springfield",
+ "employment-details"
+ ],
+ [
+ "Postcode",
+ "TE57 1NG",
+ "employment-details"
+ ]
+ )
+ end
+ end
end
diff --git a/spec/models/levelling_up_premium_payments_spec.rb b/spec/models/levelling_up_premium_payments_spec.rb
index 4c94cd8957..6e9171222b 100644
--- a/spec/models/levelling_up_premium_payments_spec.rb
+++ b/spec/models/levelling_up_premium_payments_spec.rb
@@ -19,7 +19,7 @@
locale_key: "levelling_up_premium_payments",
notify_reply_to_id: "03ece7eb-2a5b-461b-9c91-6630d0051aa6",
eligibility_page_url: "https://www.gov.uk/guidance/levelling-up-premium-payments-for-teachers",
- eligibility_criteria_url: "https://www.gov.uk/guidance/levelling-up-premium-payments-for-teachers#eligibility-criteria-for-teachers",
+ eligibility_criteria_url: "https://www.gov.uk/guidance/levelling-up-premium-payments-for-teachers#eligibility-criteria",
payment_and_deductions_info_url: "https://www.gov.uk/guidance/levelling-up-premium-payments-for-teachers#payments-and-deductions"
)
}
diff --git a/spec/models/policies/early_career_payments/policy_eligibility_checker_spec.rb b/spec/models/policies/early_career_payments/policy_eligibility_checker_spec.rb
index e63522ca38..2c93460015 100644
--- a/spec/models/policies/early_career_payments/policy_eligibility_checker_spec.rb
+++ b/spec/models/policies/early_career_payments/policy_eligibility_checker_spec.rb
@@ -72,7 +72,9 @@
end
describe "#status" do
- before { create(:journey_configuration, :additional_payments) }
+ let(:claim_year) { AcademicYear.new(2022) }
+
+ before { create(:journey_configuration, :additional_payments, current_academic_year: claim_year) }
subject { policy_eligibility_checker.status }
@@ -111,14 +113,16 @@
end
context "induction not completed" do
- context "with an ECP-only eligible school" do
- let(:answers) { build(:additional_payments_answers, :ecp_eligible, induction_completed: false) }
+ let(:answers) { build(:additional_payments_answers, :ecp_eligible, :eligible_school_ecp_only, induction_completed: false) }
+
+ context "when the claim year is not the same as the end policy year" do
+ let(:claim_year) { Policies::EarlyCareerPayments::POLICY_END_YEAR - 1 }
it { is_expected.to eq(:eligible_later) }
end
- context "with an ECP and LUP eligible school" do
- let(:answers) { build(:additional_payments_answers, :ecp_eligible, :eligible_school_ecp_and_lup, induction_completed: false) }
+ context "when the claim year is the same as the end policy year" do
+ let(:claim_year) { Policies::EarlyCareerPayments::POLICY_END_YEAR }
it { is_expected.to eq(:ineligible) }
end
diff --git a/spec/models/policies/international_relocation_payments/admin_tasks_presenter_spec.rb b/spec/models/policies/international_relocation_payments/admin_tasks_presenter_spec.rb
new file mode 100644
index 0000000000..eed23a4a64
--- /dev/null
+++ b/spec/models/policies/international_relocation_payments/admin_tasks_presenter_spec.rb
@@ -0,0 +1,27 @@
+require "rails_helper"
+
+RSpec.describe Policies::InternationalRelocationPayments::AdminTasksPresenter, type: :model do
+ subject { presenter }
+
+ let(:claim) { build(:claim, policy: Policies::InternationalRelocationPayments) }
+ let(:eligibility) { claim.eligibility }
+ let(:presenter) { described_class.new(claim) }
+
+ it { is_expected.to delegate_method(:eligibility).to(:claim) }
+
+ describe "#identity_confirmation" do
+ subject { presenter.identity_confirmation }
+
+ it "returns an array of label and values for displaying information for the identity confirmation check" do
+ is_expected.to eq [["Current school", nil], ["Contact number", nil]]
+ end
+ end
+
+ describe "#qualifications" do
+ subject(:qualifications) { presenter.qualifications }
+
+ it "returns an array of label and values for displaying information for the qualifications check" do
+ is_expected.to eq [["Qualifications", "No qualifications"]]
+ end
+ end
+end
diff --git a/spec/models/policies/international_relocation_payments/eligibility_admin_answers_presenter_spec.rb b/spec/models/policies/international_relocation_payments/eligibility_admin_answers_presenter_spec.rb
new file mode 100644
index 0000000000..082fa27871
--- /dev/null
+++ b/spec/models/policies/international_relocation_payments/eligibility_admin_answers_presenter_spec.rb
@@ -0,0 +1,13 @@
+require "rails_helper"
+
+RSpec.describe Policies::InternationalRelocationPayments::EligibilityAdminAnswersPresenter, type: :model do
+ let(:claim) { build(:claim, :submittable, policy: Policies::InternationalRelocationPayments, academic_year: "2021/2022") }
+
+ subject(:presenter) { described_class.new(claim.eligibility) }
+
+ describe "#answers" do
+ it "returns an array of questions and answers for displaying to service operator" do
+ expect(presenter.answers).to eq [[I18n.t("admin.current_school"), "No"]]
+ end
+ end
+end
diff --git a/spec/models/policies_spec.rb b/spec/models/policies_spec.rb
index 9384573a53..3786b3c6da 100644
--- a/spec/models/policies_spec.rb
+++ b/spec/models/policies_spec.rb
@@ -6,7 +6,8 @@
expect(described_class::POLICIES).to eq([
Policies::StudentLoans,
Policies::EarlyCareerPayments,
- Policies::LevellingUpPremiumPayments
+ Policies::LevellingUpPremiumPayments,
+ Policies::InternationalRelocationPayments
])
end
end
@@ -30,7 +31,8 @@
expect(described_class.options_for_select).to eq([
["Student Loans", "student-loans"],
["Early-Career Payments", "early-career-payments"],
- ["Levelling Up Premium Payments", "levelling-up-premium-payments"]
+ ["Levelling Up Premium Payments", "levelling-up-premium-payments"],
+ ["International Relocation Payments", "international-relocation-payments"]
])
end
end
diff --git a/spec/support/admin_view_claim_feature_shared_examples.rb b/spec/support/admin_view_claim_feature_shared_examples.rb
index 6a94d47da8..7fda54d526 100644
--- a/spec/support/admin_view_claim_feature_shared_examples.rb
+++ b/spec/support/admin_view_claim_feature_shared_examples.rb
@@ -173,6 +173,8 @@ def expect_page_to_have_policy_sections(policy)
["Identity confirmation", "Qualifications", "Census subjects taught", "Employment", "Student loan plan", "Decision"]
when Policies::EarlyCareerPayments
["Identity confirmation", "Qualifications", "Induction confirmation", "Census subjects taught", "Employment", "Student loan plan", "Decision"]
+ when Policies::InternationalRelocationPayments
+ ["Identity confirmation", "Qualifications", "Census subjects taught", "Employment", "Decision"]
else
raise "Unimplemented policy: #{policy}"
end
diff --git a/spec/support/get_a_teacher_relocation_payment/step_helpers.rb b/spec/support/get_a_teacher_relocation_payment/step_helpers.rb
index bab9ffeb18..f96384a3bd 100644
--- a/spec/support/get_a_teacher_relocation_payment/step_helpers.rb
+++ b/spec/support/get_a_teacher_relocation_payment/step_helpers.rb
@@ -93,6 +93,30 @@ def and_i_complete_the_passport_number_step_with(options:)
click_button("Continue")
end
+ def and_i_complete_the_employment_details_step
+ assert_on_employment_details_page!
+
+ fill_in(
+ "Enter the name of the headteacher of the school where you are employed as a teacher",
+ with: "Seymour Skinner"
+ )
+
+ fill_in(
+ "Enter the name of the school",
+ with: "Springfield Elementary School"
+ )
+
+ fill_in("Address line 1", with: "Springfield Elementary School")
+
+ fill_in("Address line 2", with: "Plympton Street")
+
+ fill_in("Town or city", with: "Springfield")
+
+ fill_in("Postcode", with: "TE57 1NG")
+
+ click_button("Continue")
+ end
+
def and_i_complete_the_personal_details_step
assert_on_personal_details_page!
@@ -299,6 +323,10 @@ def assert_on_passport_number_page!
)
end
+ def assert_on_employment_details_page!
+ expect(page).to have_text("Employment information")
+ end
+
def assert_on_personal_details_page!
expect(page).to have_text("What is your full name?")
end