diff --git a/backend/shared/src/gidx/helpers.ts b/backend/shared/src/gidx/helpers.ts index f5d669f88d..864abcfff4 100644 --- a/backend/shared/src/gidx/helpers.ts +++ b/backend/shared/src/gidx/helpers.ts @@ -18,6 +18,7 @@ import { RegistrationReturnType, timeoutCodes, underageErrorCodes, + uploadedDocsToVerifyIdentity, } from 'common/reason-codes' import { createSupabaseDirectClient } from 'shared/supabase/init' import { intersection } from 'lodash' @@ -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:', diff --git a/common/src/reason-codes.ts b/common/src/reason-codes.ts index c0fed857dc..f3acc396f4 100644 --- a/common/src/reason-codes.ts +++ b/common/src/reason-codes.ts @@ -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 = {