Skip to content
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
9 changes: 0 additions & 9 deletions app/controllers/concerns/billable_event_trackable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,13 @@ def track_billing_events
if current_session_has_been_billed?
create_sp_return_log(billable: false)
else
increment_sp_monthly_auths
create_sp_return_log(billable: true)
mark_current_session_billed
end
end

private

def increment_sp_monthly_auths
MonthlySpAuthCount.increment(
user_id: current_user.id,
service_provider: current_sp,
ial: sp_session_ial,
)
end

def create_sp_return_log(billable:)
user_ial_context = IalContext.new(
ial: ial_context.ial, service_provider: current_sp, user: current_user,
Expand Down
71 changes: 0 additions & 71 deletions app/jobs/reports/iaa_billing_report.rb

This file was deleted.

14 changes: 0 additions & 14 deletions app/jobs/reports/unique_monthly_auths_report.rb

This file was deleted.

14 changes: 0 additions & 14 deletions app/jobs/reports/unique_yearly_auths_report.rb

This file was deleted.

29 changes: 0 additions & 29 deletions app/models/monthly_sp_auth_count.rb

This file was deleted.

85 changes: 0 additions & 85 deletions app/services/db/identity/iaa_active_user_count.rb

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions app/services/db/monthly_sp_auth_count/unique_yearly_auth_counts.rb

This file was deleted.

18 changes: 0 additions & 18 deletions config/initializers/job_configurations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@
cron: cron_24h,
args: -> { [Time.zone.today] },
},
# Send Unique Monthly Auths Report to S3
unique_monthly_auths: {
class: 'Reports::UniqueMonthlyAuthsReport',
cron: cron_24h,
args: -> { [Time.zone.today] },
},
# Send Unique Yearly Auths Report to S3
unique_yearly_auths: {
class: 'Reports::UniqueYearlyAuthsReport',
cron: cron_24h,
args: -> { [Time.zone.today] },
},
# Send Agency User Counts Report to S3
agency_user_counts: {
class: 'Reports::AgencyUserCountsReport',
Expand Down Expand Up @@ -141,12 +129,6 @@
cron: cron_24h,
args: -> { [Time.zone.today] },
},
# IAA Billing Report
iaa_billing_report: {
class: 'Reports::IaaBillingReport',
cron: cron_24h,
args: -> { [Time.zone.today] },
},
# Send deleted user accounts to S3
deleted_user_accounts: {
class: 'Reports::DeletedUserAccountsReport',
Expand Down
18 changes: 0 additions & 18 deletions spec/features/reports/authorization_count_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,45 +284,27 @@ def visit_idp_from_ial2_saml_sp(issuer:)
end

def expect_ial1_count_only(issuer)
expect(ial1_monthly_auth_count(issuer)).to eq(1)
expect(ial2_monthly_auth_count(issuer)).to eq(0)

ial1_return_logs = SpReturnLog.where(issuer: issuer, billable: true, ial: 1)
ial2_return_logs = SpReturnLog.where(issuer: issuer, billable: true, ial: 2)
expect(ial1_return_logs.count).to eq(1)
expect(ial2_return_logs.count).to eq(0)
end

def expect_ial2_count_only(issuer)
expect(ial1_monthly_auth_count(issuer)).to eq(0)
expect(ial2_monthly_auth_count(issuer)).to eq(1)

ial1_return_logs = SpReturnLog.where(issuer: issuer, billable: true, ial: 1)
ial2_return_logs = SpReturnLog.where(issuer: issuer, billable: true, ial: 2)
expect(ial1_return_logs.count).to eq(0)
expect(ial2_return_logs.count).to eq(1)
end

def expect_ial1_and_ial2_count(issuer)
expect(ial1_monthly_auth_count(issuer)).to eq(1)
expect(ial2_monthly_auth_count(issuer)).to eq(1)

ial1_return_logs = SpReturnLog.where(issuer: issuer, billable: true, ial: 1)
ial2_return_logs = SpReturnLog.where(issuer: issuer, billable: true, ial: 2)
expect(ial1_return_logs.count).to eq(1)
expect(ial2_return_logs.count).to eq(1)
end

def ial2_monthly_auth_count(client_id)
Db::MonthlySpAuthCount::SpMonthTotalAuthCounts.call(today, client_id, 2)
end

def ial1_monthly_auth_count(client_id)
Db::MonthlySpAuthCount::SpMonthTotalAuthCounts.call(today, client_id, 1)
end

def reset_monthly_auth_count_and_login(user)
MonthlySpAuthCount.delete_all
SpReturnLog.delete_all
visit api_saml_logout2022_path
sign_in_live_with_2fa(user)
Expand Down
Loading