Skip to content

Commit

Permalink
Add expired_at column
Browse files Browse the repository at this point in the history
This adds a new column to the requestables for tracking when a
requestable was expired. This is because there can sometimes be a
slight delay between when the requested is due to expire and when it
actually has expired.
  • Loading branch information
thomasleese committed Sep 26, 2023
1 parent 5aaf8bf commit 0c00378
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/further_information_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/models/professional_standing_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/models/qualification_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/models/reference_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
:further_information_requests:
- assessment_id
- created_at
- expired_at
- failure_assessor_note
- id
- passed
Expand Down Expand Up @@ -211,6 +212,7 @@
:professional_standing_requests:
- assessment_id
- created_at
- expired_at
- failure_assessor_note
- id
- location_note
Expand All @@ -236,6 +238,7 @@
:qualification_requests:
- assessment_id
- created_at
- expired_at
- failure_assessor_note
- id
- location_note
Expand All @@ -258,6 +261,7 @@
- created_at
- dates_comment
- dates_response
- expired_at
- failure_assessor_note
- hours_comment
- hours_response
Expand Down
24 changes: 24 additions & 0 deletions db/migrate/20230926101325_add_expired_at_to_requestables.rb
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions spec/factories/further_information_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/factories/professional_standing_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/factories/qualification_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/factories/reference_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/models/further_information_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/models/professional_standing_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/models/qualification_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/models/reference_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c00378

Please sign in to comment.