Skip to content

Commit

Permalink
store onelogin info on claim
Browse files Browse the repository at this point in the history
  • Loading branch information
asmega authored and kenfodder committed Sep 5, 2024
1 parent 8cc1a9f commit f8ce898
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/models/claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class Claim < ApplicationRecord
logged_in_with_onelogin: false,
onelogin_credentials: true,
onelogin_user_info: true,
onelogin_uid: true,
onelogin_auth_at: false,
onelogin_idv_at: false,
onelogin_idv_first_name: true,
onelogin_idv_last_name: true,
onelogin_idv_date_of_birth: true,
paye_reference: true,
practitioner_email_address: true,
provider_contact_name: true
Expand Down
2 changes: 2 additions & 0 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ shared:
- journeys_session_id
- identity_confirmed_with_onelogin
- logged_in_with_onelogin
- onelogin_auth_at
- onelogin_idv_at
:decisions:
- id
- result
Expand Down
4 changes: 4 additions & 0 deletions config/analytics_blocklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
- paye_reference
- practitioner_email_address
- provider_contact_name
- onelogin_uid
- onelogin_idv_first_name
- onelogin_idv_last_name
- onelogin_idv_date_of_birth
:claim_decisions:
- trn
- claimant_age
Expand Down
10 changes: 10 additions & 0 deletions db/migrate/20240904150711_add_onelogin_idv_to_claims.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AddOneloginIdvToClaims < ActiveRecord::Migration[7.0]
def change
add_column :claims, :onelogin_uid, :text
add_column :claims, :onelogin_auth_at, :datetime
add_column :claims, :onelogin_idv_at, :datetime
add_column :claims, :onelogin_idv_first_name, :text
add_column :claims, :onelogin_idv_last_name, :text
add_column :claims, :onelogin_idv_date_of_birth, :date
end
end
8 changes: 7 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2024_09_04_105917) do
ActiveRecord::Schema[7.0].define(version: 2024_09_04_150711) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "pg_trgm"
Expand Down Expand Up @@ -105,6 +105,12 @@
t.string "paye_reference"
t.string "practitioner_email_address"
t.string "provider_contact_name"
t.text "onelogin_uid"
t.datetime "onelogin_auth_at"
t.datetime "onelogin_idv_at"
t.text "onelogin_idv_first_name"
t.text "onelogin_idv_last_name"
t.date "onelogin_idv_date_of_birth"
t.index ["academic_year"], name: "index_claims_on_academic_year"
t.index ["created_at"], name: "index_claims_on_created_at"
t.index ["eligibility_type", "eligibility_id"], name: "index_claims_on_eligibility_type_and_eligibility_id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
expect(claim.onelogin_credentials).to eq(answers.onelogin_credentials)
expect(claim.onelogin_user_info).to eq(answers.onelogin_user_info)

expect(claim.onelogin_uid).to eql(answers.onelogin_uid)
expect(claim.onelogin_auth_at).to eql(answers.onelogin_auth_at)
expect(claim.onelogin_idv_at).to eql(answers.onelogin_idv_at)
expect(claim.onelogin_idv_first_name).to eql(answers.onelogin_idv_first_name)
expect(claim.onelogin_idv_last_name).to eql(answers.onelogin_idv_last_name)
expect(claim.onelogin_idv_date_of_birth).to eql(answers.onelogin_idv_date_of_birth)

expect(eligibility.award_amount).to eq(answers.award_amount)
expect(eligibility.teacher_reference_number).to eq(answers.teacher_reference_number)
expect(eligibility.teaching_responsibilities).to eq(answers.teaching_responsibilities)
Expand Down
4 changes: 4 additions & 0 deletions spec/models/claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,10 @@
:column_to_remove_teacher_reference_number,
:onelogin_credentials,
:onelogin_user_info,
:onelogin_uid,
:onelogin_idv_first_name,
:onelogin_idv_last_name,
:onelogin_idv_date_of_birth,
:paye_reference,
:practitioner_email_address,
:provider_contact_name
Expand Down

0 comments on commit f8ce898

Please sign in to comment.