diff --git a/App/UI/GreenCertificate/ModalDetail/GreenCertificateTestDetail/GreenCertificateTestDetailView.swift b/App/UI/GreenCertificate/ModalDetail/GreenCertificateTestDetail/GreenCertificateTestDetailView.swift index 708a4e85..35a47ec0 100644 --- a/App/UI/GreenCertificate/ModalDetail/GreenCertificateTestDetail/GreenCertificateTestDetailView.swift +++ b/App/UI/GreenCertificate/ModalDetail/GreenCertificateTestDetail/GreenCertificateTestDetailView.swift @@ -20,17 +20,17 @@ struct GreenCertificateTestDetailVM: ViewModelWithLocalState { let greenCertificate: GreenCertificate } -struct configurationState { - static var _state = ["": ["": ""]] +struct ConfigurationState { + static var state = ["": ["": ""]] } extension GreenCertificateTestDetailVM { init?(state: AppState?, localState: GreenCertificateTestDetailLS) { - guard let _ = state else { + guard let state = state else { return nil } self.greenCertificate = localState.greenCertificate - configurationState._state = (state?.configuration.eudccExpiration)! + ConfigurationState.state = state.configuration.eudccExpiration } } @@ -661,8 +661,8 @@ public enum TestType: String { func gedValidUntilValue() -> String { let lan = Locale.current.languageCode ?? "en" - let validUntilValueMolecularTest = configurationState._state[lan]!["molecular_test"] - let validUntilValueQuickTest = configurationState._state[lan]!["rapid_test"] + let validUntilValueMolecularTest:String? = ConfigurationState.state[lan]?["molecular_test"] + let validUntilValueQuickTest:String? = ConfigurationState.state[lan]?["rapid_test"] switch self { case .molecularTest: diff --git a/App/UI/GreenCertificate/ModalDetail/GreenCertificateVaccineDetail/GreenCertificateVaccineDetailView.swift b/App/UI/GreenCertificate/ModalDetail/GreenCertificateVaccineDetail/GreenCertificateVaccineDetailView.swift index f2e1c621..502ab4d5 100644 --- a/App/UI/GreenCertificate/ModalDetail/GreenCertificateVaccineDetail/GreenCertificateVaccineDetailView.swift +++ b/App/UI/GreenCertificate/ModalDetail/GreenCertificateVaccineDetail/GreenCertificateVaccineDetailView.swift @@ -20,8 +20,8 @@ struct GreenCertificateVaccineDetailVM: ViewModelWithLocalState { let greenCertificate: GreenCertificate } -struct configurationStateVaccine { - static var _state = ["": ["": ""]] +struct ConfigurationStateVaccine { + static var state = ["": ["": ""]] } extension GreenCertificateVaccineDetailVM { @@ -31,7 +31,7 @@ extension GreenCertificateVaccineDetailVM { } self.greenCertificate = localState.greenCertificate - configurationStateVaccine._state = (state?.configuration.eudccExpiration)! + ConfigurationStateVaccine.state = (state?.configuration.eudccExpiration)! } } @@ -232,8 +232,8 @@ class GreenCertificateVaccineDetailView: UIView, ViewControllerModellableView { return } let lan = Locale.current.languageCode ?? "en" - let validUntilCompleteVaccine = configurationStateVaccine._state[lan]!["vaccine_fully_completed"] - let validUntilnotCompleteVaccine = configurationStateVaccine._state[lan]!["vaccine_first_dose"] + let validUntilCompleteVaccine = ConfigurationStateVaccine.state[lan]!["vaccine_fully_completed"] + let validUntilnotCompleteVaccine = ConfigurationStateVaccine.state[lan]!["vaccine_first_dose"] if let detailVaccineCertificate = model.greenCertificate.detailVaccineCertificate { Self.Style.value(self.diseaseVaccine, text: detailVaccineCertificate.disease) @@ -256,10 +256,9 @@ class GreenCertificateVaccineDetailView: UIView, ViewControllerModellableView { } else { Self.Style.value(self.vaccineProducer, text: "---") } - if detailVaccineCertificate.doseNumber == detailVaccineCertificate.totalSeriesOfDoses, + if detailVaccineCertificate.doseNumber >= detailVaccineCertificate.totalSeriesOfDoses, !detailVaccineCertificate.doseNumber.isEmpty { - // vaccino completo seba Self.Style.value( self.validUntil, text: validUntilCompleteVaccine? @@ -268,7 +267,7 @@ class GreenCertificateVaccineDetailView: UIView, ViewControllerModellableView { } else { Self.Style.value( self.validUntil, - text: validUntilnotCompleteVaccine?.description ?? "SCertification valid until next dose" + text: validUntilnotCompleteVaccine?.description ?? "Certification valid until next dose" ) } Self.Style.value( @@ -676,137 +675,137 @@ public enum VaccineType: String { } public enum VaccineProducer: String { - case ORG_100001699 = "ORG-100001699" - case ORG_100030215 = "ORG-100030215" - case ORG_100001417 = "ORG-100001417" - case ORG_100031184 = "ORG-100031184" - case ORG_100006270 = "ORG-100006270" - case ORG_100013793 = "ORG-100013793" - case ORG_100020693 = "ORG-100020693" - case ORG_100010771 = "ORG-100010771" - case ORG_100024420 = "ORG-100024420" - case ORG_100032020 = "ORG-100032020" - case Gamaleya_Research_Institute = "Gamaleya-Research-Institute" - case Vector_Institute = "Vector-Institute" - case Sinovac_Biotech = "Sinovac-Biotech" - case Bharat_Biotech = "Bharat-Biotech" + case org100001699 = "ORG-100001699" + case org100030215 = "ORG-100030215" + case org100001417 = "ORG-100001417" + case org100031184 = "ORG-100031184" + case org100006270 = "ORG-100006270" + case org100013793 = "ORG-100013793" + case org100020693 = "ORG-100020693" + case org100010771 = "ORG-100010771" + case org100024420 = "ORG-100024420" + case org100032020 = "ORG-100032020" + case gamaleyaResearchInstitute = "Gamaleya-Research-Institute" + case vectorInstitute = "Vector-Institute" + case sinovacBiotech = "Sinovac-Biotech" + case bharatBiotech = "Bharat-Biotech" func getDescription() -> String { switch self { - case .ORG_100001699: + case .org100001699: return "AstraZeneca AB" - case .ORG_100030215: + case .org100030215: return "Biontech Manufacturing GmbH" - case .ORG_100001417: + case .org100001417: return "Janssen-Cilag International" - case .ORG_100031184: + case .org100031184: return "Moderna Biotech Spain S.L." - case .ORG_100006270: + case .org100006270: return "Curevac AG" - case .ORG_100013793: + case .org100013793: return "CanSino Biologics" - case .ORG_100020693: + case .org100020693: return "China Sinopharm International Corp. - Beijing location" - case .ORG_100010771: + case .org100010771: return "Sinopharm Weiqida Europe Pharmaceutical s.r.o. - Prague location" - case .ORG_100024420: + case .org100024420: return "Sinopharm Zhijun (Shenzhen) Pharmaceutical Co. Ltd. - Shenzhen location" - case .ORG_100032020: + case .org100032020: return "Novavax CZ AS" - case .Gamaleya_Research_Institute: + case .gamaleyaResearchInstitute: return "Gamaleya Research Institute" - case .Vector_Institute: + case .vectorInstitute: return "Vector Institute" - case .Sinovac_Biotech: + case .sinovacBiotech: return "Sinovac Biotech" - case .Bharat_Biotech: + case .bharatBiotech: return "Bharat Biotech" } } } public enum VaccineName: String { - case ORG_100001699 = "ORG-100001699" - case ORG_100030215 = "ORG-100030215" - case ORG_100001417 = "ORG-100001417" - case ORG_100031184 = "ORG-100031184" - case ORG_100006270 = "ORG-100006270" - case ORG_100013793 = "ORG-100013793" - case ORG_100020693 = "ORG-100020693" - case ORG_100010771 = "ORG-100010771" - case ORG_100024420 = "ORG-100024420" - case ORG_100032020 = "ORG-100032020" - case GamaleyaResearchInstitute = "Gamaleya-Research-Institute" - case VectorInstitute = "Vector-Institute" - case SinovacBiotech = "Sinovac-Biotech" - case BharatBiotech = "Bharat-Biotech" - - case EU_1_20_1528 = "EU/1/20/1528" - case EU_1_20_1507 = "EU/1/20/1507" - case EU_1_21_1529 = "EU/1/21/1529" - case EU_1_20_1525 = "EU/1/20/1525" - case CVnCoV - case Sputnik_V = "Sputnik-V" - case Convidecia - case EpiVacCorona - case BBIBP_CorV = "BBIBP-CorV" - case Inactivated_SARS_CoV_2_Vero_Cell = "Inactivated-SARS-CoV-2-Vero-Cell" - case CoronaVac - case Covaxin + case org100001699 = "ORG-100001699" + case org100030215 = "ORG-100030215" + case org100001417 = "ORG-100001417" + case org100031184 = "ORG-100031184" + case org100006270 = "ORG-100006270" + case org100013793 = "ORG-100013793" + case org100020693 = "ORG-100020693" + case org100010771 = "ORG-100010771" + case org100024420 = "ORG-100024420" + case org100032020 = "ORG-100032020" + case gamaleyaResearchInstitute = "Gamaleya-Research-Institute" + case vectorInstitute = "Vector-Institute" + case sinovacBiotech = "Sinovac-Biotech" + case bharatBiotech = "Bharat-Biotech" + + case eu1201528 = "EU/1/20/1528" + case eu1201507 = "EU/1/20/1507" + case eu1211529 = "EU/1/21/1529" + case eu1201525 = "EU/1/20/1525" + case cvnCoV + case sputnikV = "Sputnik-V" + case convidecia + case epiVacCorona + case bbibpCorV = "BBIBP-CorV" + case inactivatedSARSCoV2VeroCell = "Inactivated-SARS-CoV-2-Vero-Cell" + case coronaVac + case covaxin func getDescription() -> String { switch self { - case .ORG_100001699: + case .org100001699: return "AstraZeneca AB" - case .ORG_100030215: + case .org100030215: return "Biontech Manufacturing GmbH" - case .ORG_100001417: + case .org100001417: return "Janssen-Cilag International" - case .ORG_100031184: + case .org100031184: return "Moderna Biotech Spain S.L." - case .ORG_100006270: + case .org100006270: return "Curevac AG" - case .ORG_100013793: + case .org100013793: return "CanSino Biologics" - case .ORG_100020693: + case .org100020693: return "China Sinopharm International Corp. - Beijing location" - case .ORG_100010771: + case .org100010771: return "Sinopharm Weiqida Europe Pharmaceutical s.r.o. - Prague location" - case .ORG_100024420: + case .org100024420: return "Sinopharm Zhijun (Shenzhen) Pharmaceutical Co. Ltd. - Shenzhen location" - case .ORG_100032020: + case .org100032020: return "Novavax CZ AS" - case .GamaleyaResearchInstitute: + case .gamaleyaResearchInstitute: return "Gamaleya Research Institute" - case .VectorInstitute: + case .vectorInstitute: return "Vector Institute" - case .SinovacBiotech: + case .sinovacBiotech: return "Sinovac Biotech" - case .BharatBiotech: + case .bharatBiotech: return "Bharat Biotech" - case .EU_1_20_1528: + case .eu1201528: return "Comirnaty" - case .EU_1_20_1507: + case .eu1201507: return "COVID-19 Vaccine Moderna" - case .EU_1_21_1529: + case .eu1211529: return "Vaxzevria" - case .EU_1_20_1525: + case .eu1201525: return "COVID-19 Vaccine Janssen" - case .CVnCoV: + case .cvnCoV: return "CVnCoV" - case .Sputnik_V: + case .sputnikV: return "Sputnik-V" - case .Convidecia: + case .convidecia: return "Convidecia" - case .EpiVacCorona: + case .epiVacCorona: return "EpiVacCorona" - case .BBIBP_CorV: + case .bbibpCorV: return "BBIBP-CorV" - case .Inactivated_SARS_CoV_2_Vero_Cell: + case .inactivatedSARSCoV2VeroCell: return "Inactivated SARS-CoV-2 (Vero Cell)" - case .CoronaVac: + case .coronaVac: return "CoronaVac" - case .Covaxin: + case .covaxin: return "Covaxin (also known as BBV152 A, B, C)" } }