From bd56da1b439445326d8976532f69c038ee85315a Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 1 Feb 2023 13:18:52 +0000 Subject: [PATCH] Backfill supcharg --- .../form/lettings/pages/rent_4_weekly.rb | 2 +- .../form/lettings/pages/rent_bi_weekly.rb | 2 +- .../form/lettings/pages/rent_monthly.rb | 2 +- app/models/form/lettings/pages/rent_weekly.rb | 2 +- .../lettings/questions/supcharg_4_weekly.rb | 19 +++++++++++++++++++ .../lettings/questions/supcharg_bi_weekly.rb | 19 +++++++++++++++++++ .../{supcharg.rb => supcharg_monthly.rb} | 2 +- .../lettings/questions/supcharg_weekly.rb | 19 +++++++++++++++++++ 8 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 app/models/form/lettings/questions/supcharg_4_weekly.rb create mode 100644 app/models/form/lettings/questions/supcharg_bi_weekly.rb rename app/models/form/lettings/questions/{supcharg.rb => supcharg_monthly.rb} (88%) create mode 100644 app/models/form/lettings/questions/supcharg_weekly.rb diff --git a/app/models/form/lettings/pages/rent_4_weekly.rb b/app/models/form/lettings/pages/rent_4_weekly.rb index d659264d3..ea7a92233 100644 --- a/app/models/form/lettings/pages/rent_4_weekly.rb +++ b/app/models/form/lettings/pages/rent_4_weekly.rb @@ -11,7 +11,7 @@ class Form::Lettings::Pages::Rent4Weekly < ::Form::Page @questions ||= [Form::Lettings::Questions::Brent4Weekly.new(nil, nil, self), Form::Lettings::Questions::Scharge4Weekly.new(nil, nil, self), Form::Lettings::Questions::Pscharge4Weekly.new(nil, nil, self), - Form::Lettings::Questions::Supcharg.new(nil, nil, self), + Form::Lettings::Questions::Supcharg4Weekly.new(nil, nil, self), Form::Lettings::Questions::Tcharge.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/rent_bi_weekly.rb b/app/models/form/lettings/pages/rent_bi_weekly.rb index 552d49f45..95856ac8f 100644 --- a/app/models/form/lettings/pages/rent_bi_weekly.rb +++ b/app/models/form/lettings/pages/rent_bi_weekly.rb @@ -11,7 +11,7 @@ class Form::Lettings::Pages::RentBiWeekly < ::Form::Page @questions ||= [Form::Lettings::Questions::BrentBiWeekly.new(nil, nil, self), Form::Lettings::Questions::SchargeBiWeekly.new(nil, nil, self), Form::Lettings::Questions::PschargeBiWeekly.new(nil, nil, self), - Form::Lettings::Questions::Supcharg.new(nil, nil, self), + Form::Lettings::Questions::SupchargBiWeekly.new(nil, nil, self), Form::Lettings::Questions::Tcharge.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/rent_monthly.rb b/app/models/form/lettings/pages/rent_monthly.rb index 49e38fae5..82a70c32a 100644 --- a/app/models/form/lettings/pages/rent_monthly.rb +++ b/app/models/form/lettings/pages/rent_monthly.rb @@ -11,7 +11,7 @@ class Form::Lettings::Pages::RentMonthly < ::Form::Page @questions ||= [Form::Lettings::Questions::BrentMonthly.new(nil, nil, self), Form::Lettings::Questions::SchargeMonthly.new(nil, nil, self), Form::Lettings::Questions::PschargeMonthly.new(nil, nil, self), - Form::Lettings::Questions::Supcharg.new(nil, nil, self), + Form::Lettings::Questions::SupchargMonthly.new(nil, nil, self), Form::Lettings::Questions::Tcharge.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/rent_weekly.rb b/app/models/form/lettings/pages/rent_weekly.rb index 01c7104a7..290b466bd 100644 --- a/app/models/form/lettings/pages/rent_weekly.rb +++ b/app/models/form/lettings/pages/rent_weekly.rb @@ -11,7 +11,7 @@ class Form::Lettings::Pages::RentWeekly < ::Form::Page @questions ||= [Form::Lettings::Questions::BrentWeekly.new(nil, nil, self), Form::Lettings::Questions::SchargeWeekly.new(nil, nil, self), Form::Lettings::Questions::PschargeWeekly.new(nil, nil, self), - Form::Lettings::Questions::Supcharg.new(nil, nil, self), + Form::Lettings::Questions::SupchargWeekly.new(nil, nil, self), Form::Lettings::Questions::Tcharge.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/questions/supcharg_4_weekly.rb b/app/models/form/lettings/questions/supcharg_4_weekly.rb new file mode 100644 index 000000000..5540b3555 --- /dev/null +++ b/app/models/form/lettings/questions/supcharg_4_weekly.rb @@ -0,0 +1,19 @@ +class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question + def initialize(id, hsh, page) + super + @id = "supcharg" + @check_answer_label = "Support charge" + @header = "What is the support charge?" + @type = "numeric" + @width = 5 + @check_answers_card_number = 0 + @min = 0 + @hint_text = "Any charges made to fund support services included in tenancy agreement." + @step = 0.01 + @fields_to_add = %w[brent scharge pscharge supcharg] + @result_field = "tcharge" + @hidden_in_check_answers = true + @prefix = "£" + @suffix = " every 4 weeks" + end +end diff --git a/app/models/form/lettings/questions/supcharg_bi_weekly.rb b/app/models/form/lettings/questions/supcharg_bi_weekly.rb new file mode 100644 index 000000000..cbda5e5c9 --- /dev/null +++ b/app/models/form/lettings/questions/supcharg_bi_weekly.rb @@ -0,0 +1,19 @@ +class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question + def initialize(id, hsh, page) + super + @id = "supcharg" + @check_answer_label = "Support charge" + @header = "What is the support charge?" + @type = "numeric" + @width = 5 + @check_answers_card_number = 0 + @min = 0 + @hint_text = "Any charges made to fund support services included in tenancy agreement." + @step = 0.01 + @fields_to_add = %w[brent scharge pscharge supcharg] + @result_field = "tcharge" + @hidden_in_check_answers = true + @prefix = "£" + @suffix = " every 2 weeks" + end +end diff --git a/app/models/form/lettings/questions/supcharg.rb b/app/models/form/lettings/questions/supcharg_monthly.rb similarity index 88% rename from app/models/form/lettings/questions/supcharg.rb rename to app/models/form/lettings/questions/supcharg_monthly.rb index 5cce68449..6b799f547 100644 --- a/app/models/form/lettings/questions/supcharg.rb +++ b/app/models/form/lettings/questions/supcharg_monthly.rb @@ -1,4 +1,4 @@ -class Form::Lettings::Questions::Supcharg < ::Form::Question +class Form::Lettings::Questions::SupchargMonthly < ::Form::Question def initialize(id, hsh, page) super @id = "supcharg" diff --git a/app/models/form/lettings/questions/supcharg_weekly.rb b/app/models/form/lettings/questions/supcharg_weekly.rb new file mode 100644 index 000000000..6f843db94 --- /dev/null +++ b/app/models/form/lettings/questions/supcharg_weekly.rb @@ -0,0 +1,19 @@ +class Form::Lettings::Questions::SupchargWeekly < ::Form::Question + def initialize(id, hsh, page) + super + @id = "supcharg" + @check_answer_label = "Support charge" + @header = "What is the support charge?" + @type = "numeric" + @width = 5 + @check_answers_card_number = 0 + @min = 0 + @hint_text = "Any charges made to fund support services included in tenancy agreement." + @step = 0.01 + @fields_to_add = %w[brent scharge pscharge supcharg] + @result_field = "tcharge" + @hidden_in_check_answers = true + @prefix = "£" + @suffix = " every week" + end +end