Skip to content

Commit 69672d9

Browse files
add kDoc to useCases
1 parent ba740e3 commit 69672d9

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

libraries/domain/src/main/java/com/smarttoolfactory/domain/usecase/GetPropertiesUseCaseFlow.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ class GetPropertiesUseCaseFlow @Inject constructor(
176176
}
177177
}
178178

179+
/**
180+
* Get current sort key from db
181+
*/
179182
fun getCurrentSortKey(defaultKey: String = ORDER_BY_NONE): Flow<String> {
180183
return flow { emit(repository.getSortOrderKey()) }
181184
.catch {

libraries/domain/src/main/java/com/smarttoolfactory/domain/usecase/GetPropertiesUseCasePaged.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.smarttoolfactory.domain.usecase
22

33
import com.smarttoolfactory.data.constant.ORDER_BY_NONE
44
import com.smarttoolfactory.data.model.local.PagedPropertyEntity
5+
import com.smarttoolfactory.data.model.local.PropertyEntity
56
import com.smarttoolfactory.data.repository.PagedPropertyRepository
67
import com.smarttoolfactory.domain.dispatcher.UseCaseDispatchers
78
import com.smarttoolfactory.domain.error.EmptyDataException
@@ -76,6 +77,7 @@ class GetPropertiesUseCasePaged @Inject constructor(
7677
}
7778
}
7879

80+
7981
private fun toPropertyListOrError(entityList: List<PagedPropertyEntity>): List<PropertyItem> {
8082
return if (!entityList.isNullOrEmpty()) {
8183
mapper.map(entityList)
@@ -84,6 +86,9 @@ class GetPropertiesUseCasePaged @Inject constructor(
8486
}
8587
}
8688

89+
/**
90+
* Get current sort key from db
91+
*/
8792
fun getCurrentSortKey(defaultKey: String = ORDER_BY_NONE): Flow<String> {
8893
return flow { emit(repository.getSortOrderKey()) }
8994
.catch {

libraries/domain/src/main/java/com/smarttoolfactory/domain/usecase/GetPropertiesUseCaseRxJava3.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ class GetPropertiesUseCaseRxJava3 @Inject constructor(
121121
)
122122
}
123123

124+
/**
125+
* Get current sort key from db
126+
*/
124127
fun getCurrentSortKey(defaultKey: String = ORDER_BY_NONE): Single<String> {
125128
return repository.getSortOrderKey()
126129
.onErrorResumeNext {

0 commit comments

Comments
 (0)