Browse Source

refactor and rename copy variables

pull/3022/head
Carolyn 4 weeks ago
parent
commit
2d7eadef5a
  1. 2
      app/models/form/sales/pages/estate_management_fee.rb
  2. 4
      app/models/form/sales/pages/leasehold_charges.rb
  3. 4
      app/models/form/sales/questions/has_leasehold_charges.rb
  4. 2
      app/models/form/sales/questions/has_management_fee.rb
  5. 4
      app/models/form/sales/questions/leasehold_charges.rb
  6. 2
      app/models/form/sales/questions/management_fee.rb
  7. 29
      config/locales/forms/2025/sales/sale_information.en.yml

2
app/models/form/sales/pages/estate_management_fee.rb

@ -1,7 +1,7 @@
class Form::Sales::Pages::EstateManagementFee < ::Form::Page class Form::Sales::Pages::EstateManagementFee < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@copy_key = "sales.sale_information.management_fee" @copy_key = "sales.sale_information.monthly_charges.shared_ownership.management_fee"
end end
def questions def questions

4
app/models/form/sales/pages/leasehold_charges.rb

@ -8,9 +8,9 @@ class Form::Sales::Pages::LeaseholdCharges < ::Form::Page
if form.start_year_2025_or_later? if form.start_year_2025_or_later?
case @ownershipsch case @ownershipsch
when 1 when 1
"sales.sale_information.leaseholdcharges.shared_ownership" "sales.sale_information.monthly_charges.shared_ownership.service_charges"
when 2 when 2
"sales.sale_information.leaseholdcharges.discounted_ownership" "sales.sale_information.monthly_charges.discounted_ownership.leasehold_charges"
end end
else else
"sales.sale_information.leaseholdcharges" "sales.sale_information.leaseholdcharges"

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

@ -22,9 +22,9 @@ class Form::Sales::Questions::HasLeaseholdCharges < ::Form::Question
if form.start_year_2025_or_later? if form.start_year_2025_or_later?
case @ownershipsch case @ownershipsch
when 1 when 1
"sales.sale_information.leaseholdcharges.shared_ownership.has_mscharge" "sales.sale_information.monthly_charges.shared_ownership.service_charges.has_mscharge"
when 2 when 2
"sales.sale_information.leaseholdcharges.discounted_ownership.has_mscharge" "sales.sale_information.monthly_charges.discounted_ownership.leasehold_charges.has_mscharge"
end end
else else
"sales.sale_information.leaseholdcharges.has_mscharge" "sales.sale_information.leaseholdcharges.has_mscharge"

2
app/models/form/sales/questions/has_management_fee.rb

@ -2,7 +2,7 @@ class Form::Sales::Questions::HasManagementFee < ::Form::Question
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "has_management_fee" @id = "has_management_fee"
@copy_key = "sales.sale_information.management_fee.has_management_fee" @copy_key = "sales.sale_information.monthly_charges.shared_ownership.management_fee.has_management_fee"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { @conditional_for = {

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

@ -15,9 +15,9 @@ class Form::Sales::Questions::LeaseholdCharges < ::Form::Question
if form.start_year_2025_or_later? if form.start_year_2025_or_later?
case @ownershipsch case @ownershipsch
when 1 when 1
"sales.sale_information.leaseholdcharges.shared_ownership.mscharge" "sales.sale_information.monthly_charges.shared_ownership.service_charges.mscharge"
when 2 when 2
"sales.sale_information.leaseholdcharges.discounted_ownership.mscharge" "sales.sale_information.monthly_charges.discounted_ownership.leasehold_charges.mscharge"
end end
else else
"sales.sale_information.leaseholdcharges.mscharge" "sales.sale_information.leaseholdcharges.mscharge"

2
app/models/form/sales/questions/management_fee.rb

@ -2,7 +2,7 @@ class Form::Sales::Questions::ManagementFee < ::Form::Question
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "management_fee" @id = "management_fee"
@copy_key = "sales.sale_information.management_fee.management_fee" @copy_key = "sales.sale_information.monthly_charges.shared_ownership.management_fee.management_fee"
@type = "numeric" @type = "numeric"
@min = 1 @min = 1
@step = 0.01 @step = 0.01

29
config/locales/forms/2025/sales/sale_information.en.yml

@ -245,8 +245,9 @@ en:
hint_text: "Amount paid before any charges" hint_text: "Amount paid before any charges"
question_text: "What is the basic monthly rent after staircasing?" question_text: "What is the basic monthly rent after staircasing?"
leaseholdcharges: monthly_charges:
shared_ownership: shared_ownership:
service_charges:
page_header: "" page_header: ""
has_mscharge: has_mscharge:
check_answer_label: "Property service charges" check_answer_label: "Property service charges"
@ -258,7 +259,20 @@ en:
check_answer_prompt: "" check_answer_prompt: ""
hint_text: "" hint_text: ""
question_text: "Enter the total monthly charge" question_text: "Enter the total monthly charge"
management_fee:
page_header: ""
has_management_fee:
check_answer_label: "Monthly estate management fee"
check_answer_prompt: "Tell us if the property has an estate management fee"
hint_text: "Estate management fees are typically used for the maintenance of communal gardens, payments, private roads, car parks and/or play areas within new build estates."
question_text: "Does the property have an estate management fee?"
management_fee:
check_answer_label: "Monthly estate management fee"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter the total monthly management fee"
discounted_ownership: discounted_ownership:
leasehold_charges:
page_header: "" page_header: ""
has_mscharge: has_mscharge:
check_answer_label: "Property leasehold charges" check_answer_label: "Property leasehold charges"
@ -298,16 +312,3 @@ en:
check_answer_prompt: "" check_answer_prompt: ""
hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy" hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy"
question_text: "What was the amount of any loan, grant, discount or subsidy given?" question_text: "What was the amount of any loan, grant, discount or subsidy given?"
management_fee:
page_header: ""
has_management_fee:
check_answer_label: "Monthly estate management fee"
check_answer_prompt: "Tell us if the property has an estate management fee"
hint_text: "Estate management fees are typically used for the maintenance of communal gardens, payments, private roads, car parks and/or play areas within new build estates."
question_text: "Does the property have an estate management fee?"
management_fee:
check_answer_label: "Monthly estate management fee"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter the total monthly management fee"

Loading…
Cancel
Save