17 lines
565 B
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
|
|
|