Skip to content

Commit

Permalink
Bypass identity score if uploaded docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Sep 18, 2024
1 parent 4c61e25 commit b7e3ef2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/shared/src/gidx/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
RegistrationReturnType,
timeoutCodes,
underageErrorCodes,
uploadedDocsToVerifyIdentity,
} from 'common/reason-codes'
import { createSupabaseDirectClient } from 'shared/supabase/init'
import { intersection } from 'lodash'
Expand Down Expand Up @@ -254,7 +255,13 @@ export const verifyReasonCodes = async (
FraudConfidenceScore !== undefined &&
IdentityConfidenceScore !== undefined &&
(FraudConfidenceScore < IDENTITY_AND_FRAUD_THRESHOLD ||
IdentityConfidenceScore < IDENTITY_AND_FRAUD_THRESHOLD)
IdentityConfidenceScore < IDENTITY_AND_FRAUD_THRESHOLD) &&
// If they uploaded docs to verify their identity, their ID score is meaningless
!(
uploadedDocsToVerifyIdentity(ReasonCodes) &&
FraudConfidenceScore >= IDENTITY_AND_FRAUD_THRESHOLD &&
IdentityConfidenceScore === 0
)
) {
log(
'Registration failed, resulted in low confidence scores:',
Expand Down
5 changes: 5 additions & 0 deletions common/src/reason-codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ export const limitTo5kCashoutCodes: string[] = [
'LL-GEO-US-FL', // Location Florida
]

export const uploadedDocsToVerifyIdentity = (reasonCodes: string[]) =>
['DOC-REV-COMPL', 'ID-FAIL', 'ID-VERIFIED'].every((code) =>
reasonCodes.includes(code)
)

export const documentsReadyCodes: string[] = ['DOC-REV-COMPL', 'DOC-UPLOADED']

export type RegistrationReturnType = {
Expand Down

0 comments on commit b7e3ef2

Please sign in to comment.