From bc264915b62442c2c8841243a1053530452cb72e Mon Sep 17 00:00:00 2001 From: Kat Date: Thu, 23 Mar 2023 12:32:14 +0000 Subject: [PATCH] Display error message on ecstat --- app/models/validations/financial_validations.rb | 1 + config/locales/en.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/models/validations/financial_validations.rb b/app/models/validations/financial_validations.rb index 6179d05aa..c14eb453c 100644 --- a/app/models/validations/financial_validations.rb +++ b/app/models/validations/financial_validations.rb @@ -25,6 +25,7 @@ module Validations::FinancialValidations if record.ecstat1 && record.weekly_net_income if record.weekly_net_income > record.applicable_income_range.hard_max record.errors.add :earnings, :over_hard_max, message: I18n.t("validations.financial.earnings.over_hard_max", hard_max: record.applicable_income_range.hard_max) + record.errors.add :ecstat1, :over_hard_max, message: I18n.t("validations.financial.ecstat.over_hard_max", hard_max: record.applicable_income_range.hard_max) end if record.weekly_net_income < record.applicable_income_range.hard_min diff --git a/config/locales/en.yml b/config/locales/en.yml index 56caa6a59..9dff2d393 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -272,6 +272,8 @@ en: local_authority: general_needs: "Enter a value for the support charge between £0 and £60 per week if the landlord is a local authority and it is a general needs letting" supported_housing: "Enter a value for the support charge between £0 and £120 per week if the landlord is a local authority and it is a supported housing letting" + ecstat: + over_hard_max: "Net income of £%{hard_max} per week is too high for given the tenant’s working situation" brent: below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms" above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms"