23 changed files with 288 additions and 15 deletions
@ -0,0 +1,17 @@
|
||||
class Form::Sales::Pages::MonthlyRentStaircasing < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "monthly_rent_staircasing" |
||||
@copy_key = "sales.sale_information.mrent_staircasing" |
||||
@depends_on = [{ |
||||
"stairowned_100?" => false, |
||||
}] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::MonthlyRentBeforeStaircasing.new(nil, nil, self), |
||||
Form::Sales::Questions::MonthlyRentAfterStaircasing.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,16 @@
|
||||
class Form::Sales::Pages::MonthlyRentStaircasingOwned < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "monthly_rent_staircasing_owned" |
||||
@copy_key = "sales.sale_information.mrent_staircasing" |
||||
@depends_on = [{ |
||||
"stairowned_100?" => true, |
||||
}] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::MonthlyRentBeforeStaircasing.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,15 @@
|
||||
class Form::Sales::Pages::StaircaseFirstTime < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super(id, hsh, subsection) |
||||
@id = "staircase_first_time" |
||||
@depends_on = [{ |
||||
"staircase" => 1, |
||||
}] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::StaircaseFirstTime.new(nil, nil, self), |
||||
].compact |
||||
end |
||||
end |
@ -0,0 +1,15 @@
|
||||
class Form::Sales::Pages::StaircaseInitialDate < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super(id, hsh, subsection) |
||||
@id = "staircase_initial_date" |
||||
@depends_on = [{ |
||||
"is_firststair?" => true, |
||||
}] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::StaircaseInitialDate.new(nil, nil, self), |
||||
].compact |
||||
end |
||||
end |
@ -0,0 +1,18 @@
|
||||
class Form::Sales::Pages::StaircasePrevious < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super(id, hsh, subsection) |
||||
@id = "staircase_previous" |
||||
@copy_key = "sales.sale_information.stairprevious" |
||||
@depends_on = [{ |
||||
"is_firststair?" => false, |
||||
}] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::StaircaseCount.new(nil, nil, self), |
||||
Form::Sales::Questions::StaircaseLastDate.new(nil, nil, self), |
||||
Form::Sales::Questions::StaircaseInitialDate.new(nil, nil, self), |
||||
].compact |
||||
end |
||||
end |
@ -0,0 +1,17 @@
|
||||
class Form::Sales::Pages::StaircaseSale < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super(id, hsh, subsection) |
||||
@id = "staircase_sale" |
||||
@copy_key = form.start_year_2025_or_later? ? "sales.sale_information.staircasesale" : "sales.sale_information.about_staircasing.staircasesale" |
||||
@depends_on = [{ |
||||
"staircase" => 1, |
||||
"stairowned" => 100, |
||||
}] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::StaircaseSale.new(nil, nil, self) |
||||
].compact |
||||
end |
||||
end |
@ -0,0 +1,15 @@
|
||||
class Form::Sales::Questions::MonthlyRentAfterStaircasing < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "mrent" |
||||
@copy_key = "sales.sale_information.mrent_staircasing.poststaircasing" |
||||
@type = "numeric" |
||||
@min = 0 |
||||
@step = 0.01 |
||||
@width = 5 |
||||
@prefix = "£" |
||||
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] |
||||
end |
||||
|
||||
QUESTION_NUMBER_FROM_YEAR = { 2025 => 99 }.freeze |
||||
end |
@ -0,0 +1,15 @@
|
||||
class Form::Sales::Questions::MonthlyRentBeforeStaircasing < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "mrentprestaircasing" |
||||
@copy_key = "sales.sale_information.mrent_staircasing.prestaircasing" |
||||
@type = "numeric" |
||||
@min = 0 |
||||
@step = 0.01 |
||||
@width = 5 |
||||
@prefix = "£" |
||||
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] |
||||
end |
||||
|
||||
QUESTION_NUMBER_FROM_YEAR = { 2025 => 98 }.freeze |
||||
end |
@ -0,0 +1,14 @@
|
||||
class Form::Sales::Questions::StaircaseCount < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "numstair" |
||||
@copy_key = "sales.sale_information.stairprevious.numstair" |
||||
@type = "numeric" |
||||
@width = 2 |
||||
@min = 2 |
||||
@step = 1 |
||||
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] |
||||
end |
||||
|
||||
QUESTION_NUMBER_FROM_YEAR = { 2025 => 82 }.freeze |
||||
end |
@ -0,0 +1,17 @@
|
||||
class Form::Sales::Questions::StaircaseFirstTime < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "firststair" |
||||
@copy_key = "sales.sale_information.firststair" |
||||
@type = "radio" |
||||
@answer_options = ANSWER_OPTIONS |
||||
@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" }, |
||||
"2" => { "value" => "No" }, |
||||
}.freeze |
||||
|
||||
QUESTION_NUMBER_FROM_YEAR = { 2025 => 81 }.freeze |
||||
end |
@ -0,0 +1,11 @@
|
||||
class Form::Sales::Questions::StaircaseInitialDate < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "initialpurchase" |
||||
@copy_key = "sales.sale_information.stairprevious.initialpurchase" |
||||
@type = "date" |
||||
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] |
||||
end |
||||
|
||||
QUESTION_NUMBER_FROM_YEAR = { 2025 => 83 }.freeze |
||||
end |
@ -0,0 +1,11 @@
|
||||
class Form::Sales::Questions::StaircaseLastDate < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "lasttransaction" |
||||
@copy_key = "sales.sale_information.stairprevious.lasttransaction" |
||||
@type = "date" |
||||
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] |
||||
end |
||||
|
||||
QUESTION_NUMBER_FROM_YEAR = { 2025 => 83 }.freeze |
||||
end |
@ -0,0 +1,35 @@
|
||||
class Form::Sales::Subsections::SharedOwnershipStaircasingTransaction < ::Form::Subsection |
||||
def initialize(id, hsh, section) |
||||
super |
||||
@id = "shared_ownership_staircasing_transaction" |
||||
@label = "Shared ownership - staircasing transaction" |
||||
@depends_on = [{ "ownershipsch" => 1, "setup_completed?" => true, "staircase" => 1 }] |
||||
end |
||||
|
||||
def pages |
||||
@pages ||= [ |
||||
(Form::Sales::Pages::Staircase.new(nil, nil, self) unless form.start_year_2025_or_later?), |
||||
Form::Sales::Pages::AboutStaircase.new("about_staircasing_joint_purchase", nil, self, joint_purchase: true), |
||||
Form::Sales::Pages::AboutStaircase.new("about_staircasing_not_joint_purchase", nil, self, joint_purchase: false), |
||||
Form::Sales::Pages::StaircaseSale.new(nil, nil, self), |
||||
Form::Sales::Pages::StaircaseBoughtValueCheck.new(nil, nil, self), |
||||
Form::Sales::Pages::StaircaseOwnedValueCheck.new("staircase_owned_value_check_joint_purchase", nil, self, joint_purchase: true), |
||||
Form::Sales::Pages::StaircaseOwnedValueCheck.new("staircase_owned_value_check_not_joint_purchase", nil, self, joint_purchase: false), |
||||
Form::Sales::Pages::StaircaseFirstTime.new(nil, nil, self), |
||||
Form::Sales::Pages::StaircasePrevious.new(nil, nil, self), |
||||
Form::Sales::Pages::StaircaseInitialDate.new(nil, nil, self), |
||||
Form::Sales::Pages::ValueSharedOwnership.new("value_shared_ownership_staircasing", nil, self), |
||||
Form::Sales::Pages::AboutPriceValueCheck.new("about_price_shared_ownership_value_check", nil, self), |
||||
Form::Sales::Pages::Equity.new(nil, nil, self), |
||||
Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_equity_value_check", nil, self), |
||||
Form::Sales::Pages::Mortgageused.new("mortgage_used_shared_ownership", nil, self, ownershipsch: 1), |
||||
Form::Sales::Pages::MonthlyRentStaircasingOwned.new(nil, nil, self), |
||||
Form::Sales::Pages::MonthlyRentStaircasing.new(nil, nil, self), |
||||
Form::Sales::Pages::MonthlyChargesValueCheck.new("monthly_charges_shared_ownership_value_check", nil, self), |
||||
].compact |
||||
end |
||||
|
||||
def displayed_in_tasklist?(log) |
||||
(log.ownershipsch.nil? || log.ownershipsch == 1) && (log.staircase.nil? || log.staircase == 1) |
||||
end |
||||
end |
Loading…
Reference in new issue