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
12 changes: 3 additions & 9 deletions app/forms/api/profile_creation_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def create_profile
move_pii_to_user_session
elsif user_bundle.gpo_address_verification?
create_gpo_entry
elsif pending_in_person_enrollment?
elsif in_person_enrollment?
UspsInPersonProofing::EnrollmentHelper.schedule_in_person_enrollment(user, session[:pii])
end
end

def deactivation_reason
if !phone_confirmed? || user_bundle.gpo_address_verification?
:gpo_verification_pending
elsif pending_in_person_enrollment?
elsif in_person_enrollment?
:in_person_verification_pending
elsif threatmetrix_failed_and_needs_review?
:threatmetrix_review_pending
Expand All @@ -71,15 +71,10 @@ def cache_encrypted_pii
end

def associate_in_person_enrollment_with_profile
return unless pending_in_person_enrollment? && user.establishing_in_person_enrollment
return unless in_person_enrollment? && user.establishing_in_person_enrollment
user.establishing_in_person_enrollment.update(profile: profile)
end

def pending_in_person_enrollment?
return false unless IdentityConfig.store.in_person_proofing_enabled
ProofingComponent.find_by(user: user)&.document_check == Idp::Constants::Vendors::USPS
end

def phone_confirmed?
user_bundle.vendor_phone_confirmation? && user_bundle.user_phone_confirmation?
end
Expand Down Expand Up @@ -171,7 +166,6 @@ def public_key
end

def in_person_enrollment?
return false unless IdentityConfig.store.in_person_proofing_enabled
ProofingComponent.find_by(user: user)&.document_check == Idp::Constants::Vendors::USPS
end

Expand Down
3 changes: 1 addition & 2 deletions app/forms/gpo_verify_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ def reset_sensitive_fields
end

def pending_in_person_enrollment?
return false unless IdentityConfig.store.in_person_proofing_enabled
pending_profile.proofing_components&.[]('document_check') == Idp::Constants::Vendors::USPS
pending_profile&.proofing_components&.[]('document_check') == Idp::Constants::Vendors::USPS
end

def activate_profile
Expand Down
12 changes: 3 additions & 9 deletions app/services/idv/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def create_profile_from_applicant_with_password(user_password)
move_pii_to_user_session
elsif address_verification_mechanism == 'gpo'
create_gpo_entry
elsif pending_in_person_enrollment?
elsif in_person_enrollment?
UspsInPersonProofing::EnrollmentHelper.schedule_in_person_enrollment(
current_user,
applicant,
Expand All @@ -72,7 +72,7 @@ def create_profile_from_applicant_with_password(user_password)
def deactivation_reason
if !phone_confirmed? || address_verification_mechanism == 'gpo'
:gpo_verification_pending
elsif pending_in_person_enrollment?
elsif in_person_enrollment?
:in_person_verification_pending
end
end
Expand All @@ -94,17 +94,12 @@ def clear
user_session.delete(:idv)
end

def pending_in_person_enrollment?
return false unless IdentityConfig.store.in_person_proofing_enabled
ProofingComponent.find_by(user: current_user)&.document_check == Idp::Constants::Vendors::USPS
end

def phone_confirmed?
vendor_phone_confirmation == true && user_phone_confirmation == true
end

def associate_in_person_enrollment_with_profile
return unless pending_in_person_enrollment? && current_user.establishing_in_person_enrollment
return unless in_person_enrollment? && current_user.establishing_in_person_enrollment
current_user.establishing_in_person_enrollment.update(profile: profile)
end

Expand Down Expand Up @@ -169,7 +164,6 @@ def build_profile_maker(user_password)
end

def in_person_enrollment?
return false unless IdentityConfig.store.in_person_proofing_enabled
ProofingComponent.find_by(user: current_user)&.document_check == Idp::Constants::Vendors::USPS
end
end
Expand Down