4 changed files with 74 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||||||
|
# frozen_string_literal: true |
||||||
|
|
||||||
|
class Form::Lettings::Pages::LeadTenantSexRegisteredAtBirth1 < ::Form::Page |
||||||
|
def initialize(id, hsh, subsection) |
||||||
|
super |
||||||
|
@id = "lead_tenant_sex_registered_at_birth" |
||||||
|
@depends_on = [{ "declaration" => 1 }] |
||||||
|
end |
||||||
|
|
||||||
|
def questions |
||||||
|
@questions ||= [ |
||||||
|
Form::Sales::Questions::SexRegisteredAtBirth1.new(nil, nil, self), |
||||||
|
] |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
# frozen_string_literal: true |
||||||
|
|
||||||
|
class Form::Lettings::Pages::PersonSexRegisteredAtBirth < ::Form::Page |
||||||
|
def initialize(id, hsh, subsection, person_index:) |
||||||
|
super(id, hsh, subsection) |
||||||
|
@id = "person_#{person_index}_sex_registered_at_birth" |
||||||
|
@person_index = person_index |
||||||
|
@depends_on = [ |
||||||
|
{ "details_known_#{person_index}" => 0 }, |
||||||
|
] |
||||||
|
end |
||||||
|
|
||||||
|
def questions |
||||||
|
@questions ||= [ |
||||||
|
Form::Lettings::Questions::PersonSexRegisteredAtBirth.new("sexrab#{@person_index}", nil, self, person_index: @person_index), |
||||||
|
] |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
# frozen_string_literal: true |
||||||
|
|
||||||
|
class Form::Lettings::Questions::PersonSexRegisteredAtBirth < ::Form::Question |
||||||
|
def initialize(id, hsh, page, person_index:) |
||||||
|
super(id, hsh, page) |
||||||
|
@type = "radio" |
||||||
|
@check_answers_card_number = person_index |
||||||
|
@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 = { |
||||||
|
"F" => { "value" => "Female" }, |
||||||
|
"M" => { "value" => "Male" }, |
||||||
|
"divider" => { "value" => true }, |
||||||
|
"R" => { "value" => "Person prefers not to say" }, |
||||||
|
}.freeze |
||||||
|
|
||||||
|
QUESTION_NUMBER_FROM_YEAR = { 2026 => 0 }.freeze |
||||||
|
end |
||||||
@ -0,0 +1,21 @@ |
|||||||
|
# frozen_string_literal: true |
||||||
|
|
||||||
|
class Form::Lettings::Questions::SexRegisteredAtBirth1 < ::Form::Question |
||||||
|
def initialize(id, hsh, page) |
||||||
|
super |
||||||
|
@id = "sexrab1" |
||||||
|
@type = "radio" |
||||||
|
@check_answers_card_number = 1 |
||||||
|
@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 = { |
||||||
|
"F" => { "value" => "Female" }, |
||||||
|
"M" => { "value" => "Male" }, |
||||||
|
"divider" => { "value" => true }, |
||||||
|
"R" => { "value" => "Buyer prefers not to say" }, |
||||||
|
}.freeze |
||||||
|
|
||||||
|
QUESTION_NUMBER_FROM_YEAR = { 2026 => 0 }.freeze |
||||||
|
end |
||||||
Loading…
Reference in new issue