From d8a285b879df99ca28272b621099815ec6c63c8a Mon Sep 17 00:00:00 2001 From: Mike Wong Date: Tue, 19 Jul 2022 14:33:06 +0200 Subject: [PATCH] Make standardized family name optional --- gradle.properties | 2 +- .../sdk/core/models/healthcert/PersonName.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0ac96c7..ffe5704 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ kotlin.code.style=official # Artifact metadata GROUP=ch.admin.bag.covidcertificate POM_ARTIFACT_ID=sdk-core -VERSION_NAME=3.2.0 +VERSION_NAME=3.2.1 # POM metadata POM_NAME=sdk-core diff --git a/src/main/java/ch/admin/bag/covidcertificate/sdk/core/models/healthcert/PersonName.kt b/src/main/java/ch/admin/bag/covidcertificate/sdk/core/models/healthcert/PersonName.kt index d1651b8..495a422 100644 --- a/src/main/java/ch/admin/bag/covidcertificate/sdk/core/models/healthcert/PersonName.kt +++ b/src/main/java/ch/admin/bag/covidcertificate/sdk/core/models/healthcert/PersonName.kt @@ -18,17 +18,17 @@ import java.io.Serializable @JsonClass(generateAdapter = true) data class PersonName( @Json(name = "fn") @get:JsonProperty("fn") val familyName: String?, - @Json(name = "fnt") @get:JsonProperty("fnt") val standardizedFamilyName: String, + @Json(name = "fnt") @get:JsonProperty("fnt") val standardizedFamilyName: String?, @Json(name = "gn") @get:JsonProperty("gn") val givenName: String?, @Json(name = "gnt") @get:JsonProperty("gnt") val standardizedGivenName: String?, ) : Serializable { - fun prettyFamilyName(): String = familyName ?: standardizedFamilyName + fun prettyFamilyName(): String = familyName ?: (standardizedFamilyName ?: "") fun prettyGivenName(): String = givenName ?: (standardizedGivenName ?: "") fun prettyName(): String = "${prettyFamilyName()} ${prettyGivenName()}" // Don't fall back to the givenName if the standardizedGivenName is null, since the givenName can reasonably contain non-standard characters. - fun prettyStandardizedName(): String = "${standardizedFamilyName}<<${standardizedGivenName ?: ""}" + fun prettyStandardizedName(): String = "${standardizedFamilyName ?: ""}<<${standardizedGivenName ?: ""}" } \ No newline at end of file