Skip to content

Commit

Permalink
Merge pull request #1367 from minvws/4.6-explo-part2
Browse files Browse the repository at this point in the history
4.6 explo part2
  • Loading branch information
ktiniatros authored Aug 30, 2022
2 parents fe6b8a7 + 0c7b1cc commit b1d64c7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class YourEventsFragment : BaseFragment(R.layout.fragment_your_events) {
is YourEventsEndStateWithCustomTitle -> {
infoFragmentUtil.presentFullScreen(
currentFragment = this,
toolbarTitle = args.toolbarTitle,
toolbarTitle = getString(R.string.certificate_created_toolbar_title),
data = InfoFragmentData.TitleDescriptionWithButton(
title = getString(endState.title),
descriptionData = DescriptionData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ package nl.rijksoverheid.ctr.holder.your_events.models

import androidx.annotation.StringRes
import nl.rijksoverheid.ctr.holder.R
import nl.rijksoverheid.ctr.shared.models.WeCouldnCreateCertificateException
import nl.rijksoverheid.ctr.shared.models.WeCouldntCreateCertificateException

sealed class YourEventsEndState {
object None : YourEventsEndState()
data class Hints(val localisedHints: List<String>) : YourEventsEndState()
// endstate with additional action to complete to visitor assessment
object NegativeTestResultAddedAndNowAddVisitorAssessment : YourEventsEndState()
// endstate showing an error code
data class WeCouldntMakeACertificateError(val exception: WeCouldnCreateCertificateException) : YourEventsEndState()
data class WeCouldntMakeACertificateError(val exception: WeCouldntCreateCertificateException) : YourEventsEndState()
}

// additional endstates with custom title and description which cannot be generated by the hints system yet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import nl.rijksoverheid.ctr.holder.utils.StringUtil
import nl.rijksoverheid.ctr.holder.your_events.models.YourEventsEndState
import nl.rijksoverheid.ctr.holder.your_events.models.YourEventsEndStateWithCustomTitle
import nl.rijksoverheid.ctr.shared.models.Flow
import nl.rijksoverheid.ctr.shared.models.WeCouldnCreateCertificateException
import nl.rijksoverheid.ctr.shared.models.WeCouldntCreateCertificateException

interface YourEventsEndStateUtil {
fun getEndState(context: Context, hints: List<String>): YourEventsEndState
Expand Down Expand Up @@ -61,7 +61,7 @@ class YourEventsEndStateUtilImpl(
!hints.contains("negativetest_without_vaccinationassessment") &&
!hints.contains("vaccinationassessment_missing_supporting_negativetest")) {
return YourEventsEndState.WeCouldntMakeACertificateError(
WeCouldnCreateCertificateException("0513")
WeCouldntCreateCertificateException("0513")
)
}

Expand All @@ -86,7 +86,7 @@ class YourEventsEndStateUtilImpl(
return YourEventsEndState.None
} else if (anyNegativeTestRejected) {
return YourEventsEndState.WeCouldntMakeACertificateError(
WeCouldnCreateCertificateException("0512")
WeCouldntCreateCertificateException("0512")
)
}

Expand All @@ -101,7 +101,7 @@ class YourEventsEndStateUtilImpl(
YourEventsEndStateWithCustomTitle.RecoveryTooOld
} else if (anyRecoveryRejected) {
YourEventsEndState.WeCouldntMakeACertificateError(
WeCouldnCreateCertificateException("0511")
WeCouldntCreateCertificateException("0511")
)
} else {
YourEventsEndState.None
Expand Down Expand Up @@ -130,7 +130,7 @@ class YourEventsEndStateUtilImpl(

if (hints.contains("domestic_vaccination_rejected") && hints.contains("international_vaccination_rejected")) {
return YourEventsEndState.WeCouldntMakeACertificateError(
WeCouldnCreateCertificateException("059")
WeCouldntCreateCertificateException("059")
)
}

Expand All @@ -149,7 +149,7 @@ class YourEventsEndStateUtilImpl(
)
) {
return YourEventsEndState.WeCouldntMakeACertificateError(
WeCouldnCreateCertificateException("0510")
WeCouldntCreateCertificateException("0510")
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import nl.rijksoverheid.ctr.shared.models.ErrorResult
import nl.rijksoverheid.ctr.shared.models.Flow
import nl.rijksoverheid.ctr.shared.models.MissingOriginException
import nl.rijksoverheid.ctr.shared.models.NetworkRequestResult
import nl.rijksoverheid.ctr.shared.models.WeCouldnCreateCertificateException
import nl.rijksoverheid.ctr.shared.models.WeCouldntCreateCertificateException
import retrofit2.HttpException

/**
Expand Down Expand Up @@ -65,7 +65,7 @@ class ErrorCodeStringFactoryImpl(private val isPlayStoreBuild: Boolean = true) :
is NoProvidersException -> exception.errorCode
is ActivityNotFoundException -> "070-14"
is MissingOriginException -> "058"
is WeCouldnCreateCertificateException -> exception.errorCode
is WeCouldntCreateCertificateException -> exception.errorCode
else -> throw it.getException()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import java.lang.Exception
* SPDX-License-Identifier: EUPL-1.2
*
*/
class WeCouldnCreateCertificateException(val errorCode: String) : Exception("We couldn't create certificate exception")
class WeCouldntCreateCertificateException(val errorCode: String) : Exception("We couldn't create certificate exception")

0 comments on commit b1d64c7

Please sign in to comment.