-
Notifications
You must be signed in to change notification settings - Fork 1
[MS-1290] Each credential match now produces a OneToOne event #1532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,10 +4,12 @@ import com.simprints.core.domain.externalcredential.ExternalCredential | |||||
| import com.simprints.core.domain.externalcredential.ExternalCredentialType | ||||||
| import com.simprints.core.tools.time.TimeHelper | ||||||
| import com.simprints.core.tools.time.Timestamp | ||||||
| import com.simprints.feature.externalcredential.model.CredentialMatch | ||||||
| import com.simprints.feature.externalcredential.screens.scanocr.usecase.CalculateLevenshteinDistanceUseCase | ||||||
| import com.simprints.feature.externalcredential.screens.search.model.ScannedCredential | ||||||
| import com.simprints.feature.externalcredential.screens.search.model.toExternalCredential | ||||||
| import com.simprints.infra.authstore.AuthStore | ||||||
| import com.simprints.infra.config.store.models.FingerprintConfiguration | ||||||
| import com.simprints.infra.config.store.models.TokenKeyType | ||||||
| import com.simprints.infra.config.store.tokenization.TokenizationProcessor | ||||||
| import com.simprints.infra.config.sync.ConfigManager | ||||||
|
|
@@ -18,9 +20,13 @@ import com.simprints.infra.events.event.domain.models.ExternalCredentialConfirma | |||||
| import com.simprints.infra.events.event.domain.models.ExternalCredentialConfirmationEvent.ExternalCredentialConfirmationResult | ||||||
| import com.simprints.infra.events.event.domain.models.ExternalCredentialSearchEvent | ||||||
| import com.simprints.infra.events.event.domain.models.ExternalCredentialSelectionEvent | ||||||
| import com.simprints.infra.events.event.domain.models.FingerComparisonStrategy | ||||||
| import com.simprints.infra.events.event.domain.models.MatchEntry | ||||||
| import com.simprints.infra.events.event.domain.models.OneToOneMatchEvent | ||||||
| import com.simprints.infra.events.session.SessionEventRepository | ||||||
| import com.simprints.infra.logging.Simber | ||||||
| import javax.inject.Inject | ||||||
| import com.simprints.infra.config.store.models.FingerprintConfiguration.FingerComparisonStrategy as ConfigFingerComparisonStrategy | ||||||
|
|
||||||
| internal class ExternalCredentialEventTrackerUseCase @Inject constructor( | ||||||
| private val timeHelper: TimeHelper, | ||||||
|
|
@@ -30,6 +36,25 @@ internal class ExternalCredentialEventTrackerUseCase @Inject constructor( | |||||
| private val eventRepository: SessionEventRepository, | ||||||
| private val calculateDistance: CalculateLevenshteinDistanceUseCase, | ||||||
| ) { | ||||||
| suspend fun saveMatchEvent( | ||||||
| startTime: Timestamp, | ||||||
| match: CredentialMatch, | ||||||
| ) { | ||||||
| eventRepository.addOrUpdateEvent( | ||||||
| OneToOneMatchEvent( | ||||||
| createdAt = startTime, | ||||||
| endTime = timeHelper.now(), | ||||||
| candidateId = match.matchResult.subjectId, | ||||||
| matcher = match.faceBioSdk?.name ?: match.fingerprintBioSdk?.name!!, | ||||||
| result = with(match.matchResult) { | ||||||
| MatchEntry(subjectId, confidence) | ||||||
| }, | ||||||
| fingerComparisonStrategy = if (match.isFaceMatch) null else getFingerprintComparisonStrategy(match.fingerprintBioSdk!!), | ||||||
alexandr-simprints marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| probeBiometricReferenceId = match.probeReferenceId.orEmpty(), | ||||||
|
||||||
| probeBiometricReferenceId = match.probeReferenceId.orEmpty(), | |
| probeBiometricReferenceId = match.probeReferenceId, |
Uh oh!
There was an error while loading. Please reload this page.