diff --git a/app/models/further_information_request.rb b/app/models/further_information_request.rb index 56af555f8e..5314294dc4 100644 --- a/app/models/further_information_request.rb +++ b/app/models/further_information_request.rb @@ -3,6 +3,7 @@ # Table name: further_information_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # passed :boolean # received_at :datetime diff --git a/app/models/professional_standing_request.rb b/app/models/professional_standing_request.rb index b7de1b703b..cb9cb36574 100644 --- a/app/models/professional_standing_request.rb +++ b/app/models/professional_standing_request.rb @@ -5,6 +5,7 @@ # Table name: professional_standing_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # location_note :text default(""), not null # passed :boolean diff --git a/app/models/qualification_request.rb b/app/models/qualification_request.rb index e9706b85bf..93fa62f6f8 100644 --- a/app/models/qualification_request.rb +++ b/app/models/qualification_request.rb @@ -5,6 +5,7 @@ # Table name: qualification_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # location_note :text default(""), not null # passed :boolean diff --git a/app/models/reference_request.rb b/app/models/reference_request.rb index 23e8198487..6360d57e6b 100644 --- a/app/models/reference_request.rb +++ b/app/models/reference_request.rb @@ -14,6 +14,7 @@ # contact_response :boolean # dates_comment :text default(""), not null # dates_response :boolean +# expired_at :datetime # failure_assessor_note :string default(""), not null # hours_comment :text default(""), not null # hours_response :boolean diff --git a/config/analytics.yml b/config/analytics.yml index bf930ba6e9..d2454d5a2f 100644 --- a/config/analytics.yml +++ b/config/analytics.yml @@ -177,6 +177,7 @@ :further_information_requests: - assessment_id - created_at + - expired_at - failure_assessor_note - id - passed @@ -211,6 +212,7 @@ :professional_standing_requests: - assessment_id - created_at + - expired_at - failure_assessor_note - id - location_note @@ -236,6 +238,7 @@ :qualification_requests: - assessment_id - created_at + - expired_at - failure_assessor_note - id - location_note @@ -258,6 +261,7 @@ - created_at - dates_comment - dates_response + - expired_at - failure_assessor_note - hours_comment - hours_response diff --git a/db/migrate/20230926101325_add_expired_at_to_requestables.rb b/db/migrate/20230926101325_add_expired_at_to_requestables.rb new file mode 100644 index 0000000000..feb7e75b57 --- /dev/null +++ b/db/migrate/20230926101325_add_expired_at_to_requestables.rb @@ -0,0 +1,24 @@ +class AddExpiredAtToRequestables < ActiveRecord::Migration[7.0] + def change + add_column :further_information_requests, :expired_at, :datetime + add_column :professional_standing_requests, :expired_at, :datetime + add_column :qualification_requests, :expired_at, :datetime + add_column :reference_requests, :expired_at, :datetime + + FurtherInformationRequest.expired.each do |requestable| + requestable.update!(expired_at: requestable.expires_at) + end + + ProfessionalStandingRequest.expired.each do |requestable| + requestable.update!(expired_at: requestable.expires_at) + end + + QualificationRequest.expired.each do |requestable| + requestable.update!(expired_at: requestable.expires_at) + end + + ReferenceRequest.expired.each do |requestable| + requestable.update!(expired_at: requestable.expires_at) + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 8fd3d88acd..f29449f3b7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_09_26_092809) do +ActiveRecord::Schema[7.0].define(version: 2023_09_26_101325) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -251,6 +251,7 @@ t.integer "working_days_assessment_started_to_creation" t.datetime "reviewed_at" t.datetime "requested_at" + t.datetime "expired_at" t.index ["assessment_id"], name: "index_further_information_requests_on_assessment_id" end @@ -276,6 +277,7 @@ t.string "failure_assessor_note", default: "", null: false t.boolean "ready_for_review", default: false, null: false t.datetime "requested_at" + t.datetime "expired_at" t.index ["assessment_id"], name: "index_professional_standing_requests_on_assessment_id" end @@ -291,6 +293,7 @@ t.boolean "passed" t.string "failure_assessor_note", default: "", null: false t.datetime "requested_at" + t.datetime "expired_at" t.index ["assessment_id"], name: "index_qualification_requests_on_assessment_id" t.index ["qualification_id"], name: "index_qualification_requests_on_qualification_id" end @@ -340,6 +343,7 @@ t.text "satisfied_comment", default: "", null: false t.string "failure_assessor_note", default: "", null: false t.datetime "requested_at" + t.datetime "expired_at" t.index ["assessment_id"], name: "index_reference_requests_on_assessment_id" t.index ["slug"], name: "index_reference_requests_on_slug", unique: true t.index ["work_history_id"], name: "index_reference_requests_on_work_history_id" diff --git a/spec/factories/further_information_requests.rb b/spec/factories/further_information_requests.rb index ec7d6d2f76..8c04ca21e9 100644 --- a/spec/factories/further_information_requests.rb +++ b/spec/factories/further_information_requests.rb @@ -5,6 +5,7 @@ # Table name: further_information_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # passed :boolean # received_at :datetime diff --git a/spec/factories/professional_standing_requests.rb b/spec/factories/professional_standing_requests.rb index e00d74c071..5f23fbc89e 100644 --- a/spec/factories/professional_standing_requests.rb +++ b/spec/factories/professional_standing_requests.rb @@ -5,6 +5,7 @@ # Table name: professional_standing_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # location_note :text default(""), not null # passed :boolean diff --git a/spec/factories/qualification_requests.rb b/spec/factories/qualification_requests.rb index 02017275cc..0883884e11 100644 --- a/spec/factories/qualification_requests.rb +++ b/spec/factories/qualification_requests.rb @@ -5,6 +5,7 @@ # Table name: qualification_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # location_note :text default(""), not null # passed :boolean diff --git a/spec/factories/reference_requests.rb b/spec/factories/reference_requests.rb index dea9577dfe..7e6836a442 100644 --- a/spec/factories/reference_requests.rb +++ b/spec/factories/reference_requests.rb @@ -14,6 +14,7 @@ # contact_response :boolean # dates_comment :text default(""), not null # dates_response :boolean +# expired_at :datetime # failure_assessor_note :string default(""), not null # hours_comment :text default(""), not null # hours_response :boolean diff --git a/spec/models/further_information_request_spec.rb b/spec/models/further_information_request_spec.rb index 0cafc0539e..24d9e42aba 100644 --- a/spec/models/further_information_request_spec.rb +++ b/spec/models/further_information_request_spec.rb @@ -5,6 +5,7 @@ # Table name: further_information_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # passed :boolean # received_at :datetime diff --git a/spec/models/professional_standing_request_spec.rb b/spec/models/professional_standing_request_spec.rb index 1d2e5babbe..e2555aaeef 100644 --- a/spec/models/professional_standing_request_spec.rb +++ b/spec/models/professional_standing_request_spec.rb @@ -5,6 +5,7 @@ # Table name: professional_standing_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # location_note :text default(""), not null # passed :boolean diff --git a/spec/models/qualification_request_spec.rb b/spec/models/qualification_request_spec.rb index 5e4c65cf2c..63ab0fc5a6 100644 --- a/spec/models/qualification_request_spec.rb +++ b/spec/models/qualification_request_spec.rb @@ -5,6 +5,7 @@ # Table name: qualification_requests # # id :bigint not null, primary key +# expired_at :datetime # failure_assessor_note :string default(""), not null # location_note :text default(""), not null # passed :boolean diff --git a/spec/models/reference_request_spec.rb b/spec/models/reference_request_spec.rb index 28933b6172..aefa2db4a9 100644 --- a/spec/models/reference_request_spec.rb +++ b/spec/models/reference_request_spec.rb @@ -14,6 +14,7 @@ # contact_response :boolean # dates_comment :text default(""), not null # dates_response :boolean +# expired_at :datetime # failure_assessor_note :string default(""), not null # hours_comment :text default(""), not null # hours_response :boolean