Browse Source

feat: add renewal validation on rsnvac

pull/982/head
Sam Seed 3 years ago
parent
commit
2b4cb8ead0
  1. 4
      app/models/validations/property_validations.rb
  2. 1
      config/locales/en.yml

4
app/models/validations/property_validations.rb

@ -38,6 +38,10 @@ module Validations::PropertyValidations
record.errors.add :rsnvac, I18n.t("validations.property.rsnvac.referral_invalid")
record.errors.add :referral, I18n.t("validations.household.referral.rsnvac_non_temp")
end
if record.renewal == 0 && record.rsnvac == 14
record.errors.add :rsnvac, I18n.t("validations.property.rsnvac.not_a_renewal")
end
end
def validate_unitletas(record)

1
config/locales/en.yml

@ -141,6 +141,7 @@ en:
previous_let_social: "Property cannot have a previous let type if being let as social housing for the first time"
non_temp_accommodation: "Answer cannot be re-let to tenant who occupied the same property as temporary accommodation as this accommodation is not temporary"
referral_invalid: "Answer cannot be re-let to tenant who occupied the same property as temporary accommodation as a different source of referral for this letting"
not_a_renewal: "Reason for vacancy cannot be 'Renewal of fixed-term tenancy' if letting is not a renewal"
unittype_gn:
one_bedroom_bedsit: "A bedsit can only have one bedroom"
one_seven_bedroom_shared: "A shared house must have 1 to 7 bedrooms"

Loading…
Cancel
Save