@ -49,6 +49,15 @@ class CaseLogValidator < ActiveModel::Validator
end
end
defvalidate_net_income_uc_proportion(record)
if["Full-time - 30 hours or more","Part-time - Less than 30 hours"].include?(record.tenant_economic_status)&&record.net_income_uc_proportion=="All"
record.errors.add:net_income_uc_proportion,"income is from Universal Credit, state pensions or benefits cannot be All if person works part or full time"
if["Full-time - 30 hours or more","Part-time - Less than 30 hours"].include?(person_field)&&relationship_field=="Partner"&&record.net_income_uc_proportion=="All"
record.errors.add:net_income_uc_proportion,"income is from Universal Credit, state pensions or benefits cannot be All if the partner works part or full time"