From 9762ba4736ceb374ce0567630bdbf6811b9348c3 Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Thu, 25 Jul 2024 15:52:45 +0100 Subject: [PATCH] Add rejection reasons for IRP emails Adds the rejection reasons given in the ticket. I've also updated the notify email rejection template to work with these reasons. --- app/models/policies/international_relocation_payments.rb | 9 ++++++++- config/locales/en.yml | 8 ++++++++ spec/features/admin_view_claim_spec.rb | 8 +------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/models/policies/international_relocation_payments.rb b/app/models/policies/international_relocation_payments.rb index ce2cabee0b..d1e953e996 100644 --- a/app/models/policies/international_relocation_payments.rb +++ b/app/models/policies/international_relocation_payments.rb @@ -10,7 +10,14 @@ module InternationalRelocationPayments MIN_QA_THRESHOLD = 100 # Options shown to admins when rejecting a claim - ADMIN_DECISION_REJECTED_REASONS = [] + ADMIN_DECISION_REJECTED_REASONS = [ + :duplicate, + :ineligible_school, + :invalid_bank_details, + :ineligible_visa_or_entry_date, + :ineligible_employment_terms, + :no_response_from_school + ] # NOTE RL: currently IRP only has a single reply to address, so notify # doesn't show the address id diff --git a/config/locales/en.yml b/config/locales/en.yml index 695099d054..e0e044e510 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -776,6 +776,14 @@ en: policy_short_name: "International Relocation Payments" policy_acronym: "IRP" admin: + decision: + rejected_reasons: + duplicate: Duplicate application + ineligible_school: Ineligible school + invalid_bank_details: Invalid bank details + ineligible_visa_or_entry_date: "Visa/entry date ineligible" + ineligible_employment_terms: Ineligible employment terms + no_response_from_school: No response from school eligibility_answers: nationality: "Nationality" passport_number: "Passport number" diff --git a/spec/features/admin_view_claim_spec.rb b/spec/features/admin_view_claim_spec.rb index 86ce985a9e..6a64e3f860 100644 --- a/spec/features/admin_view_claim_spec.rb +++ b/spec/features/admin_view_claim_spec.rb @@ -1,11 +1,5 @@ require "rails_helper" RSpec.feature "Admin view claim" do - Policies.all.each do |policy| - # FIXME RL temp stub out this test until we've added rejection reasons for - # IRP - unless policy == Policies::InternationalRelocationPayments - it_behaves_like "Admin View Claim Feature", policy - end - end + Policies.all.each { |policy| it_behaves_like "Admin View Claim Feature", policy } end