diff --git a/Sources/CTR/Interface/Holder/Event/Details/RemoteEventDetailsGenerator.swift b/Sources/CTR/Interface/Holder/Event/Details/RemoteEventDetailsGenerator.swift index 4269f9b51..2b954d01c 100644 --- a/Sources/CTR/Interface/Holder/Event/Details/RemoteEventDetailsGenerator.swift +++ b/Sources/CTR/Interface/Holder/Event/Details/RemoteEventDetailsGenerator.swift @@ -58,7 +58,7 @@ class NegativeTestDetailsGenerator { results += [EventDetails(field: EventDetailsTest.countryTestedIn, value: countryTestedIn)] } - results += [EventDetails(field: EventDetailsTest.uniqueIdentifer, value: event.unique)] + results += [EventDetails(field: EventDetailsTest.uniqueIdentifer, value: event.nonBreakingUnique)] return results } @@ -113,7 +113,7 @@ class PositiveTestDetailsGenerator { results += [EventDetails(field: EventDetailsTest.countryTestedIn, value: countryTestedIn)] } - results += [EventDetails(field: EventDetailsTest.uniqueIdentifer, value: event.unique)] + results += [EventDetails(field: EventDetailsTest.uniqueIdentifer, value: event.nonBreakingUnique)] return results } @@ -177,7 +177,7 @@ class DCCTestDetailsGenerator { EventDetails(field: EventDetailsDCCTest.facility, value: mappingManager.getDisplayFacility(test.testCenter)), EventDetails(field: EventDetailsDCCTest.country, value: mappingManager.getDisplayCountry(test.country)), EventDetails(field: EventDetailsDCCTest.issuer, value: mappingManager.getDisplayIssuer(test.issuer, country: test.country)), - EventDetails(field: EventDetailsDCCTest.certificateIdentifier, value: test.certificateIdentifier) + EventDetails(field: EventDetailsDCCTest.certificateIdentifier, value: test.nonBreakingCertificateIdentifier) ] } } @@ -242,7 +242,7 @@ class VaccinationDetailsGenerator { details += [EventDetails(field: EventDetailsVaccination.completionReason, value: event.vaccination?.completionStatus)] details += [EventDetails(field: EventDetailsVaccination.date, value: formattedShotDate)] details += [EventDetails(field: EventDetailsVaccination.country, value: country)] - details += [EventDetails(field: EventDetailsVaccination.uniqueIdentifer, value: event.unique)] + details += [EventDetails(field: EventDetailsVaccination.uniqueIdentifer, value: event.nonBreakingUnique)] return details } @@ -284,7 +284,7 @@ class DCCVaccinationDetailsGenerator { EventDetails(field: EventDetailsDCCVaccination.date, value: formattedVaccinationDate), EventDetails(field: EventDetailsDCCVaccination.country, value: mappingManager.getDisplayCountry(vaccination.country)), EventDetails(field: EventDetailsDCCVaccination.issuer, value: mappingManager.getDisplayIssuer(vaccination.issuer, country: vaccination.country)), - EventDetails(field: EventDetailsDCCVaccination.certificateIdentifier, value: vaccination.certificateIdentifier) + EventDetails(field: EventDetailsDCCVaccination.certificateIdentifier, value: vaccination.nonBreakingCertificateIdentifier) ] } } @@ -313,7 +313,7 @@ class VaccinationAssessementDetailsGenerator { if country != "" { list.append(EventDetails(field: EventDetailsVaccinationAssessment.country, value: country)) } - list.append(EventDetails(field: EventDetailsVaccinationAssessment.uniqueIdentifer, value: event.unique)) + list.append(EventDetails(field: EventDetailsVaccinationAssessment.uniqueIdentifer, value: event.nonBreakingUnique)) return list } } @@ -342,7 +342,7 @@ class RecoveryDetailsGenerator { EventDetails(field: EventDetailsRecovery.date, value: formattedShortTestDate), EventDetails(field: EventDetailsRecovery.validFrom, value: formattedShortValidFromDate), EventDetails(field: EventDetailsRecovery.validUntil, value: formattedShortValidUntilDate), - EventDetails(field: EventDetailsRecovery.uniqueIdentifer, value: event.unique) + EventDetails(field: EventDetailsRecovery.uniqueIdentifer, value: event.nonBreakingUnique) ] } } @@ -372,11 +372,13 @@ class DCCRecoveryDetailsGenerator { EventDetails(field: EventDetailsDCCRecovery.issuer, value: mappingManager.getDisplayIssuer(recovery.issuer, country: recovery.country)), EventDetails(field: EventDetailsDCCRecovery.validFrom, value: formattedValidFromDate), EventDetails(field: EventDetailsDCCRecovery.validUntil, value: formattedValidUntilDate), - EventDetails(field: EventDetailsDCCRecovery.certificateIdentifier, value: recovery.certificateIdentifier) + EventDetails(field: EventDetailsDCCRecovery.certificateIdentifier, value: recovery.nonBreakingCertificateIdentifier) ] } } +// MARK: - completion status + private extension EventFlow.VaccinationEvent { /// Get a display version of the vaccination completion status @@ -398,3 +400,36 @@ private extension EventFlow.VaccinationEvent { } } } + +// MARK: - Non breaking Unique / Identifier + +extension EventFlow.Event { + + public var nonBreakingUnique: String? { + if let unique { + return unique.replacingOccurrences(of: "-", with: "\u{2011}") + } + return nil + } +} + +extension EuCredentialAttributes.Vaccination { + + public var nonBreakingCertificateIdentifier: String { + return certificateIdentifier.replacingOccurrences(of: "-", with: "\u{2011}") + } +} + +extension EuCredentialAttributes.RecoveryEntry { + + public var nonBreakingCertificateIdentifier: String { + return certificateIdentifier.replacingOccurrences(of: "-", with: "\u{2011}") + } +} + +extension EuCredentialAttributes.TestEntry { + + public var nonBreakingCertificateIdentifier: String { + return certificateIdentifier.replacingOccurrences(of: "-", with: "\u{2011}") + } +}