Browse Source

CLDC-4166: question updaets

pull/3194/head
Nat Dean-Lewis 3 weeks ago
parent
commit
7804ab8ade
  1. 8
      app/models/derived_variables/sales_log_variables.rb
  2. 6
      app/models/form/sales/pages/person_known.rb
  3. 4
      app/models/form/sales/questions/number_of_others_in_property.rb
  4. 2
      app/services/bulk_upload/sales/year2026/row_parser.rb
  5. 12
      config/locales/forms/2026/sales/household_characteristics.en.yml

8
app/models/derived_variables/sales_log_variables.rb

@ -152,8 +152,12 @@ private
def number_of_household_members
return unless hholdcount.present? && jointpur.present?
number_of_buyers = joint_purchase? ? 2 : 1
hholdcount + number_of_buyers
if form.start_year_2026_or_later?
hholdcount
else
number_of_buyers = joint_purchase? ? 2 : 1
hholdcount + number_of_buyers
end
end
def total_elder

6
app/models/form/sales/pages/person_known.rb

@ -16,18 +16,18 @@ class Form::Sales::Pages::PersonKnown < Form::Sales::Pages::Person
[{ "not_joint_purchase?" => true,
"hholdcount" => {
"operator" => ">=",
"operand" => 1,
"operand" => form.start_year_2026_or_later? ? 2 : 1,
} }]
else
[{ "not_joint_purchase?" => true,
"hholdcount" => {
"operator" => ">=",
"operand" => @person_index - 1,
"operand" => form.start_year_2026_or_later? ? @person_index : @person_index - 1,
} },
{ "joint_purchase?" => true,
"hholdcount" => {
"operator" => ">=",
"operand" => @person_index - 2,
"operand" => form.start_year_2026_or_later? ? @person_index : @person_index - 2,
} }]
end
end

4
app/models/form/sales/questions/number_of_others_in_property.rb

@ -5,11 +5,11 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question
@copy_key = joint_purchase ? "sales.household_characteristics.hholdcount.joint_purchase" : "sales.household_characteristics.hholdcount.not_joint_purchase"
@type = "numeric"
@width = 2
@min = 0
@min = form.start_year_2026_or_later? ? 1 : 0
@max = 15
@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 = { 2023 => 35, 2024 => 37, 2025 => 35 }.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 37, 2025 => 35, 2026 => 35 }.freeze
end

2
app/services/bulk_upload/sales/year2026/row_parser.rb

@ -47,7 +47,7 @@ class BulkUpload::Sales::Year2026::RowParser
field_38: "What is buyer 2’s nationality?",
field_39: "What is buyer 2 or person 2’s working situation?",
field_40: "Will buyer 2 live in the property?",
field_41: "Besides the buyers, how many people will live in the property?",
field_41: "In total, how many people live in the property?",
field_42: "Is person 3 the partner of buyer 1?",
field_43: "Age of person 3",

12
config/locales/forms/2026/sales/household_characteristics.en.yml

@ -242,16 +242,16 @@ en:
hholdcount:
joint_purchase:
page_header: ""
check_answer_label: "Number of other people living in the property"
check_answer_label: "Number of people living in the property"
check_answer_prompt: ""
hint_text: "Include all people living in the property who are not the buyers. In later questions you will only be asked for details about the first 4 other people for a joint purchase."
question_text: "Besides the buyers, how many other people live or will live in the property?"
hint_text: "Include all people who are living or will live in the property."
question_text: "In total, how many people live in the property?"
not_joint_purchase:
page_header: ""
check_answer_label: "Number of other people living in the property"
check_answer_label: "Number of people living in the property"
check_answer_prompt: ""
hint_text: "Include all people living in the property who are not the buyer. In later questions you will only be asked for details about the first 5 other people for a sole purchase."
question_text: "Besides the buyer, how many other people live or will live in the property?"
hint_text: "Include all people who are living or will live in the property."
question_text: "In total, how many people live in the property?"
details_known_2:
page_header: ""

Loading…
Cancel
Save