Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
565 B

module Validations::Sales::SaleInformationValidations
def validate_deposit_range(record)
return if record.deposit.blank?
unless record.deposit >= 0 && record.deposit <= 999_999
record.errors.add :deposit, "Cash deposit must be £0 - £999,999"
end
end
def validate_pratical_completion_date_before_saledate(record)
return if record.saledate.blank? || record.hodate.blank?
unless record.saledate > record.hodate
record.errors.add :hodate, "Practical completion or handover date must be before exchange date"
end
end
end