Skip to content

Commit

Permalink
check sheerid response with profile completion
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Jan 19, 2024
1 parent 84fdef2 commit 305cc54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/sheerid_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def current_step_to_faculty_status
when VERIFIED
User.faculty_statuses[:confirmed_faculty]
when REJECTED
User.faculty_statuses[:rejected_faculty]
User.faculty_statuses[:rejected_by_sheerid]
else
User.faculty_statuses[:pending_faculty]
end
Expand Down
10 changes: 8 additions & 2 deletions app/routines/newflow/create_or_update_salesforce_lead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ def exec(user:)
adoption_json = build_book_adoption_json_for_salesforce(user)
end

# The user has not finished signing up, check for confirmed faculty if they were verified by sheerid
if !user.is_profile_complete? && !user.faculty_status == :confirmed_faculty
# Check the state of the SheerID response and profile completion to determine faculty status for lead
sheerid_response = SheeridVerification.find_by(verification_id: user.sheerid_verification_id)
if user.is_profile_complete?
user.faculty_status = :pending_faculty
unless sheerid_response.nil?
user.faculty_status = sheerid_response.current_step_to_faculty_status
end
else
user.faculty_status = :incomplete_signup
end

Expand Down

0 comments on commit 305cc54

Please sign in to comment.