diff --git a/app/models/form/lettings/pages/lead_tenant_sex_registered_at_birth1.rb b/app/models/form/lettings/pages/lead_tenant_sex_registered_at_birth1.rb new file mode 100644 index 000000000..2e80bf598 --- /dev/null +++ b/app/models/form/lettings/pages/lead_tenant_sex_registered_at_birth1.rb @@ -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 diff --git a/app/models/form/lettings/pages/person_sex_registered_at_birth.rb b/app/models/form/lettings/pages/person_sex_registered_at_birth.rb new file mode 100644 index 000000000..ea1586f5e --- /dev/null +++ b/app/models/form/lettings/pages/person_sex_registered_at_birth.rb @@ -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 diff --git a/app/models/form/lettings/questions/person_sex_registered_at_birth.rb b/app/models/form/lettings/questions/person_sex_registered_at_birth.rb new file mode 100644 index 000000000..3d8db0312 --- /dev/null +++ b/app/models/form/lettings/questions/person_sex_registered_at_birth.rb @@ -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 diff --git a/app/models/form/lettings/questions/sex_registered_at_birth1.rb b/app/models/form/lettings/questions/sex_registered_at_birth1.rb new file mode 100644 index 000000000..791504c9d --- /dev/null +++ b/app/models/form/lettings/questions/sex_registered_at_birth1.rb @@ -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