-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53939c2
commit aca779e
Showing
7 changed files
with
155 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...omain/src/main/java/com/withpeace/withpeace/core/domain/usecase/GetPolicyFilterUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.withpeace.withpeace.core.domain.usecase | ||
|
||
import com.withpeace.withpeace.core.domain.model.error.CheonghaError | ||
import com.withpeace.withpeace.core.domain.model.policy.PolicyFilters | ||
import com.withpeace.withpeace.core.domain.repository.UserRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class GetPolicyFilterUseCase @Inject constructor( | ||
private val userRepository: UserRepository, | ||
) { | ||
operator fun invoke(onError: suspend (CheonghaError) -> Unit): Flow<PolicyFilters> = | ||
userRepository.getPolicyFilter(onError) | ||
} |
18 changes: 18 additions & 0 deletions
18
...in/src/main/java/com/withpeace/withpeace/core/domain/usecase/UpdatePolicyFilterUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.withpeace.withpeace.core.domain.usecase | ||
|
||
import com.withpeace.withpeace.core.domain.model.error.CheonghaError | ||
import com.withpeace.withpeace.core.domain.model.policy.PolicyFilters | ||
import com.withpeace.withpeace.core.domain.repository.UserRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class UpdatePolicyFilterUseCase @Inject constructor( | ||
private val userRepository: UserRepository, | ||
) { | ||
operator fun invoke( | ||
policyFilters: PolicyFilters, | ||
onError: (CheonghaError) -> Unit, | ||
): Flow<Unit> { | ||
return userRepository.updatePolicyFilter(policyFilters = policyFilters, onError = onError) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters