Browse Source

Add property_major_repairs_value_check to the form

pull/820/head
Kat 3 years ago
parent
commit
7a8bc3c219
  1. 1
      app/services/imports/case_logs_import_service.rb
  2. 23
      config/forms/2021_2022.json
  3. 23
      config/forms/2022_2023.json
  4. 5
      db/migrate/20220808090330_add_major_repairs_date_value_check.rb
  5. 1
      db/schema.rb

1
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 # Soft validations can become required answers, set them to yes by default
attributes["pregnancy_value_check"] = 0 attributes["pregnancy_value_check"] = 0
attributes["major_repairs_date_value_check"] = 0
attributes["retirement_value_check"] = 0 attributes["retirement_value_check"] = 0
attributes["rent_value_check"] = 0 attributes["rent_value_check"] = 0
attributes["net_income_value_check"] = 0 attributes["net_income_value_check"] = 0

23
config/forms/2021_2022.json

@ -867,6 +867,29 @@
"rsnvac": 19 "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"
}
}
}
}
} }
} }
}, },

23
config/forms/2022_2023.json

@ -867,6 +867,29 @@
"rsnvac": 19 "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"
}
}
}
}
} }
} }
}, },

5
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

1
db/schema.rb

@ -200,6 +200,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_08_10_152340) do
t.integer "vacdays" t.integer "vacdays"
t.bigint "scheme_id" t.bigint "scheme_id"
t.bigint "location_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 ["created_by_id"], name: "index_case_logs_on_created_by_id"
t.index ["location_id"], name: "index_case_logs_on_location_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" t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id"

Loading…
Cancel
Save