diff --git a/app/forms/journeys/get_a_teacher_relocation_payment/claim_submission_form.rb b/app/forms/journeys/get_a_teacher_relocation_payment/claim_submission_form.rb index 9e3b86743b..a9fad9c3db 100644 --- a/app/forms/journeys/get_a_teacher_relocation_payment/claim_submission_form.rb +++ b/app/forms/journeys/get_a_teacher_relocation_payment/claim_submission_form.rb @@ -8,9 +8,7 @@ def main_eligibility end def calculate_award_amount(eligibility) - # NOOP - # This is just for compatibility with the AdditionalPaymentsForTeaching - # claim submission form. + eligibility.award_amount = Policies::InternationalRelocationPayments.award_amount end def generate_policy_options_provided diff --git a/app/models/policies/international_relocation_payments.rb b/app/models/policies/international_relocation_payments.rb index b6d75d5aad..75641260c1 100644 --- a/app/models/policies/international_relocation_payments.rb +++ b/app/models/policies/international_relocation_payments.rb @@ -14,5 +14,9 @@ module InternationalRelocationPayments def notify_reply_to_id nil end + + def award_amount + 5_000 + end end end diff --git a/app/models/policies/international_relocation_payments/eligibility.rb b/app/models/policies/international_relocation_payments/eligibility.rb index b755ebb54f..bc0d6b1741 100644 --- a/app/models/policies/international_relocation_payments/eligibility.rb +++ b/app/models/policies/international_relocation_payments/eligibility.rb @@ -10,10 +10,6 @@ class Eligibility < ApplicationRecord attr_accessor :teacher_reference_number - def award_amount - 0 - end - def ineligible? false end diff --git a/config/analytics.yml b/config/analytics.yml index a36fad1cbb..437c8f6324 100644 --- a/config/analytics.yml +++ b/config/analytics.yml @@ -201,6 +201,7 @@ shared: - date_of_entry - nationality - current_school_id + - award_amount :schools: - id - urn diff --git a/db/migrate/20240709110147_add_award_amount_to_international_relocation_payments_eligibilities.rb b/db/migrate/20240709110147_add_award_amount_to_international_relocation_payments_eligibilities.rb new file mode 100644 index 0000000000..8f318d409b --- /dev/null +++ b/db/migrate/20240709110147_add_award_amount_to_international_relocation_payments_eligibilities.rb @@ -0,0 +1,5 @@ +class AddAwardAmountToInternationalRelocationPaymentsEligibilities < ActiveRecord::Migration[7.0] + def change + add_column :international_relocation_payments_eligibilities, :award_amount, :decimal, precision: 7, scale: 2 + end +end diff --git a/db/schema.rb b/db/schema.rb index ff00b13637..4604e80b62 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_27_145713) do +ActiveRecord::Schema[7.0].define(version: 2024_07_09_110147) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" enable_extension "pgcrypto" @@ -201,6 +201,7 @@ t.string "passport_number" t.string "school_headteacher_name" t.uuid "current_school_id" + t.decimal "award_amount", precision: 7, scale: 2 t.index ["current_school_id"], name: "index_irb_eligibilities_on_current_school_id" end diff --git a/spec/factories/policies/international_relocation_payments/eligibilities.rb b/spec/factories/policies/international_relocation_payments/eligibilities.rb index 456088ce52..01adc6b455 100644 --- a/spec/factories/policies/international_relocation_payments/eligibilities.rb +++ b/spec/factories/policies/international_relocation_payments/eligibilities.rb @@ -1,5 +1,7 @@ FactoryBot.define do factory :international_relocation_payments_eligibility, class: "Policies::InternationalRelocationPayments::Eligibility" do + award_amount { Policies::InternationalRelocationPayments.award_amount } + trait :eligible_home_office do passport_number { Faker::Number.unique.number(digits: 9).to_s } nationality { "French" } diff --git a/spec/forms/journeys/get_a_teacher_relocation_payment/claim_submission_form_spec.rb b/spec/forms/journeys/get_a_teacher_relocation_payment/claim_submission_form_spec.rb index f9bbba704f..6d7c52ab0c 100644 --- a/spec/forms/journeys/get_a_teacher_relocation_payment/claim_submission_form_spec.rb +++ b/spec/forms/journeys/get_a_teacher_relocation_payment/claim_submission_form_spec.rb @@ -88,6 +88,10 @@ eligibility_answers.each do |attribute, value| expect(eligibility.public_send(attribute)).to eq(value) end + + expect(eligibility.award_amount).to eq( + Policies::InternationalRelocationPayments.award_amount + ) end end end