13 changed files with 130 additions and 40 deletions
@ -1,12 +1,20 @@ |
|||||||
class Form::Sales::Pages::BuyerInterview < ::Form::Page |
class Form::Sales::Pages::BuyerInterview < ::Form::Page |
||||||
def initialize(id, hsh, subsection) |
def initialize(id, hsh, subsection, joint_purchase:) |
||||||
super |
super(id, hsh, subsection) |
||||||
@id = "buyer_interview" |
@joint_purchase = joint_purchase |
||||||
end |
end |
||||||
|
|
||||||
def questions |
def questions |
||||||
@questions ||= [ |
@questions ||= [ |
||||||
Form::Sales::Questions::BuyerInterview.new(nil, nil, self), |
Form::Sales::Questions::BuyerInterview.new(nil, nil, self, joint_purchase: @joint_purchase), |
||||||
] |
] |
||||||
end |
end |
||||||
|
|
||||||
|
def depends_on |
||||||
|
if @joint_purchase |
||||||
|
[{ "joint_purchase?" => true }] |
||||||
|
else |
||||||
|
[{ "not_joint_purchase?" => true }] |
||||||
|
end |
||||||
|
end |
||||||
end |
end |
||||||
|
|||||||
@ -1,13 +1,21 @@ |
|||||||
class Form::Sales::Pages::PrivacyNotice < ::Form::Page |
class Form::Sales::Pages::PrivacyNotice < ::Form::Page |
||||||
def initialize(id, hsh, subsection) |
def initialize(id, hsh, subsection, joint_purchase:) |
||||||
super |
super(id, hsh, subsection) |
||||||
@id = "privacy_notice" |
|
||||||
@header = "Department for Levelling Up, Housing and Communities privacy notice" |
@header = "Department for Levelling Up, Housing and Communities privacy notice" |
||||||
|
@joint_purchase = joint_purchase |
||||||
end |
end |
||||||
|
|
||||||
def questions |
def questions |
||||||
@questions ||= [ |
@questions ||= [ |
||||||
Form::Sales::Questions::PrivacyNotice.new(nil, nil, self), |
Form::Sales::Questions::PrivacyNotice.new(nil, nil, self, joint_purchase: @joint_purchase), |
||||||
] |
] |
||||||
end |
end |
||||||
|
|
||||||
|
def depends_on |
||||||
|
if @joint_purchase |
||||||
|
[{ "joint_purchase?" => true }] |
||||||
|
else |
||||||
|
[{ "not_joint_purchase?" => true }] |
||||||
|
end |
||||||
|
end |
||||||
end |
end |
||||||
|
|||||||
Loading…
Reference in new issue