From 36253b9f9919ac83708f107989a9c04492681924 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Tue, 30 Jan 2024 10:00:36 +0000 Subject: [PATCH] Add qualifications_assessor_note column This will be used to capture any notes from the assessor when they send an application to verification by admins. --- app/models/assessment.rb | 1 + config/analytics_blocklist.yml | 2 ++ ...121_add_qualifications_assessor_note_to_assessment.rb | 9 +++++++++ db/schema.rb | 1 + spec/factories/assessments.rb | 3 +++ spec/models/assessment_spec.rb | 1 + 6 files changed, 17 insertions(+) create mode 100644 db/migrate/20240130095121_add_qualifications_assessor_note_to_assessment.rb diff --git a/app/models/assessment.rb b/app/models/assessment.rb index 444e2456e0..d021178497 100644 --- a/app/models/assessment.rb +++ b/app/models/assessment.rb @@ -7,6 +7,7 @@ # age_range_min :integer # age_range_note :text default(""), not null # induction_required :boolean +# qualifications_assessor_note :text default(""), not null # recommendation :string default("unknown"), not null # recommendation_assessor_note :text default(""), not null # recommended_at :datetime diff --git a/config/analytics_blocklist.yml b/config/analytics_blocklist.yml index 6b48858dd1..57c7b8c02e 100644 --- a/config/analytics_blocklist.yml +++ b/config/analytics_blocklist.yml @@ -21,6 +21,8 @@ - record_id - blob_id - created_at + :assessments: + - qualifications_assessor_note :sessions: - id - session_id diff --git a/db/migrate/20240130095121_add_qualifications_assessor_note_to_assessment.rb b/db/migrate/20240130095121_add_qualifications_assessor_note_to_assessment.rb new file mode 100644 index 0000000000..989e528dcc --- /dev/null +++ b/db/migrate/20240130095121_add_qualifications_assessor_note_to_assessment.rb @@ -0,0 +1,9 @@ +class AddQualificationsAssessorNoteToAssessment < ActiveRecord::Migration[7.1] + def change + add_column :assessments, + :qualifications_assessor_note, + :text, + null: false, + default: "" + end +end diff --git a/db/schema.rb b/db/schema.rb index baab9f39f4..80dd710571 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -142,6 +142,7 @@ t.boolean "references_verified" t.boolean "scotland_full_registration" t.boolean "unsigned_consent_document_generated", default: false, null: false + t.text "qualifications_assessor_note", default: "", null: false t.index ["application_form_id"], name: "index_assessments_on_application_form_id" end diff --git a/spec/factories/assessments.rb b/spec/factories/assessments.rb index 1d33856ab5..ac4c00d259 100644 --- a/spec/factories/assessments.rb +++ b/spec/factories/assessments.rb @@ -7,6 +7,7 @@ # age_range_min :integer # age_range_note :text default(""), not null # induction_required :boolean +# qualifications_assessor_note :text default(""), not null # recommendation :string default("unknown"), not null # recommendation_assessor_note :text default(""), not null # recommended_at :datetime @@ -125,6 +126,8 @@ end trait :with_qualification_request do + qualifications_assessor_note { Faker::Lorem.sentence } + after(:create) do |assessment, _evaluator| create( :qualification_request, diff --git a/spec/models/assessment_spec.rb b/spec/models/assessment_spec.rb index 4f6e9836ca..b58f72872d 100644 --- a/spec/models/assessment_spec.rb +++ b/spec/models/assessment_spec.rb @@ -9,6 +9,7 @@ # age_range_min :integer # age_range_note :text default(""), not null # induction_required :boolean +# qualifications_assessor_note :text default(""), not null # recommendation :string default("unknown"), not null # recommendation_assessor_note :text default(""), not null # recommended_at :datetime