From 7a8bc3c21955f39a943f1faf38462d8faa6cbe1b Mon Sep 17 00:00:00 2001 From: Kat Date: Mon, 8 Aug 2022 10:35:26 +0100 Subject: [PATCH] Add property_major_repairs_value_check to the form --- .../imports/case_logs_import_service.rb | 1 + config/forms/2021_2022.json | 23 +++++++++++++++++++ config/forms/2022_2023.json | 23 +++++++++++++++++++ ...0330_add_major_repairs_date_value_check.rb | 5 ++++ db/schema.rb | 1 + 5 files changed, 53 insertions(+) create mode 100644 db/migrate/20220808090330_add_major_repairs_date_value_check.rb diff --git a/app/services/imports/case_logs_import_service.rb b/app/services/imports/case_logs_import_service.rb index 96811487f..7170b5c39 100644 --- a/app/services/imports/case_logs_import_service.rb +++ b/app/services/imports/case_logs_import_service.rb @@ -209,6 +209,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["retirement_value_check"] = 0 attributes["rent_value_check"] = 0 attributes["net_income_value_check"] = 0 diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index ffbdc0887..4e1935d9f 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -867,6 +867,29 @@ "rsnvac": 19 } ] + }, + "property_major_repairs_value_check": { + "depends_on": [{ "major_repairs_date_in_soft_range?": true }], + "title_text": { + "translation": "soft_validations.major_repairs_date.title_text" + }, + "informative_text": {}, + "questions": { + "major_repairs_date_value_check": { + "check_answer_label": "Major repairs 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" + } + } + } + } } } }, diff --git a/config/forms/2022_2023.json b/config/forms/2022_2023.json index 7735e5ad9..edc7ce564 100644 --- a/config/forms/2022_2023.json +++ b/config/forms/2022_2023.json @@ -867,6 +867,29 @@ "rsnvac": 19 } ] + }, + "property_major_repairs_value_check": { + "depends_on": [{ "major_repairs_date_in_soft_range?": true }], + "title_text": { + "translation": "soft_validations.major_repairs_date.title_text" + }, + "informative_text": {}, + "questions": { + "major_repairs_date_value_check": { + "check_answer_label": "Major repairs 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" + } + } + } + } } } }, diff --git a/db/migrate/20220808090330_add_major_repairs_date_value_check.rb b/db/migrate/20220808090330_add_major_repairs_date_value_check.rb new file mode 100644 index 000000000..e1e666b65 --- /dev/null +++ b/db/migrate/20220808090330_add_major_repairs_date_value_check.rb @@ -0,0 +1,5 @@ +class AddMajorRepairsDateValueCheck < ActiveRecord::Migration[7.0] + def change + add_column :case_logs, :major_repairs_date_value_check, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 1b65e5482..917b3f215 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -200,6 +200,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_08_10_152340) do t.integer "vacdays" t.bigint "scheme_id" t.bigint "location_id" + t.integer "major_repairs_date_value_check" t.index ["created_by_id"], name: "index_case_logs_on_created_by_id" t.index ["location_id"], name: "index_case_logs_on_location_id" t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id"