Skip to content

Commit

Permalink
Added doc to the UseCases
Browse files Browse the repository at this point in the history
  • Loading branch information
borichellow committed Feb 26, 2025
1 parent fa3ef82 commit 389894b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import com.wire.kalium.logic.data.sync.SlowSyncStatus
import com.wire.kalium.logic.data.user.UserRepository
import kotlinx.coroutines.flow.first

/**
* Use case that combine contacts data necessary for analytics [AnalyticsContactsData].
* It always get a Cached data and, except case when there is no cache, in that case useCase selects all the data from DB.
*/
interface GetAnalyticsContactsDataUseCase {
suspend operator fun invoke(): AnalyticsContactsData
}
Expand Down Expand Up @@ -91,6 +95,10 @@ class GetAnalyticsContactsDataUseCaseImpl internal constructor(

}

/**
* If val is null mean it shouldn't be provided to the analytics.
* More details in task https://wearezeta.atlassian.net/browse/WPB-16121
*/
data class AnalyticsContactsData(
val teamId: String?,
val contactsSize: Int?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import kotlinx.coroutines.flow.first
import kotlinx.datetime.Clock
import kotlin.time.Duration.Companion.days

/**
* Use case that checks if users ContactsAmount and TeamSize cache are too old and updates it.
* Currently max live period is [UpdateContactsAmountsCacheUseCaseImpl.CACHE_PERIOD] 7 days
*/
interface UpdateContactsAmountsCacheUseCase {
suspend operator fun invoke()
}
Expand Down

0 comments on commit 389894b

Please sign in to comment.