diff --git a/app/models/validations/soft_validations.rb b/app/models/validations/soft_validations.rb index ed90cbcd9..d1d3ff831 100644 --- a/app/models/validations/soft_validations.rb +++ b/app/models/validations/soft_validations.rb @@ -66,7 +66,7 @@ module Validations::SoftValidations mrcdate.present? && startdate.present? && mrcdate.between?(startdate.to_date - 3650, startdate.to_date - 730) end - def voiddate_date_in_soft_range? + def voiddate_in_soft_range? voiddate.present? && startdate.present? && voiddate.between?(startdate.to_date - 3650, startdate.to_date - 730) end diff --git a/app/services/imports/case_logs_import_service.rb b/app/services/imports/case_logs_import_service.rb index 7170b5c39..a0d75c0bb 100644 --- a/app/services/imports/case_logs_import_service.rb +++ b/app/services/imports/case_logs_import_service.rb @@ -210,6 +210,7 @@ module Imports # Soft validations can become required answers, set them to yes by default attributes["pregnancy_value_check"] = 0 attributes["major_repairs_date_value_check"] = 0 + attributes["void_date_value_check"] = 0 attributes["retirement_value_check"] = 0 attributes["rent_value_check"] = 0 attributes["net_income_value_check"] = 0 @@ -274,7 +275,7 @@ module Imports end def fields_not_present_in_softwire_data - %w[majorrepairs illness_type_0 tshortfall_known pregnancy_value_check retirement_value_check rent_value_check net_income_value_check] + %w[majorrepairs illness_type_0 tshortfall_known pregnancy_value_check retirement_value_check rent_value_check net_income_value_check major_repairs_date_value_check void_date_value_check] end def check_status_completed(case_log, previous_status) diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 4e1935d9f..2d1b8929b 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -771,6 +771,29 @@ } ] }, + "void_date_value_check": { + "depends_on": [{ "voiddate_in_soft_range?": true }], + "title_text": { + "translation": "soft_validations.void_date.title_text" + }, + "informative_text": {}, + "questions": { + "void_date_value_check": { + "check_answer_label": "Void date soft validation", + "hidden_in_check_answers": true, + "header": "Are you sure the time between these dates is correct?", + "type": "interruption_screen", + "answer_options": { + "0": { + "value": "Yes" + }, + "1": { + "value": "No" + } + } + } + } + }, "new_build_handover_date": { "header": "", "description": "", diff --git a/config/forms/2022_2023.json b/config/forms/2022_2023.json index edc7ce564..a9173462a 100644 --- a/config/forms/2022_2023.json +++ b/config/forms/2022_2023.json @@ -771,6 +771,29 @@ } ] }, + "void_date_value_check": { + "depends_on": [{ "voiddate_in_soft_range?": true }], + "title_text": { + "translation": "soft_validations.void_date.title_text" + }, + "informative_text": {}, + "questions": { + "void_date_value_check": { + "check_answer_label": "Void date soft validation", + "hidden_in_check_answers": true, + "header": "Are you sure the time between these dates is correct?", + "type": "interruption_screen", + "answer_options": { + "0": { + "value": "Yes" + }, + "1": { + "value": "No" + } + } + } + } + }, "new_build_handover_date": { "header": "", "description": "", diff --git a/config/locales/en.yml b/config/locales/en.yml index fdb243b5f..1ca470323 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -321,7 +321,8 @@ en: females_not_in_soft_age_range: "You also told us that any female tenants living at the property are in the following age ranges: