Skip to content

Commit

Permalink
fix: person details when fn and gn are missing
Browse files Browse the repository at this point in the history
* Fix person details when fn and gn are missing

This commit fixes output display issues with those certificates that don't include the fn (familyName) and gn (givenName) fields, but for instance only the fnt field.

-----------------

Details :
Some foreign certificates only include the fnt field = no fn and gn fields.
Therefore - owing to the current declaration of fun setPersonData - the validation output of such certificates doesn't contain any person details of the certificate holder.

-----------------

Fix description :
It checks if the fn field name is null/empty.
- If true setPersonData uses the fnt + gnt + gn fields in order to arrange the text for the person details into the validation output.
- Otherwise setPersonData uses fn + gn .

Issue Reference :
- DGC-SDK 119
- ministero-salute/it-dgc-verificac19-sdk-android#119

* Delete codeql-analysis.yml
  • Loading branch information
rawmain authored Feb 14, 2022
1 parent 6ffa15a commit 2141923
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ class VerificationFragment : Fragment(), View.OnClickListener {
}

private fun setPersonData(person: PersonModel?, dateOfBirth: String?) {
binding.nameStandardisedText.text = person?.familyName.plus(" ").plus(person?.givenName)
if (person?.familyName.isNullOrEmpty()) {
binding.nameStandardisedText.text = person?.standardisedFamilyName.plus(" ").plus(person?.standardisedGivenName).plus(" ").plus(person?.givenName)
} else {
binding.nameStandardisedText.text = person?.familyName.plus(" ").plus(person?.givenName)
}
binding.birthdateText.text = dateOfBirth?.formatDateOfBirth().orEmpty()
}

Expand Down

0 comments on commit 2141923

Please sign in to comment.