Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
add markViewed
Browse files Browse the repository at this point in the history
  • Loading branch information
chiljamgossow committed Mar 24, 2022
1 parent 50c7d9d commit 3227bc4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import de.rki.coronawarnapp.coronatest.type.TestIdentifier
import de.rki.coronawarnapp.familytest.core.model.FamilyCoronaTest
import de.rki.coronawarnapp.familytest.core.model.markBadgeAsViewed
import de.rki.coronawarnapp.familytest.core.model.markDccCreated
import de.rki.coronawarnapp.familytest.core.model.markViewed
import de.rki.coronawarnapp.familytest.core.model.recycle
import de.rki.coronawarnapp.familytest.core.model.restore
import de.rki.coronawarnapp.familytest.core.model.updateResultNotification
Expand Down Expand Up @@ -82,6 +83,14 @@ class FamilyTestRepository @Inject constructor(
}
}

suspend fun markViewed(
identifier: TestIdentifier
) {
val test = getTest(identifier) ?: return
val updated = test.copy(coronaTest = test.coronaTest.markViewed())
storage.update(updated)
}

suspend fun markBadgeAsViewed(
identifier: TestIdentifier
) {
Expand Down

0 comments on commit 3227bc4

Please sign in to comment.