Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AQTS-688] Drop DQTTRNRequest model and table as it is no longer in use #2556

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions app/jobs/update_trs_trn_request_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@ def perform(trs_trn_request)

application_form = trs_trn_request.application_form

# TODO: We can remove this block once the migration between DQTTRNRequest to TRSTRNRequest
# has fully completed. This job may have quite a few instances in our scheduled queue
# and as a result we need to ensure they switch into using the TRSTRNRequest once we
# migrate all existing DQTTRNRequests into a record within the TRSTRNRequests table.
if trs_trn_request.is_a?(DQTTRNRequest)
if application_form.trs_trn_request
trs_trn_request = application_form.trs_trn_request
else
UpdateTRSTRNRequestJob.set(wait: 1.hour).perform_later(trs_trn_request)
return
end
end

response = fetch_response(trs_trn_request)

trs_trn_request.pending! if trs_trn_request.initial?
Expand Down
1 change: 0 additions & 1 deletion app/models/application_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class ApplicationForm < ApplicationRecord
has_many :qualifications, dependent: :destroy
has_many :timeline_events
has_one :country, through: :region
has_one :dqt_trn_request
has_one :trs_trn_request
has_one :assessment
has_many :notes, dependent: :destroy
Expand Down
30 changes: 0 additions & 30 deletions app/models/dqt_trn_request.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/services/destroy_application_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def initialize(application_form:)
def call
ActiveRecord::Base.transaction do
timeline_events.destroy_all
dqt_trn_request&.destroy!
trs_trn_request&.destroy!
assessment&.destroy!
application_form.destroy!
Expand All @@ -25,7 +24,6 @@ def call
delegate :assessment,
:teacher,
:timeline_events,
:dqt_trn_request,
:trs_trn_request,
to: :application_form
end
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<p class="govuk-body">You’ve successfully sent your further information request email to the applicant.</p>
<% elsif @view_object.application_form.declined_at.present? %>
<p class="govuk-body">The application will be deleted after 90 days unless the applicant chooses to appeal.</p>
<% elsif @view_object.application_form.trs_trn_request.present? || @view_object.application_form.dqt_trn_request.present? %>
<% elsif @view_object.application_form.trs_trn_request.present? %>
<p class="govuk-body">This status will appear while the award is reconciled with the information in the Database of Qualified Teachers (DQT).</p>
<p class="govuk-body">Once these checks are complete, the status will change to ‘Awarded’ and the applicant will receive the email telling them they’ve been awarded QTS.</p>
<% end %>
Expand Down
8 changes: 0 additions & 8 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,6 @@
- documentable_type
- id
- updated_at
:dqt_trn_requests:
- application_form_id
- created_at
- id
- potential_duplicate
- request_id
- state
- updated_at
:eligibility_checks:
- completed_at
- country_code
Expand Down
14 changes: 14 additions & 0 deletions db/migrate/20241210165522_drop_dqt_trn_requests_table.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

class DropDQTTRNRequestsTable < ActiveRecord::Migration[7.2]
def change
drop_table :dqt_trn_requests do
t.references :application_form, null: false, foreign_key: true
t.uuid :request_id, null: false
t.string :state, null: false, default: "pending"
t.boolean :potential_duplicate

t.timestamps
end
end
end
13 changes: 1 addition & 12 deletions db/schema.rb

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

4 changes: 0 additions & 4 deletions db/scripts/sanitise.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ SET
-- Documents
-- no update required

-- DQTTRNRequest
-- clear these as the scheduled jobs might run against them
DELETE FROM "dqt_trn_requests";

-- TRSTRNRequest
-- clear these as the scheduled jobs might run against them
DELETE FROM "trs_trn_requests";
Expand Down
Binary file modified docs/diagram.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion lib/tasks/fake_data.rake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace :fake_data do
end

TimelineEvent.delete_all
DQTTRNRequest.delete_all
TRSTRNRequest.delete_all
ReminderEmail.delete_all
ConsentRequest.delete_all
Expand Down
33 changes: 0 additions & 33 deletions spec/factories/dqt_trn_requests.rb

This file was deleted.

Loading
Loading