From 707f6925dbfcc7def3dfa1e56c911401c7ba6fbc Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 1 Feb 2023 12:16:10 +0000 Subject: [PATCH] Backfill ethnic questions --- .../lead_tenant_ethnic_background_arab.rb | 2 +- .../lead_tenant_ethnic_background_asian.rb | 2 +- .../lead_tenant_ethnic_background_black.rb | 2 +- .../lead_tenant_ethnic_background_mixed.rb | 2 +- .../lead_tenant_ethnic_background_white.rb | 2 +- .../form/lettings/questions/ethnic_arab.rb | 21 +++++++++++++ .../form/lettings/questions/ethnic_asian.rb | 30 +++++++++++++++++++ .../form/lettings/questions/ethnic_black.rb | 24 +++++++++++++++ .../form/lettings/questions/ethnic_mixed.rb | 27 +++++++++++++++++ .../questions/{ethnic.rb => ethnic_white.rb} | 9 ++++-- 10 files changed, 114 insertions(+), 7 deletions(-) create mode 100644 app/models/form/lettings/questions/ethnic_arab.rb create mode 100644 app/models/form/lettings/questions/ethnic_asian.rb create mode 100644 app/models/form/lettings/questions/ethnic_black.rb create mode 100644 app/models/form/lettings/questions/ethnic_mixed.rb rename app/models/form/lettings/questions/{ethnic.rb => ethnic_white.rb} (60%) diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb index 460f1712b..526ade059 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb @@ -8,6 +8,6 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundArab < ::Form::Page end def questions - @questions ||= [Form::Lettings::Questions::Ethnic.new(nil, nil, self)] + @questions ||= [Form::Lettings::Questions::EthnicArab.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb index 7ccafd6d2..cf607cb29 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb @@ -8,6 +8,6 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundAsian < ::Form::Page end def questions - @questions ||= [Form::Lettings::Questions::Ethnic.new(nil, nil, self)] + @questions ||= [Form::Lettings::Questions::EthnicAsian.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb index 2e9eec595..54ba23b7f 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb @@ -8,6 +8,6 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundBlack < ::Form::Page end def questions - @questions ||= [Form::Lettings::Questions::Ethnic.new(nil, nil, self)] + @questions ||= [Form::Lettings::Questions::EthnicBlack.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb index 732f46197..15155f83e 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb @@ -8,6 +8,6 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundMixed < ::Form::Page end def questions - @questions ||= [Form::Lettings::Questions::Ethnic.new(nil, nil, self)] + @questions ||= [Form::Lettings::Questions::EthnicMixed.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb index 8f164295b..933cc428f 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb @@ -8,6 +8,6 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite < ::Form::Page end def questions - @questions ||= [Form::Lettings::Questions::Ethnic.new(nil, nil, self)] + @questions ||= [Form::Lettings::Questions::EthnicWhite.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/questions/ethnic_arab.rb b/app/models/form/lettings/questions/ethnic_arab.rb new file mode 100644 index 000000000..28b3591da --- /dev/null +++ b/app/models/form/lettings/questions/ethnic_arab.rb @@ -0,0 +1,21 @@ +class Form::Lettings::Questions::EthnicArab < ::Form::Question + def initialize(id, hsh, page) + super + @id = "ethnic" + @check_answer_label = "Lead tenant’s ethnic background" + @header = "Which of the following best describes the lead tenant’s Arab background?" + @type = "radio" + @check_answers_card_number = 1 + @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + @answer_options = ANSWER_OPTIONS + end + + ANSWER_OPTIONS = { + "19" => { + "value" => "Arab", + }, + "16" => { + "value" => "Other ethnic group", + }, + }.freeze +end diff --git a/app/models/form/lettings/questions/ethnic_asian.rb b/app/models/form/lettings/questions/ethnic_asian.rb new file mode 100644 index 000000000..96b8df9b5 --- /dev/null +++ b/app/models/form/lettings/questions/ethnic_asian.rb @@ -0,0 +1,30 @@ +class Form::Lettings::Questions::EthnicAsian < ::Form::Question + def initialize(id, hsh, page) + super + @id = "ethnic" + @check_answer_label = "Lead tenant’s ethnic background" + @header = "Which of the following best describes the lead tenant’s Asian or Asian British background?" + @type = "radio" + @check_answers_card_number = 1 + @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + @answer_options = ANSWER_OPTIONS + end + + ANSWER_OPTIONS = { + "10" => { + "value" => "Bangladeshi", + }, + "15" => { + "value" => "Chinese", + }, + "8" => { + "value" => "Indian", + }, + "9" => { + "value" => "Pakistani", + }, + "11" => { + "value" => "Any other Asian or Asian British background", + }, + }.freeze +end diff --git a/app/models/form/lettings/questions/ethnic_black.rb b/app/models/form/lettings/questions/ethnic_black.rb new file mode 100644 index 000000000..68beca8ad --- /dev/null +++ b/app/models/form/lettings/questions/ethnic_black.rb @@ -0,0 +1,24 @@ +class Form::Lettings::Questions::EthnicBlack < ::Form::Question + def initialize(id, hsh, page) + super + @id = "ethnic" + @check_answer_label = "Lead tenant’s ethnic background" + @header = "Which of the following best describes the lead tenant’s Black, African, Caribbean or Black British background?" + @type = "radio" + @check_answers_card_number = 1 + @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + @answer_options = ANSWER_OPTIONS + end + + ANSWER_OPTIONS = { + "13" => { + "value" => "African", + }, + "12" => { + "value" => "Caribbean", + }, + "14" => { + "value" => "Any other Black, African or Caribbean background", + }, + }.freeze +end diff --git a/app/models/form/lettings/questions/ethnic_mixed.rb b/app/models/form/lettings/questions/ethnic_mixed.rb new file mode 100644 index 000000000..6160e40a5 --- /dev/null +++ b/app/models/form/lettings/questions/ethnic_mixed.rb @@ -0,0 +1,27 @@ +class Form::Lettings::Questions::EthnicMixed < ::Form::Question + def initialize(id, hsh, page) + super + @id = "ethnic" + @check_answer_label = "Lead tenant’s ethnic background" + @header = "Which of the following best describes the lead tenant’s Mixed or Multiple ethnic groups background?" + @type = "radio" + @check_answers_card_number = 1 + @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + @answer_options = ANSWER_OPTIONS + end + + ANSWER_OPTIONS = { + "4" => { + "value" => "White and Black Caribbean", + }, + "5" => { + "value" => "White and Black African", + }, + "6" => { + "value" => "White and Asian", + }, + "7" => { + "value" => "Any other Mixed or Multiple ethnic background", + }, + }.freeze +end diff --git a/app/models/form/lettings/questions/ethnic.rb b/app/models/form/lettings/questions/ethnic_white.rb similarity index 60% rename from app/models/form/lettings/questions/ethnic.rb rename to app/models/form/lettings/questions/ethnic_white.rb index 9ffd06ffa..993237a44 100644 --- a/app/models/form/lettings/questions/ethnic.rb +++ b/app/models/form/lettings/questions/ethnic_white.rb @@ -1,4 +1,4 @@ -class Form::Lettings::Questions::Ethnic < ::Form::Question +class Form::Lettings::Questions::EthnicWhite < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" @@ -10,5 +10,10 @@ class Form::Lettings::Questions::Ethnic < ::Form::Question @answer_options = ANSWER_OPTIONS end - ANSWER_OPTIONS = { "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "2" => { "value" => "Irish" }, "18" => { "value" => "Gypsy or Irish Traveller" }, "3" => { "value" => "Any other White background" } }.freeze + ANSWER_OPTIONS = { + "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, + "2" => { "value" => "Irish" }, + "18" => { "value" => "Gypsy or Irish Traveller" }, + "3" => { "value" => "Any other White background" }, + }.freeze end