-
Notifications
You must be signed in to change notification settings - Fork 8
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
[CPDLP-3818] Remove data in shared ecf declaration tables for npq #5401
base: main
Are you sure you want to change the base?
Changes from all commits
1a9411f
6c954f5
0ae3a65
654a070
6daa0d5
277aa1f
4dfb49d
b571092
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
class FutureDateValidator < ActiveModel::EachValidator | ||
def validate_each(record, attribute, value) | ||
if value && value > Time.zone.now | ||
record.instance_of?(::ParticipantOutcome::NPQ) ? record.errors.add(attribute, I18n.t(:future_date_outcomes, attribute:)) : record.errors.add(attribute, I18n.t(:future_date, attribute:)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can drop There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are also some other translations we can probably bin: https://github.com/DFE-Digital/early-careers-framework/blob/main/config/locales/en.yml#L186 Maybe we just do a sweep of these separately though 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think those are in the sweep later so its ok :) |
||
record.errors.add(attribute, I18n.t(:future_date, attribute:)) | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
- priority_mailers | ||
- mailers | ||
- default | ||
- participant_outcomes | ||
- big_query | ||
- dfe_analytics | ||
- slack_alerts |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
class DropTableParticipantOutcomeApiRequests < ActiveRecord::Migration[7.1] | ||
def up | ||
drop_table :participant_outcome_api_requests | ||
end | ||
|
||
def down | ||
create_table :participant_outcome_api_requests, id: :uuid, default: -> { "gen_random_uuid()" } do |t| | ||
t.string :request_path | ||
t.integer :status_code | ||
t.jsonb :request_headers | ||
t.jsonb :request_body | ||
t.jsonb :response_body | ||
t.jsonb :response_headers | ||
t.uuid :participant_outcome_id, null: false | ||
t.datetime :created_at, null: false | ||
t.datetime :updated_at, null: false | ||
|
||
t.index :participant_outcome_id, name: "index_participant_outcome_api_requests_on_participant_outcome" | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
class DropTableParticipantOutcomes < ActiveRecord::Migration[7.1] | ||
def up | ||
drop_table :participant_outcomes | ||
end | ||
|
||
def down | ||
create_table :participant_outcomes, id: :uuid, default: -> { "gen_random_uuid()" } do |t| | ||
t.string :state, null: false | ||
t.date :completion_date, null: false | ||
t.uuid :participant_declaration_id, null: false | ||
t.datetime :created_at, null: false | ||
t.datetime :updated_at, null: false | ||
t.boolean :qualified_teachers_api_request_successful | ||
t.datetime :sent_to_qualified_teachers_api_at | ||
|
||
t.index :created_at, name: "index_participant_outcomes_on_created_at" | ||
t.index :participant_declaration_id, name: "index_declaration" | ||
t.index :sent_to_qualified_teachers_api_at, name: "index_participant_outcomes_on_sent_to_qualified_teachers_api_at" | ||
t.index :state, name: "index_participant_outcomes_on_state" | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class DeleteNPQDeclarations < ActiveRecord::Migration[7.1] | ||
def up | ||
npq_type = "ParticipantDeclaration::NPQ" | ||
|
||
DeclarationState.includes(:participant_declaration).where(participant_declaration: { type: npq_type } ).delete_all | ||
ParticipantDeclarationAttempt.includes(:participant_declaration).where(participant_declaration: { type: npq_type } ).delete_all | ||
ParticipantDeclaration.where(type: npq_type).delete_all | ||
end | ||
end |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can remove outcomes from fixtures?
fixtures/files/api_reference/api_spec.json