153 changed files with 929 additions and 872 deletions
@ -1,24 +0,0 @@
|
||||
class Form::Lettings::Pages::MaxRentValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, check_answers_card_number: nil) |
||||
super(id, hsh, subsection) |
||||
@depends_on = [{ "rent_in_soft_max_range?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.rent.outside_range_title", |
||||
"arguments" => [{ |
||||
"key" => "brent", |
||||
"label" => true, |
||||
"i18n_template" => "brent", |
||||
}], |
||||
} |
||||
@informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "higher") |
||||
@check_answers_card_number = check_answers_card_number |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::MaxRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] |
||||
end |
||||
|
||||
def interruption_screen_question_ids |
||||
%w[brent period startdate uprn postcode_full la beds rent_type needstype] |
||||
end |
||||
end |
@ -1,24 +0,0 @@
|
||||
class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, check_answers_card_number: nil) |
||||
super(id, hsh, subsection) |
||||
@depends_on = [{ "rent_in_soft_min_range?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.rent.outside_range_title", |
||||
"arguments" => [{ |
||||
"key" => "brent", |
||||
"label" => true, |
||||
"i18n_template" => "brent", |
||||
}], |
||||
} |
||||
@informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "lower") |
||||
@check_answers_card_number = check_answers_card_number |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::MinRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] |
||||
end |
||||
|
||||
def interruption_screen_question_ids |
||||
%w[brent period startdate uprn postcode_full la beds rent_type needstype] |
||||
end |
||||
end |
@ -1,14 +0,0 @@
|
||||
class Form::Lettings::Pages::PropertyPostcode < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_postcode" |
||||
@depends_on = [{ "is_general_needs?" => true }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::PostcodeKnown.new(nil, nil, self), |
||||
Form::Lettings::Questions::PostcodeFull.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,35 @@
|
||||
class Form::Lettings::Pages::RentValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, check_answers_card_number: nil) |
||||
super(id, hsh, subsection) |
||||
@depends_on = [{ "rent_soft_validation_triggered?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.rent.outside_range_title", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "brent", |
||||
"label" => true, |
||||
"i18n_template" => "brent", |
||||
}, |
||||
], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.rent.informative_text", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "rent_soft_validation_higher_or_lower_text", |
||||
"label" => false, |
||||
"i18n_template" => "higher_or_lower", |
||||
}, |
||||
], |
||||
} |
||||
@check_answers_card_number = check_answers_card_number |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] |
||||
end |
||||
|
||||
def interruption_screen_question_ids |
||||
%w[brent period startdate uprn postcode_full la beds rent_type needstype] |
||||
end |
||||
end |
@ -1,15 +0,0 @@
|
||||
class Form::Lettings::Questions::MaxRentValueCheck < ::Form::Question |
||||
def initialize(id, hsh, page, check_answers_card_number:) |
||||
super(id, hsh, page) |
||||
@id = "rent_value_check" |
||||
@check_answer_label = "Total rent confirmation" |
||||
@header = "Are you sure this is correct?" |
||||
@type = "interruption_screen" |
||||
@hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "higher") |
||||
@check_answers_card_number = check_answers_card_number |
||||
@answer_options = ANSWER_OPTIONS |
||||
@hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze |
||||
end |
@ -1,15 +0,0 @@
|
||||
class Form::Lettings::Questions::PostcodeFull < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "postcode_full" |
||||
@check_answer_label = "Postcode" |
||||
@header = "What is the property’s postcode?" |
||||
@type = "text" |
||||
@width = 5 |
||||
@inferred_check_answers_value = [{ "condition" => { "postcode_known" => 0 }, "value" => "Not known" }] |
||||
@check_answers_card_number = 0 |
||||
@hint_text = "" |
||||
@inferred_answers = { "la" => { "is_la_inferred" => true } } |
||||
@disable_clearing_if_not_routed_or_dynamic_answer_options = true |
||||
end |
||||
end |
@ -1,17 +0,0 @@
|
||||
class Form::Lettings::Questions::PostcodeKnown < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "postcode_known" |
||||
@check_answer_label = "Do you know the property postcode?" |
||||
@header = "Do you know the property’s postcode?" |
||||
@type = "radio" |
||||
@check_answers_card_number = 0 |
||||
@hint_text = "" |
||||
@answer_options = ANSWER_OPTIONS |
||||
@disable_clearing_if_not_routed_or_dynamic_answer_options = true |
||||
@conditional_for = { "postcode_full" => [1] } |
||||
@hidden_in_check_answers = { "depends_on" => [{ "postcode_known" => 0 }, { "postcode_known" => 1 }] } |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze |
||||
end |
@ -1,11 +1,11 @@
|
||||
class Form::Lettings::Questions::MinRentValueCheck < ::Form::Question |
||||
class Form::Lettings::Questions::RentValueCheck < ::Form::Question |
||||
def initialize(id, hsh, page, check_answers_card_number:) |
||||
super(id, hsh, page) |
||||
@id = "rent_value_check" |
||||
@check_answer_label = "Total rent confirmation" |
||||
@header = "Are you sure this is correct?" |
||||
@type = "interruption_screen" |
||||
@hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "lower") |
||||
@hint_text = I18n.t("soft_validations.rent.hint_text") |
||||
@check_answers_card_number = check_answers_card_number |
||||
@answer_options = ANSWER_OPTIONS |
||||
@hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } |
@ -1,13 +0,0 @@
|
||||
class Form::Sales::Pages::Postcode < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_postcode" |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::PostcodeKnown.new(nil, nil, self), |
||||
Form::Sales::Questions::Postcode.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -1,22 +0,0 @@
|
||||
class Form::Sales::Questions::Postcode < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "postcode_full" |
||||
@check_answer_label = "Property’s postcode" |
||||
@header = "Postcode" |
||||
@type = "text" |
||||
@width = 5 |
||||
@inferred_check_answers_value = [{ |
||||
"condition" => { |
||||
"pcodenk" => 1, |
||||
}, |
||||
"value" => "Not known", |
||||
}] |
||||
@inferred_answers = { |
||||
"la" => { |
||||
"is_la_inferred" => true, |
||||
}, |
||||
} |
||||
@disable_clearing_if_not_routed_or_dynamic_answer_options = true |
||||
end |
||||
end |
@ -1,29 +0,0 @@
|
||||
class Form::Sales::Questions::PostcodeKnown < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "pcodenk" |
||||
@check_answer_label = "Property’s postcode" |
||||
@header = "Do you know the property’s postcode?" |
||||
@type = "radio" |
||||
@answer_options = ANSWER_OPTIONS |
||||
@conditional_for = { |
||||
"postcode_full" => [0], |
||||
} |
||||
@hidden_in_check_answers = { |
||||
"depends_on" => [ |
||||
{ |
||||
"pcodenk" => 0, |
||||
}, |
||||
{ |
||||
"pcodenk" => 1, |
||||
}, |
||||
], |
||||
} |
||||
@disable_clearing_if_not_routed_or_dynamic_answer_options = true |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { |
||||
"0" => { "value" => "Yes" }, |
||||
"1" => { "value" => "No" }, |
||||
}.freeze |
||||
end |
@ -1,26 +0,0 @@
|
||||
class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "la_known" |
||||
@check_answer_label = "Local authority known" |
||||
@header = "Do you know the property’s local authority?" |
||||
@type = "radio" |
||||
@answer_options = ANSWER_OPTIONS |
||||
@conditional_for = { "la" => [1] } |
||||
@hidden_in_check_answers = { |
||||
"depends_on" => [ |
||||
{ |
||||
"la_known" => 1, |
||||
}, |
||||
], |
||||
} |
||||
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { |
||||
"1" => { "value" => "Yes" }, |
||||
"0" => { "value" => "No" }, |
||||
}.freeze |
||||
|
||||
QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze |
||||
end |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue