diff --git a/app/helpers/interruption_screen_helper.rb b/app/helpers/interruption_screen_helper.rb index 6aee9d600..2dadeea89 100644 --- a/app/helpers/interruption_screen_helper.rb +++ b/app/helpers/interruption_screen_helper.rb @@ -5,7 +5,12 @@ module InterruptionScreenHelper translation_params = {} informative_text["arguments"].each do |argument| value = if argument["label"] - lettings_log.form.get_question(argument["key"], lettings_log).answer_label(lettings_log).downcase + pre_casing_value = lettings_log.form.get_question(argument["key"], lettings_log).answer_label(lettings_log) + if argument["key"] == "la" + pre_casing_value + else + pre_casing_value.downcase + end else lettings_log.public_send(argument["key"]) end diff --git a/app/models/validations/financial_validations.rb b/app/models/validations/financial_validations.rb index 3d6542953..de7c4ab68 100644 --- a/app/models/validations/financial_validations.rb +++ b/app/models/validations/financial_validations.rb @@ -184,12 +184,21 @@ private rent_range = LaRentRange.find_by(start_year: collection_year, la: record.la, beds: record.beds, lettype: record.lettype) if rent_range.present? && !weekly_value_in_range(record, "brent", rent_range.hard_min, rent_range.hard_max) && record.brent.present? && record.period.present? - record.errors.add :brent, I18n.t("validations.financial.brent.not_in_range") - record.errors.add :beds, I18n.t("validations.financial.brent.beds.not_in_range") - record.errors.add :la, I18n.t("validations.financial.brent.la.not_in_range") - record.errors.add :rent_type, I18n.t("validations.financial.brent.rent_type.not_in_range") - record.errors.add :needstype, I18n.t("validations.financial.brent.needstype.not_in_range") - record.errors.add :period, I18n.t("validations.financial.brent.period.not_in_range") + if record.weekly_value(record["brent"]) < rent_range.hard_min + record.errors.add :brent, I18n.t("validations.financial.brent.below_hard_min") + record.errors.add :beds, I18n.t("validations.financial.brent.beds.below_hard_min") + record.errors.add :la, I18n.t("validations.financial.brent.la.below_hard_min") + record.errors.add :rent_type, I18n.t("validations.financial.brent.rent_type.below_hard_min") + record.errors.add :needstype, I18n.t("validations.financial.brent.needstype.below_hard_min") + record.errors.add :period, I18n.t("validations.financial.brent.period.below_hard_min") + else + record.errors.add :brent, I18n.t("validations.financial.brent.above_hard_max") + record.errors.add :beds, I18n.t("validations.financial.brent.beds.above_hard_max") + record.errors.add :la, I18n.t("validations.financial.brent.la.above_hard_max") + record.errors.add :rent_type, I18n.t("validations.financial.brent.rent_type.above_hard_max") + record.errors.add :needstype, I18n.t("validations.financial.brent.needstype.above_hard_max") + record.errors.add :period, I18n.t("validations.financial.brent.period.above_hard_max") + end end end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 8b9a12286..853fabcb2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -188,17 +188,23 @@ en: 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" brent: - not_in_range: "Basic rent is outside of the expected range based on the lettings type, local authority and number of bedrooms" + 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" la: - not_in_range: "Basic rent is outside of the expected range based on this local authority" + below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this local authority" + above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this local authority" beds: - not_in_range: "Basic rent is outside of the expected range based on this number of bedrooms" + below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this number of bedrooms" + above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this number of bedrooms" needstype: - not_in_range: "Basic rent is outside of the expected range based on this lettings type" + below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this lettings type" + above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this lettings type" rent_type: - not_in_range: "Basic rent is outside of the expected range based on this lettings type" + below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this lettings type" + above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this lettings type" period: - not_in_range: "Basic rent is outside of the expected range based on this period" + below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this period" + above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this period" charges: complete_1_of_3: "Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’" tcharge: @@ -307,10 +313,10 @@ en: rent: min: title_text: "You told us the rent is %{brent}" - hint_text: "The minimum rent for this type of property in %{la} is £%{soft_min_for_period}." + hint_text: "The minimum rent expected for this type of property in %{la} is £%{soft_min_for_period}." max: title_text: "You told us the rent is %{brent}" - hint_text: "The maximum rent for this type of property in %{la} is £%{soft_max_for_period}." + hint_text: "The maximum rent expected for this type of property in %{la} is £%{soft_max_for_period}." retirement: min: title: "You told us this person is under %{age} and retired"