From aa583a7d8947675e7484150d3f93efe288094cc9 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:29:22 +0100 Subject: [PATCH] Add sales soft validations --- .../questions/about_price_value_check.rb | 3 +- .../questions/buyer1_income_value_check.rb | 3 +- .../questions/buyer2_income_value_check.rb | 5 +-- .../questions/combined_income_value_check.rb | 3 +- .../questions/monthly_charges_value_check.rb | 3 +- .../percentage_discount_value_check.rb | 3 +- .../forms/2023/sales/soft_validations.en.yml | 40 +++++++++++++++++++ .../forms/2024/sales/soft_validations.en.yml | 40 +++++++++++++++++++ 8 files changed, 87 insertions(+), 13 deletions(-) create mode 100644 config/locales/forms/2023/sales/soft_validations.en.yml create mode 100644 config/locales/forms/2024/sales/soft_validations.en.yml diff --git a/app/models/form/sales/questions/about_price_value_check.rb b/app/models/form/sales/questions/about_price_value_check.rb index 2b51cd7fb..52f7b156f 100644 --- a/app/models/form/sales/questions/about_price_value_check.rb +++ b/app/models/form/sales/questions/about_price_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "value_value_check" - @check_answer_label = "Purchase price confirmation" - @header = "Are you sure?" + @copy_key = "sales.soft_validations.value_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/buyer1_income_value_check.rb b/app/models/form/sales/questions/buyer1_income_value_check.rb index 63e3b6478..410bd53d5 100644 --- a/app/models/form/sales/questions/buyer1_income_value_check.rb +++ b/app/models/form/sales/questions/buyer1_income_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer1IncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "income1_value_check" - @check_answer_label = "Buyer 1 income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.income1_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/buyer2_income_value_check.rb b/app/models/form/sales/questions/buyer2_income_value_check.rb index 37b6cb380..e635bda4a 100644 --- a/app/models/form/sales/questions/buyer2_income_value_check.rb +++ b/app/models/form/sales/questions/buyer2_income_value_check.rb @@ -1,9 +1,8 @@ class Form::Sales::Questions::Buyer2IncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) - @id = "income2_value_check" - @check_answer_label = "Buyer 2 income confirmation" - @header = "Are you sure this is correct?" + @id = "" + @copy_key = "sales.soft_validations.income2_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/combined_income_value_check.rb b/app/models/form/sales/questions/combined_income_value_check.rb index 47cafeaa2..c2688ffe5 100644 --- a/app/models/form/sales/questions/combined_income_value_check.rb +++ b/app/models/form/sales/questions/combined_income_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::CombinedIncomeValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "combined_income_value_check" - @check_answer_label = "Combined income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.combined_income_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/monthly_charges_value_check.rb b/app/models/form/sales/questions/monthly_charges_value_check.rb index 90fcf4545..615238cda 100644 --- a/app/models/form/sales/questions/monthly_charges_value_check.rb +++ b/app/models/form/sales/questions/monthly_charges_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "monthly_charges_value_check" - @check_answer_label = "Monthly charges confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.monthly_charges_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/percentage_discount_value_check.rb b/app/models/form/sales/questions/percentage_discount_value_check.rb index 9ac5547b4..5a1e7a045 100644 --- a/app/models/form/sales/questions/percentage_discount_value_check.rb +++ b/app/models/form/sales/questions/percentage_discount_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PercentageDiscountValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "percentage_discount_value_check" - @check_answer_label = "Percentage discount confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.percentage_discount_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml new file mode 100644 index 000000000..9a5f62247 --- /dev/null +++ b/config/locales/forms/2023/sales/soft_validations.en.yml @@ -0,0 +1,40 @@ +en: + forms: + 2023: + sales: + soft_validations: + income1_value_check: + page_header: "" + check_answer_label: "Buyer 1 income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + income2_value_check: + page_header: "" + check_answer_label: "Buyer 2 income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + combined_income_value_check: + page_header: "" + check_answer_label: "Combined income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" + + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml new file mode 100644 index 000000000..3e8828153 --- /dev/null +++ b/config/locales/forms/2024/sales/soft_validations.en.yml @@ -0,0 +1,40 @@ +en: + forms: + 2024: + sales: + soft_validations: + income1_value_check: + page_header: "" + check_answer_label: "Buyer 1 income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + income2_value_check: + page_header: "" + check_answer_label: "Buyer 2 income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + combined_income_value_check: + page_header: "" + check_answer_label: "Combined income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" + + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?"