Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
feat: management of healing certificate with flag type dgc
Browse files Browse the repository at this point in the history
  • Loading branch information
andcomito committed Feb 17, 2022
1 parent 2563482 commit 66c92f1
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,39 +192,44 @@ private fun eudccMap(): Map<String, Map<String, String>> {
"vaccine_first_dose" to "Certificazione valida fino alla prossima dose",
"vaccine_fully_completed" to "Certificazione valida 365 giorni (12 mesi) dalla data dell'ultima somministrazione",
"healing_certificate" to "Certificazione valida in Unione Europea fino alla data di fine validità e valida solo in Italia fino a 6 mesi dalla data di inizio validità",
"vaccine_booster" to "Certificazione valida 180 giorni (6 mesi) dalla data dell'ultima somministrazione, salvo modifiche normative"
"vaccine_booster" to "Certificazione valida 180 giorni (6 mesi) dalla data dell'ultima somministrazione, salvo modifiche normative",
"cbis" to "Certificazione valida in Unione Europea fino alla data di fine validità e valida in Italia 540 giorni (18 mesi) dalla data di inizio validità, salvo modifiche normative"
),
"de" to mapOf(
"molecular_test" to "Bescheinigung gültig für 72 Stunden ab dem Zeitpunkt der Abholung",
"rapid_test" to "Bescheinigung gültig für 48 Stunden ab dem Zeitpunkt der Abholung",
"vaccine_first_dose" to "Zertifizierung gültig bis zur nächsten Dosis",
"vaccine_fully_completed" to "Zertifizierung gültig für 365 Tage (12 Monate) ab dem Datum der letzten Verabreichung",
"healing_certificate" to "Zertifizierung gültig in der Europäischen Union bis zum Gültigkeitsende und nur in Italien bis zu 6 Monate ab Gültigkeitsbeginn gültig",
"vaccine_booster" to "Zertifizierung gültig für 180 Tage (6 Monate) ab dem Datum der letzten Verabreichung, vorbehaltlich behördlicher Änderungen"
"vaccine_booster" to "Zertifizierung gültig für 180 Tage (6 Monate) ab dem Datum der letzten Verabreichung, vorbehaltlich behördlicher Änderungen",
"cbis" to "Zertifizierung gültig in der Europäischen Union bis Gültigkeitsende und gültig in Italien 540 Tage (18 Monate) ab Gültigkeitsbeginn, vorbehaltlich behördlicher Änderungen"
),
"en" to mapOf(
"molecular_test" to "Certification valid for 72 hours from the time of collection",
"rapid_test" to "Certification valid for 48 hours from the time of collection",
"vaccine_first_dose" to "Certification valid until next dose",
"vaccine_fully_completed" to "Certification valid for 365 days (12 months) from the date of the last administration",
"healing_certificate" to "Certification valid in the European Union until the end of validity date and valid only in Italy up to 6 months from the start of validity date",
"vaccine_booster" to "Certification valid for 180 days (6 months) from the date of the last administration, subject to regulatory changes"
"vaccine_booster" to "Certification valid for 180 days (6 months) from the date of the last administration, subject to regulatory changes",
"cbis" to "Certification valid in the European Union until the end of validity date and valid in Italy 540 days (18 months) from the start of validity date, subject to regulatory changes"
),
"es" to mapOf(
"molecular_test" to "Certificación válida por 72 horas desde el momento de la recogida.",
"rapid_test" to "Certificación válida por 48 horas desde el momento de la recogida.",
"vaccine_first_dose" to "Certificación válida hasta la próxima dosis",
"vaccine_fully_completed" to "Certificación válida por 365 días (12 meses) a partir de la fecha de la última administración.",
"healing_certificate" to "Certificación válida en la Unión Europea hasta el final de la fecha de validez y válida solo en Italia hasta 6 meses desde el inicio de la fecha de validez",
"vaccine_booster" to "Certificación válida por 180 días (6 meses) a partir de la fecha de la última administración, sujeta a cambios regulatorios"
"vaccine_booster" to "Certificación válida por 180 días (6 meses) a partir de la fecha de la última administración, sujeta a cambios regulatorios",
"cbis" to "Certificación válida en la Unión Europea hasta el final de la fecha de validez y válida en Italia 540 días (18 meses) desde el inicio de la fecha de validez, sujeta a cambios regulatorios"
),
"fr" to mapOf(
"molecular_test" to "Attestation valable 72h à compter de la collecte",
"rapid_test" to "Attestation valable 48h à compter de la collecte",
"vaccine_first_dose" to "Certification valable jusqu'à la prochaine dose",
"vaccine_fully_completed" to "Certification valable 365 jours (12 mois) à compter de la date de la dernière administration",
"healing_certificate" to "Certification valable dans l'Union européenne jusqu'à la date de fin de validité et valable uniquement en Italie jusqu'à 6 mois à compter de la date de début de validité",
"vaccine_booster" to "Certification valable 180 jours (6 mois) à compter de la date de la dernière administration, sous réserve de modifications réglementaires"
"vaccine_booster" to "Certification valable 180 jours (6 mois) à compter de la date de la dernière administration, sous réserve de modifications réglementaires",
"cbis" to "Certification valable dans l'Union européenne jusqu'à la date de fin de validité et valable en Italie 540 jours (18 mois) à compter de la date de début de validité, sous réserve de modifications réglementaires"
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface DCCService {
) : RequestWithPadding

@JsonClass(generateAdapter = true)
data class GreenCardResponse(val qrcode: String)
data class GreenCardResponse(val qrcode: String, val fglTipoDgc: String?)

@POST("v1/ingestion/get-dgc")
suspend fun getGreenCard(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package it.ministerodellasalute.immuni.logic.exposure.models

import java.util.*

data class GreenPassToken(val greenPass: String?, val serverDate: Date?)
data class GreenPassToken(val greenPass: String?, val fglTipoDgc: String?, val serverDate: Date?)

sealed class GreenPassValidationResult {
data class Success(val greenpass: GreenPassToken) : GreenPassValidationResult()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GCDRepository(
}
return when (response) {
is NetworkResource.Success -> GreenPassValidationResult.Success(
GreenPassToken(response.data?.qrcode, response.serverDate!!)
GreenPassToken(response.data?.qrcode, response.data?.fglTipoDgc, response.serverDate!!)
)
is NetworkResource.Error -> {
val errorResponse = response.error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ import kotlinx.android.parcel.Parcelize
@JsonClass(generateAdapter = true)
data class GreenCertificateUser(
@field:Json(name = "base64") val base64: String,
@field:Json(name = "greenCertificate") val data: GreenCertificate?
@field:Json(name = "greenCertificate") val data: GreenCertificate?,
@field:Json(name = "fglTipoDgc") val fglTipoDgc: String? = null
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class GreenCertificateViewModel(
user.value?.greenPass!!.add(
GreenCertificateUser(
base64 = result.greenpass.greenPass.toString(),
data = greenCertificate
data = greenCertificate,
fglTipoDgc = result.greenpass.fglTipoDgc
)
)
userManager.save(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,20 @@ class MoreDetailGreenCertificate : PopupDialogFragment(), KoinComponent {
val molecularTest = settingsManager.settings.value.eudcc_expiration[Locale.getDefault().language]!!["molecular_test"]
val healingCertificate = settingsManager.settings.value.eudcc_expiration[Locale.getDefault().language]!!["healing_certificate"]
val vaccineBooster = settingsManager.settings.value.eudcc_expiration[Locale.getDefault().language]!!["vaccine_booster"]
val cbis = settingsManager.settings.value.eudcc_expiration[Locale.getDefault().language]!!["cbis"]

setUI(
vaccineFullyCompleted,
vaccineFirstDose,
molecularTest,
rapidTest,
healingCertificate,
vaccineBooster
vaccineBooster,
cbis
)
}

private fun setUI(validUntilCompleteVaccine: String?, validUntilnotCompleteVaccine: String?, validUntilMolecularTest: String?, validUntilQuickTest: String?, healingCertificate: String?, vaccineBooster: String?) {
private fun setUI(validUntilCompleteVaccine: String?, validUntilnotCompleteVaccine: String?, validUntilMolecularTest: String?, validUntilQuickTest: String?, healingCertificate: String?, vaccineBooster: String?, cbis: String?) {
var isExemption = false
when (true) {
greenCertificateDetail.data?.vaccinations != null -> {
Expand Down Expand Up @@ -208,7 +211,10 @@ class MoreDetailGreenCertificate : PopupDialogFragment(), KoinComponent {
certificateIssuerLabelEng.visibility = View.GONE
certificateIssuerLabel.visibility = View.GONE
entityIssuedCertificate.visibility = View.GONE
validityHealing.text = healingCertificate ?: getString(R.string.green_certificate_validity_healing)
validityHealing.text = when (greenCertificateDetail.fglTipoDgc) {
"cbis" -> cbis ?: getString(R.string.green_certificate_validity_healing_cbis)
else -> healingCertificate ?: getString(R.string.green_certificate_validity_healing)
}
certificateIssuerLabelExemption.visibility = View.GONE
}
greenCertificateDetail.data?.exemptions != null -> {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -511,4 +511,5 @@ Betriebssystem: iOS 13.5.1; Modell: iPhone XS; Expositionsmeldungen: Aktiv; [wei
<string name="green_certificate_exemption_footer">Diese Zertifizierung ist nur in <b>Italien</b> gültig und kann verwendet werden, um die grüne COVID-19-Zertifizierung für die Durchführung von Aktivitäten und die Nutzung von Dienstleistungen gemäß der geltenden nationalen Gesetzgebung zu ersetzen</string>
<string name="green_certificate_validity_vaccine_booster">Zertifizierung gültig für 180 Tage (6 Monate) ab dem Datum der letzten Verabreichung, vorbehaltlich behördlicher Änderungen</string>
<string name="title_dialog_find_out_more_state_close">Quarantäne und Isolation</string>
<string name="green_certificate_validity_healing_cbis">Zertifizierung gültig in der Europäischen Union bis Gültigkeitsende und gültig in Italien 540 Tage (18 Monate) ab Gültigkeitsbeginn, vorbehaltlich behördlicher Änderungen</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -514,4 +514,5 @@ Sistema operativo: iOS 13.5.1; modelo: iPhone XS; notificaciones de exposición:
<string name="green_certificate_certificate_issuer_exemption">Sujeto que emitió el certificado de exención digital</string>
<string name="green_certificate_validity_vaccine_booster">Certificación válida por 180 días (6 meses) a partir de la fecha de la última administración, sujeta a cambios regulatorios</string>
<string name="title_dialog_find_out_more_state_close">Cuarentena y aislamiento</string>
<string name="green_certificate_validity_healing_cbis">Certificación válida en la Unión Europea hasta el final de la fecha de validez y válida en Italia 540 días (18 meses) desde el inicio de la fecha de validez, sujeta a cambios regulatorios</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -513,5 +513,6 @@ Système d\'exploitation : iOS 13.5.1; Modèle iPhone XS ; Notifications de risq
<string name="green_certificate_certificate_issuer_exemption">Sujet qui a délivré le certificat d\'exemption numérique</string>
<string name="green_certificate_validity_vaccine_booster">Certification valable 180 jours (6 mois) à compter de la date de la dernière administration, sous réserve de modifications réglementaires</string>
<string name="title_dialog_find_out_more_state_close">Quarantaine et isolement</string>
<string name="green_certificate_validity_healing_cbis">Certification valable dans l\'Union européenne jusqu\'à la date de fin de validité et valable en Italie 540 jours (18 mois) à compter de la date de début de validité, sous réserve de modifications réglementaires</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -513,5 +513,6 @@ Sistema operativo: iOS 13.5.1; Modello iPhone XS; Notifiche di esposizione: Atti
<string name="green_certificate_certificate_issuer_exemption">Soggetto che ha rilasciato la certificazione digitale di esenzione</string>
<string name="green_certificate_validity_vaccine_booster">Certificazione valida 180 giorni (6 mesi) dalla data dell\'ultima somministrazione, salvo modifiche normative</string>
<string name="title_dialog_find_out_more_state_close">Quarantena e isolamento</string>
<string name="green_certificate_validity_healing_cbis">Certificazione valida in Unione Europea fino alla data di fine validità e valida in Italia 540 giorni (18 mesi) dalla data di inizio validità, salvo modifiche normative</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -596,4 +596,5 @@ Operating system: iOS 13.5.1; Model: iPhone XS; Exposure notifications: Active;
<string name="green_certificate_validity_vaccine_booster">Certification valid for 180 days (6 months) from the date of the last administration, subject to regulatory changes</string>
<string name="url_quarantine_and_isolation" translatable="false">https://www.salute.gov.it/portale/nuovocoronavirus/dettaglioFaqNuovoCoronavirus.jsp?lingua=italiano&amp;id=244#19</string>
<string name="title_dialog_find_out_more_state_close">Quarantine and isolation</string>
<string name="green_certificate_validity_healing_cbis">Certification valid in the European Union until the end of validity date and valid in Italy 540 days (18 months) from the start of validity date, subject to regulatory changes</string>
</resources>

0 comments on commit 66c92f1

Please sign in to comment.