Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
32270be
Add by-pass for primary ID check for USPS for EIPP
gina-yamada Jun 28, 2024
4ef2013
Start to add specs for by-pass
gina-yamada Jun 28, 2024
08f084e
Merge branch 'main' of github.com:18F/identity-idp into yamada/LG-137…
gina-yamada Jul 1, 2024
1a4b87e
Added new spec for EIPP primary id by-pass
gina-yamada Jul 2, 2024
6528bee
Clean up specs
gina-yamada Jul 2, 2024
294c346
Fix linter errors
gina-yamada Jul 2, 2024
16cda88
Rework file setup
gina-yamada Jul 2, 2024
01c55c2
Fix linter errors
gina-yamada Jul 2, 2024
9b20990
new method in InPersonEnrollment to check if eipp
gina-yamada Jul 5, 2024
3c03da2
changelog: Upcoming Features, Enhanced In-Person Proofing, By-pass Pr…
gina-yamada Jul 5, 2024
8c474a9
Add specs to test enhanced_ipp? method
gina-yamada Jul 5, 2024
df06822
Update test description
gina-yamada Jul 5, 2024
15f1911
fix linter errors
gina-yamada Jul 5, 2024
d9a3664
Merge branch 'main' of github.com:18F/identity-idp into yamada/LG-137…
gina-yamada Jul 8, 2024
377af30
Update test descriptions
gina-yamada Jul 8, 2024
ecfbdbb
Add mock default values for sponsor ids
gina-yamada Jul 10, 2024
9b6a407
Merge branch 'main' of github.com:18F/identity-idp into yamada/LG-137…
gina-yamada Jul 10, 2024
01eff13
update trait, simplify specs
gina-yamada Jul 11, 2024
b5eb47d
Used trait to add sponsor id in spec
gina-yamada Jul 11, 2024
532652d
Merge branch 'main' of github.com:18F/identity-idp into yamada/LG-137…
gina-yamada Jul 11, 2024
180e4ea
Add sponsor id on in_person_enrollment factory
gina-yamada Jul 11, 2024
7320deb
Merge branch 'main' of github.com:18F/identity-idp into yamada/LG-137…
gina-yamada Jul 12, 2024
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
8 changes: 7 additions & 1 deletion app/jobs/get_usps_proofing_results_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ def fraud_result_pending?(enrollment)
enrollment.profile&.fraud_pending_reason.present?
end

# By-pass Primary ID check if enrollment is Enhanced IPP else check for supporting doc type
Comment thread
gina-yamada marked this conversation as resolved.
def passed_with_primary_id_check?(enrollment, response)
Comment thread
gina-yamada marked this conversation as resolved.
enrollment.enhanced_ipp? ||
SUPPORTED_ID_TYPES.include?(response['primaryIdType'])
end

def process_enrollment_response(enrollment, response)
unless response.is_a?(Hash)
handle_response_is_not_a_hash(enrollment)
Expand All @@ -479,7 +485,7 @@ def process_enrollment_response(enrollment, response)
handle_passed_with_fraud_review_pending(enrollment, response)
elsif passed_with_unsupported_secondary_id_type?(response)
handle_unsupported_secondary_id(enrollment, response)
elsif SUPPORTED_ID_TYPES.include?(response['primaryIdType'])
elsif passed_with_primary_id_check?(enrollment, response)
handle_successful_status_update(enrollment, response)
else
handle_unsupported_id_type(enrollment, response)
Expand Down
4 changes: 4 additions & 0 deletions app/models/in_person_enrollment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def usps_unique_id
user.uuid.delete('-').slice(0, 18)
end

def enhanced_ipp?
Comment thread
gina-yamada marked this conversation as resolved.
IdentityConfig.store.usps_eipp_sponsor_id == sponsor_id
Comment thread
gina-yamada marked this conversation as resolved.
end

private

def on_notification_sent_at_updated
Expand Down
4 changes: 4 additions & 0 deletions config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ development:
state_tracking_enabled: true
telephony_adapter: test
use_dashboard_service_providers: true
usps_ipp_sponsor_id: '111111111111111'
usps_ipp_transliteration_enabled: true
usps_eipp_sponsor_id: '222222222222222'
Comment thread
gina-yamada marked this conversation as resolved.
usps_upload_sftp_directory: "/gsa_order"
usps_upload_sftp_host: localhost
usps_upload_sftp_password: test
Expand Down Expand Up @@ -587,6 +589,8 @@ test:
verify_personal_key_attempt_window_in_minutes: 3
verify_personal_key_max_attempts: 2
usps_ipp_root_url: 'http://localhost:1000'
usps_ipp_sponsor_id: '111111111111111'
usps_eipp_sponsor_id: '222222222222222'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these configs in the test section so that spec/factories/in_person_enrollments.rb will always have a value when they are not set in individual specs

usps_upload_sftp_directory: "/directory"
usps_upload_sftp_host: example.com
usps_upload_sftp_password: pass
Expand Down
5 changes: 3 additions & 2 deletions spec/factories/in_person_enrollments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
selected_location_details { { name: 'BALTIMORE' } }
unique_id { InPersonEnrollment.generate_unique_id }
user { association :user, :fully_registered }
sponsor_id { IdentityConfig.store.usps_ipp_sponsor_id }

trait :establishing do
status { :establishing }
Expand Down Expand Up @@ -42,8 +43,8 @@
association :notification_phone_configuration
end

trait :with_sponsor_id do
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted this trait now that it comes on :in_person_enrollment - see line 8 above

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. 👍🏻

sponsor_id { '123458' }
trait :enhanced_ipp do
sponsor_id { IdentityConfig.store.usps_eipp_sponsor_id }
end
end
end
Loading