diff --git a/app/jobs/reports/irs_weekly_summary_report.rb b/app/jobs/reports/irs_weekly_summary_report.rb deleted file mode 100644 index cae28a2c1cd..00000000000 --- a/app/jobs/reports/irs_weekly_summary_report.rb +++ /dev/null @@ -1,48 +0,0 @@ -require 'csv' - -module Reports - class IrsWeeklySummaryReport < BaseReport - attr_reader :report_date - REPORT_NAME = 'irs-weekly-summary-report' - - def perform(report_date) - @name = REPORT_NAME - @report_date = report_date - - email = IdentityConfig.store.system_demand_report_email - ReportMailer.system_demand_report( - email: email, - data: generate_csv, - name: REPORT_NAME, - ).deliver_now - - # save report has a predefined bucket where things get saved - # upload_file_to_s3_bucket can be used to define specific buckets (ie. public/private) - save_report( - REPORT_NAME, - generate_csv, - extension: 'csv', - ) - end - - private - - # The total number of users registered with Login.gov - def query_system_demand - User.where('created_at <= ?', report_date.beginning_of_day).count - end - - def generate_csv - CSV.generate do |csv| - csv << [ - 'Data Requested', - 'Total Count', - ] - csv << [ - 'System Demand', - query_system_demand, - ] - end - end - end -end diff --git a/app/mailers/report_mailer.rb b/app/mailers/report_mailer.rb index 47a32155ce6..bfe7f2d475c 100644 --- a/app/mailers/report_mailer.rb +++ b/app/mailers/report_mailer.rb @@ -16,12 +16,6 @@ def deleted_user_accounts_report(email:, name:, issuers:, data:) mail(to: email, subject: t('report_mailer.deleted_accounts_report.subject')) end - def system_demand_report(email:, data:, name:) - @name = name - attachments['system_demand.csv'] = data - mail(to: email, subject: t('report_mailer.system_demand_report.subject')) - end - def warn_error(email:, error:, env: Rails.env) @error = error mail(to: email, subject: "[#{env}] identity-idp error: #{error.class.name}") diff --git a/app/views/report_mailer/system_demand_report.html.erb b/app/views/report_mailer/system_demand_report.html.erb deleted file mode 100644 index 1a58e539b16..00000000000 --- a/app/views/report_mailer/system_demand_report.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= t('report_mailer.system_demand_report.name') %>: <%= @name %>
diff --git a/config/application.yml.default b/config/application.yml.default index 45bd6da339a..93e11dd1843 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -314,7 +314,6 @@ sp_handoff_bounce_max_seconds: 2 show_unsupported_passkey_platform_authentication_setup: false show_user_attribute_deprecation_warnings: false otp_min_attempts_remaining_warning_count: 3 -system_demand_report_email: 'foo@bar.com' sp_issuer_user_counts_report_configs: '[]' team_ada_email: '' team_all_login_emails: '[]' diff --git a/config/initializers/job_configurations.rb b/config/initializers/job_configurations.rb index 29d3b053ffd..f6d21134c13 100644 --- a/config/initializers/job_configurations.rb +++ b/config/initializers/job_configurations.rb @@ -146,12 +146,6 @@ class: 'ThreatMetrixJsVerificationJob', cron: cron_1h, }, - # Weekly IRS report returning system demand - irs_weekly_summary_report: { - class: 'Reports::IrsWeeklySummaryReport', - cron: cron_1w, - args: -> { [Time.zone.now] }, - }, # Reject profiles that have been in fraud_review_pending for 30 days fraud_rejection: { class: 'FraudRejectionDailyJob', diff --git a/config/locales/report_mailer/en.yml b/config/locales/report_mailer/en.yml index 25737426436..f71e93c2ebb 100644 --- a/config/locales/report_mailer/en.yml +++ b/config/locales/report_mailer/en.yml @@ -5,6 +5,3 @@ en: issuers: Issuers name: Name subject: Deleted accounts report - system_demand_report: - name: Name - subject: System demand report diff --git a/config/locales/report_mailer/es.yml b/config/locales/report_mailer/es.yml index 05922400d5e..328c1e881b4 100644 --- a/config/locales/report_mailer/es.yml +++ b/config/locales/report_mailer/es.yml @@ -5,6 +5,3 @@ es: issuers: Emisores name: Nombre subject: Informe de cuentas eliminadas - system_demand_report: - name: Nombre - subject: Informe de demanda del sistema diff --git a/config/locales/report_mailer/fr.yml b/config/locales/report_mailer/fr.yml index 098761d4ace..4764291a220 100644 --- a/config/locales/report_mailer/fr.yml +++ b/config/locales/report_mailer/fr.yml @@ -5,6 +5,3 @@ fr: issuers: Émetteurs name: Nom subject: Rapport sur les comptes supprimés - system_demand_report: - name: Nom - subject: Rapport de demande du système diff --git a/lib/identity_config.rb b/lib/identity_config.rb index 161caa0b550..4d4192b9f41 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -452,7 +452,6 @@ def self.build_store(config_map) config.add(:sp_handoff_bounce_max_seconds, type: :integer) config.add(:sp_issuer_user_counts_report_configs, type: :json) config.add(:state_tracking_enabled, type: :boolean) - config.add(:system_demand_report_email, type: :string) config.add(:team_ada_email, type: :string) config.add(:team_all_login_emails, type: :json) config.add(:team_daily_reports_emails, type: :json) diff --git a/spec/jobs/reports/irs_weekly_summary_report_spec.rb b/spec/jobs/reports/irs_weekly_summary_report_spec.rb deleted file mode 100644 index ae3e7c1d47f..00000000000 --- a/spec/jobs/reports/irs_weekly_summary_report_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'rails_helper' - -RSpec.describe Reports::IrsWeeklySummaryReport do - subject(:report) { Reports::IrsWeeklySummaryReport.new } - let(:report_name) { 'irs-weekly-summary-report' } - let(:email) { 'foo@bar.com' } - - before do - create_list(:user, 10, { created_at: Date.yesterday }) - end - - describe '#perform' do - it 'sends out a report to the email listed with system demand' do - allow(IdentityConfig.store).to receive(:system_demand_report_email).and_return(email) - allow(ReportMailer).to receive(:system_demand_report).and_call_original - - report = "Data Requested,Total Count\nSystem Demand,10\n" - expect(ReportMailer).to receive(:system_demand_report).with( - email: email, data: report, name: report_name, - ) - - subject.perform(Time.zone.now) - end - - it 'uploads a file to S3 based on the report date' do - csv_data = CSV.parse(subject.perform(Time.zone.now), headers: true) - expect(csv_data[0]['Total Count']).to eq('10') - end - end -end