Browse Source

Make frombeds optional

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

7
app/models/sales_log.rb

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

1
spec/models/sales_log_spec.rb

@ -63,6 +63,7 @@ RSpec.describe SalesLog, type: :model do
othtype
proplen
mortlen
frombeds
])
end
end

Loading…
Cancel
Save