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
1 change: 0 additions & 1 deletion app/controllers/concerns/billable_event_trackable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def create_sp_return_log(billable:)
current_user.active_profile&.verified_at : nil,
profile_requested_issuer: ial_context.bill_for_ial_1_or_2 > 1 ?
current_user.active_profile&.initiating_service_provider_issuer : nil,
requested_at: session[:session_started_at],
returned_at: Time.zone.now,
)
rescue ActiveRecord::RecordNotUnique
Expand Down
2 changes: 2 additions & 0 deletions app/models/sp_return_log.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

class SpReturnLog < ApplicationRecord
self.ignored_columns = %w[requested_at]

# rubocop:disable Rails/InverseOf
belongs_to :user
belongs_to :service_provider,
Expand Down
1 change: 0 additions & 1 deletion spec/controllers/concerns/billable_event_trackable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
billable: true,
ial: ial_context.ial,
issuer: current_sp.issuer,
requested_at: session_started_at,
returned_at: Time.zone.now,
)

Expand Down
1 change: 0 additions & 1 deletion spec/features/account_creation/sp_return_log_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
sp_return_log = SpReturnLog.first
expect(SpReturnLog.count).to eq(1)
expect(sp_return_log.user_id).to eq(user.id)
expect(sp_return_log.requested_at).to_not be_nil
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def add_data_to_tables
User.create!(id: 2, created_at: (timestamp - 1.day))
SpReturnLog.create!(
id: 1,
requested_at: (timestamp - 1.day),
returned_at: (timestamp - 1.day),
request_id: 1, ial: 1, issuer: 'foo'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@
user_id: user12.id,
issuer: iaa3_sp1.issuer,
ial: 2,
requested_at: DateTime.new(2020, 10, 2),
returned_at: DateTime.new(2020, 10, 20),
profile_verified_at: DateTime.new(2020, 10, 20),
billable: true,
Expand Down Expand Up @@ -692,7 +691,6 @@ def create_sp_return_log(user:, issuer:, ial:, returned_at:)
user_id: user.id,
issuer: issuer,
ial: ial,
requested_at: returned_at,
returned_at: returned_at,
profile_verified_at: user.profiles.map(&:verified_at).max,
billable: true,
Expand Down
10 changes: 4 additions & 6 deletions spec/jobs/reports/daily_auths_report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@
friendly_name: 'The App',
agency: agency,
)
# rubocop:disable Layout/LineLength
create(:sp_return_log, ial: 1, issuer: 'a', requested_at: timestamp, returned_at: timestamp, billable: true)
create(:sp_return_log, ial: 1, issuer: 'a', requested_at: timestamp, returned_at: timestamp, billable: true)
create(:sp_return_log, ial: 2, issuer: 'a', requested_at: timestamp, returned_at: timestamp, billable: true)
create(:sp_return_log, ial: 1, issuer: 'a', returned_at: timestamp, billable: true)
create(:sp_return_log, ial: 1, issuer: 'a', returned_at: timestamp, billable: true)
create(:sp_return_log, ial: 2, issuer: 'a', returned_at: timestamp, billable: true)

# extra non-billable row that shouldn't be counter
create(:sp_return_log, ial: 2, issuer: 'a', requested_at: timestamp, returned_at: timestamp, billable: false)
# rubocop:enable Layout/LineLength
create(:sp_return_log, ial: 2, issuer: 'a', returned_at: timestamp, billable: false)
end

it 'aggregates by issuer' do
Expand Down
1 change: 0 additions & 1 deletion spec/jobs/reports/total_monthly_auths_report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
ial: 1,
billable: true,
returned_at: Date.new(2019, 1, 15).to_date,
requested_at: Date.new(2019, 1, 15).to_date,
)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
issuer: issuer,
ial: 1,
user_id: 2,
requested_at: Date.new(2019, 1, 15),
returned_at: Date.new(2019, 1, 15),
billable: true,
)
Expand All @@ -29,7 +28,6 @@
issuer: issuer,
ial: 1,
user_id: 3,
requested_at: Date.new(2019, 1, 15),
returned_at: Date.new(2019, 1, 15),
billable: true,
)
Expand All @@ -41,7 +39,6 @@
issuer: issuer,
ial: 1,
user_id: 3,
requested_at: Date.new(2019, 2, 10),
returned_at: Date.new(2019, 2, 10),
billable: true,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
user_id: user1.id,
issuer: issuer1,
ial: 2,
requested_at: inside_partial_month,
returned_at: inside_partial_month,
profile_verified_at: user1.profiles.map(&:verified_at).max,
billable: false,
Expand All @@ -104,7 +103,6 @@
user_id: user.id,
issuer: issuer,
ial: 2,
requested_at: inside_partial_month,
returned_at: inside_partial_month,
profile_verified_at: user.profiles.map(&:verified_at).min,
billable: true,
Expand All @@ -118,7 +116,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: inside_partial_month,
returned_at: inside_partial_month,
profile_verified_at: user.profiles.map(&:verified_at).max,
billable: true,
Expand All @@ -135,7 +132,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: inside_whole_month,
returned_at: inside_whole_month,
profile_verified_at: user.profiles.map(&:verified_at).max,
billable: true,
Expand All @@ -151,7 +147,6 @@
user_id: user.id,
ial: 2,
issuer: issuer1,
requested_at: inside_whole_month,
returned_at: inside_whole_month,
profile_verified_at: user.profiles.map(&:verified_at).max,
billable: true,
Expand All @@ -167,7 +162,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: inside_whole_month,
returned_at: inside_whole_month,
profile_verified_at: user.profiles.map(&:verified_at).max,
billable: true,
Expand All @@ -183,7 +177,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: inside_whole_month,
returned_at: inside_whole_month,
profile_verified_at: user1.profiles.map(&:verified_at).min,
billable: true,
Expand All @@ -199,7 +192,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: inside_whole_month,
returned_at: inside_whole_month,
profile_verified_at: user.profiles.map(&:verified_at).max,
billable: true,
Expand All @@ -215,7 +207,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: inside_whole_month,
returned_at: DateTime.new(2020, 10, 1).utc,
profile_verified_at: user.profiles.map(&:verified_at).max,
billable: true,
Expand All @@ -225,7 +216,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: inside_whole_month,
returned_at: DateTime.new(2020, 10, 30).utc,
profile_verified_at: user.profiles.map(&:verified_at).max,
billable: true,
Expand All @@ -241,7 +231,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: DateTime.new(2022, 8, 16).utc,
returned_at: DateTime.new(2022, 10, 5).utc,
profile_verified_at: user.profiles[0].verified_at,
billable: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
user: user,
ial: 1,
service_provider: service_provider,
requested_at: partial_month_date,
returned_at: partial_month_date,
billable: true,
)
Expand All @@ -59,7 +58,6 @@
user: user,
ial: 1,
service_provider: service_provider,
requested_at: partial_month_date,
returned_at: partial_month_date,
billable: false,
)
Expand All @@ -71,7 +69,6 @@
user: user,
service_provider: service_provider,
ial: 1,
requested_at: full_month_date,
returned_at: full_month_date,
billable: true,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
user_id: user1.id,
issuer: issuer1,
ial: 1,
requested_at: inside_partial_month,
returned_at: inside_partial_month,
billable: true,
)
Expand All @@ -86,7 +85,6 @@
user_id: user1.id,
issuer: issuer1,
ial: 1,
requested_at: inside_partial_month,
returned_at: inside_partial_month,
billable: false,
)
Expand All @@ -98,7 +96,6 @@
user_id: user.id,
issuer: issuer2,
ial: 2,
requested_at: inside_partial_month,
returned_at: inside_partial_month,
billable: true,
)
Expand All @@ -112,7 +109,6 @@
user_id: user.id,
ial: 1,
issuer: issuer1,
requested_at: inside_whole_month,
returned_at: inside_whole_month,
billable: true,
)
Expand All @@ -127,7 +123,6 @@
user_id: user.id,
ial: 2,
issuer: issuer2,
requested_at: inside_whole_month,
returned_at: inside_whole_month,
billable: true,
)
Expand Down