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.

50 lines
2.5 KiB

class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
def initialize(id, hsh, section)
super
@id = "property_information"
@label = "Property information"
@depends_on = [{ "setup_completed?" => true }]
end
def pages
@pages ||= [
Form::Sales::Pages::PropertyNumberOfBedrooms.new(nil, nil, self),
CLDC-868 purchase price validations PO review (#1285) * feat: wip behaviour * feat: hide in cya * feat: show in cya * feat: purchase price range service and rake task * feat: fix hodate validation and use purchase price ranges * db:update * feat: more saledate -> exdate fixing * feat: add min and max conditional text * refactor: linting * refactor: remove duplicated behaviour * refactor: linting * feat: update tests * test: add validation tests * test: add purchase price rangeimport service tests * refactor: linting * feat: allow translation text and title text to display currency formatting even when not a log field * feat: use i18n * feat: update i18n * refactor: pratical -> practical * refactor: linting * refactor: revert unnecessary change * feat: respond to PR comments * tests: update after merge * feat: improve currency interruption screen display * feat: update docs * feat: fix typo * feat: missing end after merge * feat: respond to PR comments * feat: add soft validation to beds and la pages * db:update * feat: revert saledate/exdate work * feat: revert saledate/exdate work * feat: revert saledate/exdate work * feat: revert saledate/exdate work * feat: revert saledate/exdate work * feat: PO comment responses * tests: update * refactor: linting * refactor: simplification * refactor: railsification * test: fix * refactor: use number_to_currency units * refactor: remove duplicated copy * db:update * feat: add value check for discounted and outright sale * feat: rename files * test: update * test: update * test: update * db: update
2 years ago
Form::Sales::Pages::AboutPriceValueCheck.new("about_price_bedrooms_value_check", nil, self),
Form::Sales::Pages::PropertyUnitType.new(nil, nil, self),
Form::Sales::Pages::MonthlyChargesValueCheck.new("monthly_charges_property_type_value_check", nil, self),
Form::Sales::Pages::PercentageDiscountValueCheck.new("percentage_discount_proptype_value_check", nil, self),
Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self),
uprn_questions,
postcode_and_la_questions,
CLDC-868 purchase price validations PO review (#1285) * feat: wip behaviour * feat: hide in cya * feat: show in cya * feat: purchase price range service and rake task * feat: fix hodate validation and use purchase price ranges * db:update * feat: more saledate -> exdate fixing * feat: add min and max conditional text * refactor: linting * refactor: remove duplicated behaviour * refactor: linting * feat: update tests * test: add validation tests * test: add purchase price rangeimport service tests * refactor: linting * feat: allow translation text and title text to display currency formatting even when not a log field * feat: use i18n * feat: update i18n * refactor: pratical -> practical * refactor: linting * refactor: revert unnecessary change * feat: respond to PR comments * tests: update after merge * feat: improve currency interruption screen display * feat: update docs * feat: fix typo * feat: missing end after merge * feat: respond to PR comments * feat: add soft validation to beds and la pages * db:update * feat: revert saledate/exdate work * feat: revert saledate/exdate work * feat: revert saledate/exdate work * feat: revert saledate/exdate work * feat: revert saledate/exdate work * feat: PO comment responses * tests: update * refactor: linting * refactor: simplification * refactor: railsification * test: fix * refactor: use number_to_currency units * refactor: remove duplicated copy * db:update * feat: add value check for discounted and outright sale * feat: rename files * test: update * test: update * test: update * db: update
2 years ago
Form::Sales::Pages::AboutPriceValueCheck.new("about_price_la_value_check", nil, self),
Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self),
].flatten.compact
end
def uprn_questions
if form.start_date.year >= 2023
[
Form::Sales::Pages::Uprn.new(nil, nil, self),
Form::Sales::Pages::UprnConfirmation.new(nil, nil, self),
Form::Sales::Pages::Address.new(nil, nil, self),
Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self),
Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil),
]
end
end
def postcode_and_la_questions
if form.start_date.year < 2023
[
Form::Sales::Pages::Postcode.new(nil, nil, self),
Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self),
Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil),
]
end
end
end