Skip to main content

@idpass/data-collect-core / VerificationService

Class: VerificationService

Defined in: services/VerificationService.ts:88

Manages the verification pipeline for self-service submissions.

Self-service submissions route through this service to ensure they are reviewed before being accepted into the system. The service tracks verification status, runs duplicate checks, and logs audit entries for compliance.

Verification records are stored in-memory for client-side usage (IndexedDB-based) and in PostgreSQL for server-side usage. The in-memory implementation used here supports the client library; the backend uses the database-backed OtpStore and verifications table.

Constructors

Constructor

new VerificationService(entityStore, eventStore, duplicateDetectionService): VerificationService

Defined in: services/VerificationService.ts:92

Parameters

entityStore

EntityStore

eventStore

EventStore

duplicateDetectionService

DuplicateDetectionService

Returns

VerificationService

Methods

flagForVerification()

flagForVerification(submissionGuid, entityGuid, tenantId): Promise<void>

Defined in: services/VerificationService.ts:106

Flag a self-service submission for verification. Creates a verification record with "pending" status.

Parameters

submissionGuid

string

GUID of the form submission to verify

entityGuid

string

GUID of the entity the submission targets

tenantId

string

Tenant the submission belongs to

Returns

Promise<void>


checkDuplicates()

checkDuplicates(entityGuid): Promise<DuplicateCheckResult>

Defined in: services/VerificationService.ts:138

Run de-duplication check on the entity associated with a self-service submission.

Parameters

entityGuid

string

GUID of the entity to check

Returns

Promise<DuplicateCheckResult>

Result indicating whether duplicates were found


getVerificationStatus()

getVerificationStatus(submissionGuid): Promise<VerificationStatus | null>

Defined in: services/VerificationService.ts:168

Get verification status for a submission.

Parameters

submissionGuid

string

GUID of the form submission

Returns

Promise<VerificationStatus | null>

The verification status, or null if no record exists


completeVerification()

completeVerification(submissionGuid, result): Promise<void>

Defined in: services/VerificationService.ts:182

Mark verification as complete with the given result. Updates the verification record and logs an audit entry.

Parameters

submissionGuid

string

GUID of the form submission

result

VerificationResult

The verification outcome

Returns

Promise<void>

Throws

Error if no verification record exists for the submission


getVerificationsByTenant()

getVerificationsByTenant(tenantId): Promise<VerificationStatus[]>

Defined in: services/VerificationService.ts:231

Get all verification records for a specific tenant.

Parameters

tenantId

string

The tenant to filter by

Returns

Promise<VerificationStatus[]>

Array of verification records for the tenant