Skip to content

Commit

Permalink
Set IRP award amount
Browse files Browse the repository at this point in the history
Currently the policy for IRP is to award £5,000 on the first claim and
then to get the rest of the £10,000 total the claimant needs to make an
additional claim the following year.
  • Loading branch information
rjlynch committed Jul 9, 2024
1 parent 37eb1fb commit 45af3ef
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions app/models/policies/international_relocation_payments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ module InternationalRelocationPayments
def notify_reply_to_id
nil
end

def award_amount
5_000
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Eligibility < ApplicationRecord

attr_accessor :teacher_reference_number

def award_amount
0
end

def ineligible?
false
end
Expand Down
1 change: 1 addition & 0 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ shared:
- date_of_entry
- nationality
- current_school_id
- award_amount
:schools:
- id
- urn
Expand Down
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 45af3ef

Please sign in to comment.