Table of Contents

Interface IDocVerificationChallengeRepository

Namespace
SEBT.Portal.Core.Repositories
Assembly
SEBT.Portal.Core.dll

Repository for managing document verification challenge records. All read operations are scoped by userId to enforce ownership.

public interface IDocVerificationChallengeRepository

Methods

CreateAsync(DocVerificationChallenge, CancellationToken)

Creates a new challenge record.

Task CreateAsync(DocVerificationChallenge challenge, CancellationToken cancellationToken = default)

Parameters

challenge DocVerificationChallenge
cancellationToken CancellationToken

Returns

Task

GetActiveByUserIdAsync(Guid, CancellationToken)

Retrieves the active (non-terminal) challenge for a user, if one exists. Used to enforce the one-active-challenge-per-user constraint.

Task<DocVerificationChallenge?> GetActiveByUserIdAsync(Guid userId, CancellationToken cancellationToken = default)

Parameters

userId Guid
cancellationToken CancellationToken

Returns

Task<DocVerificationChallenge>

GetByEvalIdAsync(string, CancellationToken)

Retrieves a challenge by its Socure evaluation ID (fallback correlation).

Task<DocVerificationChallenge?> GetByEvalIdAsync(string evalId, CancellationToken cancellationToken = default)

Parameters

evalId string
cancellationToken CancellationToken

Returns

Task<DocVerificationChallenge>

GetByPublicIdAsync(Guid, Guid, CancellationToken)

Retrieves a challenge by its public ID and owning user ID. Returns null if the challenge does not exist or belongs to a different user.

Task<DocVerificationChallenge?> GetByPublicIdAsync(Guid publicId, Guid userId, CancellationToken cancellationToken = default)

Parameters

publicId Guid
userId Guid
cancellationToken CancellationToken

Returns

Task<DocVerificationChallenge>

GetBySocureReferenceIdAsync(string, CancellationToken)

Retrieves a challenge by its Socure reference ID for webhook correlation. Falls back to EvalId if referenceId lookup returns null.

Task<DocVerificationChallenge?> GetBySocureReferenceIdAsync(string referenceId, CancellationToken cancellationToken = default)

Parameters

referenceId string
cancellationToken CancellationToken

Returns

Task<DocVerificationChallenge>

GetLatestSocureReferenceIdByUserIdAsync(Guid, CancellationToken)

Retrieves the Socure reference ID from the user's most recent challenge that has one, or null when the user has never reached a Socure verification session. Used to pass the identifier to state connectors for cross-system correlation.

Task<string?> GetLatestSocureReferenceIdByUserIdAsync(Guid userId, CancellationToken cancellationToken = default)

Parameters

userId Guid
cancellationToken CancellationToken

Returns

Task<string>

UpdateAsync(DocVerificationChallenge, CancellationToken)

Updates an existing challenge record.

Task UpdateAsync(DocVerificationChallenge challenge, CancellationToken cancellationToken = default)

Parameters

challenge DocVerificationChallenge
cancellationToken CancellationToken

Returns

Task