Browse Source

Fix optional field name, add validation message

pull/1247/head
Kat 3 years ago
parent
commit
ff471ed85e
  1. 2
      app/models/sales_log.rb
  2. 2
      config/locales/en.yml
  3. 2
      spec/models/sales_log_spec.rb

2
app/models/sales_log.rb

@ -35,7 +35,7 @@ class SalesLog < Log
scope :search_by, ->(param) { filter_by_id(param) }
scope :filter_by_organisation, ->(org, _user = nil) { where(owning_organisation: org) }
OPTIONAL_FIELDS = %w[purchid monthly_charges_type_value_check old_persons_shared_ownership_value_check].freeze
OPTIONAL_FIELDS = %w[purchid monthly_charges_value_check old_persons_shared_ownership_value_check].freeze
RETIREMENT_AGES = { "M" => 65, "F" => 60, "X" => 65 }.freeze
def startdate

2
config/locales/en.yml

@ -470,6 +470,8 @@ en:
shared_owhership_deposit:
title_text: "Mortgage, deposit and cash discount total should equal £%{expected_shared_ownership_deposit_value}"
old_persons_shared_ownership: "At least one buyer should be aged over 64 for Older persons’ shared ownership scheme"
monthly_charges_over_soft_max:
title_text: "The amount of monthly charges is high for this type of property and sale type"
devise:
two_factor_authentication:

2
spec/models/sales_log_spec.rb

@ -47,7 +47,7 @@ RSpec.describe SalesLog, type: :model do
let(:sales_log) { build(:sales_log) }
it "returns optional fields" do
expect(sales_log.optional_fields).to eq(%w[purchid monthly_charges_type_value_check old_persons_shared_ownership_value_check])
expect(sales_log.optional_fields).to eq(%w[purchid monthly_charges_value_check old_persons_shared_ownership_value_check])
end
end

Loading…
Cancel
Save