Skip to content

[MS-1336] Fayda card support added#1748

Draft
alexandr-simprints wants to merge 5 commits into
mainfrom
MS-1336-fayda-mfid-support
Draft

[MS-1336] Fayda card support added#1748
alexandr-simprints wants to merge 5 commits into
mainfrom
MS-1336-fayda-mfid-support

Conversation

@alexandr-simprints

Copy link
Copy Markdown
Contributor

JIRA ticket
Will be released in: 2026.3.0

MFID: Ethiopian Fayda ID card support is added

Screenshot_20260715_140746 Screenshot_20260715_122257 image

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Ethiopian Fayda ID card support to the MFID (Multi‑Factor Identification) flow by introducing a new external credential type and wiring it through config, OCR scanning, UI selection, and event/cosync mappings.

Changes:

  • Introduces ExternalCredentialType.FaydaCard across domain, config-store (proto + models), and event serialization mappings.
  • Adds Fayda OCR scanning support (document type, scan result/document models, OCR reader) and UI strings/resources.
  • Updates selection/search flows and event tracking to recognize Fayda FAN length and behavior.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
testing/data-generator/src/main/java/com/simprints/feature/datagenerator/enrollmentrecords/InsertEnrollmentRecordsUseCase.kt Adds dummy Fayda credential value for generated records.
infra/resources/src/main/res/values/strings.xml Adds Fayda MFID strings (type + field label).
infra/events/src/main/java/com/simprints/infra/events/event/cosync/v1/CoSyncExternalCredentialType.kt Adds Fayda to CoSync enum and mappings.
infra/core/src/main/java/com/simprints/core/domain/externalcredential/ExternalCredentialType.kt Adds new domain enum value FaydaCard.
infra/config-store/src/main/proto/project_config.proto Adds Fayda external credential type and config message in proto.
infra/config-store/src/main/java/com/simprints/infra/config/store/remote/models/ApiMultiFactorIdConfiguration.kt Adds Fayda config + API enum mapping.
infra/config-store/src/main/java/com/simprints/infra/config/store/models/MultiFactorIdConfiguration.kt Adds Fayda config model to MFID configuration.
infra/config-store/src/main/java/com/simprints/infra/config/store/local/models/MutliFactorIdConfiguration.kt Adds Fayda config proto/domain conversion.
infra/config-store/src/main/java/com/simprints/infra/config/store/local/models/ExternalCredentialType.kt Adds Fayda to local proto<->domain credential mappings.
feature/orchestrator/src/main/java/com/simprints/feature/orchestrator/usecases/response/AppExternalCredentialMapper.kt Supports mapping Fayda MFID document into app model.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/usecase/ExternalCredentialEventTrackerUseCase.kt Adds expected FAN length for capture metrics.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/select/view/ExternalCredentialTypeAdapter.kt Adds Fayda label + image in selection UI.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/select/ExternalCredentialSelectFragment.kt Routes Fayda selection into OCR flow.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/search/model/SearchCredentialState.kt Treats Fayda as OCR readout (confirm/edit enabled).
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/search/model/ScannedCredentialResult.kt Maps Fayda MFID document to ExternalCredentialType.FaydaCard.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/search/model/MfidDocument.kt Adds serialized MfidDocument.FaydaCard.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/search/ExternalCredentialSearchViewModel.kt Adds Fayda keyboard/input validation behavior.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/usecase/ScanMfidDocumentUseCase.kt Adds Fayda OCR reader wiring + config access.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/usecase/FaydaCardOcrReaderUseCase.kt Implements OCR extraction for FAN (16 digits).
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/usecase/BuildMfidDocumentUseCase.kt Builds MfidDocument.FaydaCard from scans.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/reader/OcrQuery.kt Adds predicate-based OCR query filter helper.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/model/ScannedMfidDocument.kt Adds Fayda mapping to OCR document type.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/model/OcrScanResult.kt Adds serialized OcrScanResult.FaydaCard.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/model/OcrDocumentType.kt Adds Fayda OCR document type + conversions.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/ExternalCredentialScanOcrViewModel.kt Adds Fayda document type string selection.
feature/external-credential/src/main/java/com/simprints/feature/externalcredential/ext/ResourceExt.kt Adds Fayda credential field/type string mapping helpers.

Comment on lines 8 to 11
val nhisCardConfig: NhisCardConfig?,
val qrCodeConfig: QrCodeConfig?,
val faydaCardConfig: FaydaCardConfig?,
)
Comment on lines 17 to 21
private val readTextFromImage: ReadTextFromImageUseCase,
private val ghanaNhisCardOcrReaderUseCase: GhanaNhisCardOcrReaderUseCase,
private val ghanaIdCardOcrReaderUseCase: GhanaIdCardOcrReaderUseCase,
private val faydaCardOcrReaderUseCase: FaydaCardOcrReaderUseCase,
private val credentialImageRepository: CredentialImageRepository,
Comment on lines +501 to +505
<string name="mfid_type_fayda_card">Fayda Card</string>
<string name="mfid_nhis_card_credential_field">Membership number</string>
<string name="mfid_ghana_id_credential_field">Personal ID</string>
<string name="mfid_qr_credential_field">QR Code value</string>
<string name="mfid_fayda_card_credential_field">Fayda Alias Number (FAN)</string>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 31 out of 32 changed files in this pull request and generated 3 comments.

filters += { line -> regex.matches(line.text) }
}

fun matchesCondition(condition: (line: String) -> Boolean) {
val isCapturingAllFields = when (documentType) {
OcrDocumentType.NhisCard -> config.nhisCardConfig?.isCapturingAllFields
OcrDocumentType.GhanaIdCard -> config.ghanaIdCardConfig?.isCapturingAllFields
OcrDocumentType.FaydaCard -> config.faydaCardConfig?.isCapturingAllFields
Comment on lines 28 to +31
// [MS-1484] Editing and confirming the readout value should only be available for the OCR readouts (i.e.: Ghana NHIS card)
// QR codes are not readable by humans, hence there is no point of asking the user to confirm the readout, nor to edit the readout
val isOcrReadout = when (scannedCredentialResult.credentialType) {
ExternalCredentialType.NHISCard, ExternalCredentialType.GhanaIdCard -> true
ExternalCredentialType.NHISCard, ExternalCredentialType.GhanaIdCard, ExternalCredentialType.FaydaCard -> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants