Skip to content

Commit

Permalink
Merge pull request #5374 from DFE-Digital/3814-npq-post-separation-cl…
Browse files Browse the repository at this point in the history
…eanup-remove-npq-specific-tables-from-ecf

[CPDLP-3814] NPQ Post Separation Cleanup - Remove NPQ specific tables from ECF
  • Loading branch information
mooktakim authored Jan 8, 2025
2 parents 0aa0e97 + 673893e commit 47cc672
Show file tree
Hide file tree
Showing 107 changed files with 713 additions and 5,135 deletions.
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,21 +292,6 @@ PaperTrail.request(controller_info: {reason: "some reason"}) do
# do something
end
```

## Runbook

### Updating NPQ applications from manual validation

This procedure is used after a batch from manual validation has been complete. The data also needs to be uploaded to the NPQ application as it uses a different database and there is no syncing procedure in place.

1. Log in to a container instance
2. Save CSV data to disk via `vi` and remember the path
3. Start rails console
4. Instantiate service with `svc = Importers::NPQManualValidation.new(path_to_csv: Rails.root.join("batchX.csv"))`
5. Call service with `svc.call`
6. Exit rails console
7. Delete CSV as no longer needed

## Monitoring, logging, and alerting
### Sentry
We use [sentry.io](https://sentry.io/) for error tracking and performance monitoring. Ask a team member for access - this is done through digi-tools.
Expand Down
27 changes: 0 additions & 27 deletions app/components/admin/participants/npq_validation_status_tag.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
<% if participant_profile.npq? %>
<%= render Admin::Participants::NPQValidationStatusTag.new(profile: participant_profile) %>
<% else %>
<%= govuk_tag(text: label, colour:) %>
<% end %>
<%= govuk_tag(text: label, colour:) %>
5 changes: 0 additions & 5 deletions app/controllers/api/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class ApiController < ActionController::API
rescue_from Api::Errors::InvalidParticipantOutcomeError, with: :invalid_transition
rescue_from Api::Errors::InvalidDatetimeError, with: :invalid_updated_since_response
rescue_from Api::Errors::InvalidTrainingStatusError, with: :invalid_training_status_response
rescue_from Api::Errors::MissingNPQContractOrStatementError, with: :missing_npq_contract_or_statement_response
rescue_from Pagy::VariableError, with: :invalid_pagination_response

def append_info_to_payload(payload)
Expand Down Expand Up @@ -70,9 +69,5 @@ def invalid_training_status_response(exception)
def invalid_pagination_response(_exception)
render json: { errors: Api::ParamErrorFactory.new(error: I18n.t(:bad_request), params: I18n.t(:invalid_page_parameters)).call }, status: :bad_request
end

def missing_npq_contract_or_statement_response(_exception)
render json: { errors: Api::ParamErrorFactory.new(error: I18n.t(:unprocessable_request), params: I18n.t(:missing_npq_contract_or_statement)).call }, status: :unprocessable_entity
end
end
end

This file was deleted.

4 changes: 0 additions & 4 deletions app/helpers/admin_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ def all_emails_associated_with_a_user(user)
ParticipantIdentity.where(user:).pluck(:email)
end

def on_admin_npq_application_page?
request.path.starts_with?("/admin/npq/applications")
end

def html_list(values, bullets: false)
return nil if values.empty?

Expand Down
1 change: 0 additions & 1 deletion app/models/cohort.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Cohort < ApplicationRecord
INITIAL_COHORT_START_DATE = Date.new(2021, 9, 1)

has_many :call_off_contracts
has_many :npq_contracts
has_many :partnerships
has_many :schedules, class_name: "Finance::Schedule::ECF"
has_many :statements, class_name: "Finance::Statement"
Expand Down
1 change: 0 additions & 1 deletion app/models/cpd_lead_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class CpdLeadProvider < ApplicationRecord
has_paper_trail

has_one :lead_provider
has_one :npq_lead_provider
has_many :participant_declarations
has_many :statements, class_name: "Finance::Statement"
has_many :ecf_statements, class_name: "Finance::Statement::ECF"
Expand Down
2 changes: 0 additions & 2 deletions app/models/finance/statement/npq.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

class Finance::Statement::NPQ < Finance::Statement
has_one :npq_lead_provider, through: :cpd_lead_provider

STATEMENT_TYPE = "npq"

def payable!
Expand Down
150 changes: 0 additions & 150 deletions app/models/npq_application.rb

This file was deleted.

27 changes: 0 additions & 27 deletions app/models/npq_contract.rb

This file was deleted.

35 changes: 0 additions & 35 deletions app/models/npq_course.rb

This file was deleted.

19 changes: 0 additions & 19 deletions app/models/npq_lead_provider.rb

This file was deleted.

6 changes: 1 addition & 5 deletions app/models/participant_declaration/npq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class ParticipantDeclaration::NPQ < ParticipantDeclaration
"npq-senco" => "NPQSENCO",
}.freeze

has_one :npq_application, through: :participant_profile
has_many :statements, class_name: "Finance::Statement::NPQ", through: :statement_line_items
has_many :outcomes, class_name: "ParticipantOutcome::NPQ", foreign_key: "participant_declaration_id"

Expand Down Expand Up @@ -58,10 +57,7 @@ def npq?
end

def uplift_paid?
!%w[npq-additional-support-offer npq-early-headship-coaching-offer].include?(course_identifier) &&
declaration_type == "started" &&
%w[paid awaiting_clawback clawed_back].include?(state) &&
participant_profile.npq_application.targeted_delivery_funding_eligibility
nil
end

def qualification_type
Expand Down
1 change: 0 additions & 1 deletion app/models/participant_identity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class ParticipantIdentity < ApplicationRecord
belongs_to :user, touch: true
has_many :participant_profiles
has_many :npq_participant_profiles, class_name: "ParticipantProfile::NPQ"
has_many :npq_applications
has_many :induction_records, through: :participant_profiles

validates :email, presence: true, uniqueness: true, notify_email: true
Expand Down
Loading

0 comments on commit 47cc672

Please sign in to comment.