Browse Source

Make mortlen optional for 22/23

pull/1443/head
Kat 3 years ago
parent
commit
e32920bd87
  1. 7
      app/models/sales_log.rb
  2. 1
      spec/models/sales_log_spec.rb

7
app/models/sales_log.rb

@ -78,6 +78,7 @@ class SalesLog < Log
def dynamically_not_required def dynamically_not_required
not_required = [] not_required = []
not_required << "proplen" if proplen_optional? not_required << "proplen" if proplen_optional?
not_required << "mortlen" if mortlen_optional?
not_required |= %w[address_line2 county postcode_full] if saledate && saledate.year >= 2023 not_required |= %w[address_line2 county postcode_full] if saledate && saledate.year >= 2023
@ -90,6 +91,12 @@ class SalesLog < Log
collection_start_year < 2023 collection_start_year < 2023
end end
def mortlen_optional?
return false unless collection_start_year
collection_start_year < 2023
end
def not_started? def not_started?
status == "not_started" status == "not_started"
end end

1
spec/models/sales_log_spec.rb

@ -60,6 +60,7 @@ RSpec.describe SalesLog, type: :model do
monthly_charges_value_check monthly_charges_value_check
old_persons_shared_ownership_value_check old_persons_shared_ownership_value_check
proplen proplen
mortlen
]) ])
end end
end end

Loading…
Cancel
Save