-
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
Showing
17 changed files
with
281 additions
and
203 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
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
8 changes: 8 additions & 0 deletions
8
...n/java/com/braiso_22/cozycave/feature_execution/domain/use_case/DeleteExecutionUseCase.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,8 @@ | ||
package com.braiso_22.cozycave.feature_execution.domain.use_case | ||
|
||
import com.braiso_22.cozycave.feature_execution.domain.Execution | ||
import com.braiso_22.cozycave.feature_execution.domain.ExecutionRepository | ||
|
||
class DeleteExecutionUseCase(private val repository: ExecutionRepository) { | ||
suspend operator fun invoke(execution: Execution) = repository.deleteExecution(execution) | ||
} |
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
22 changes: 5 additions & 17 deletions
22
app/src/main/java/com/braiso_22/cozycave/feature_task/domain/TaskRepository.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 |
---|---|---|
@@ -1,26 +1,14 @@ | ||
package com.braiso_22.cozycave.feature_task.domain | ||
|
||
import com.braiso_22.cozycave.feature_task.domain.Task | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
/** | ||
* Repository interface to be implemented in the data layer for accessing the [Task]s | ||
*/ | ||
interface TaskRepository { | ||
/** | ||
* Returns a [Flow] of all the [Task]s. | ||
*/ | ||
|
||
fun getTasks(): Flow<List<Task>> | ||
/** | ||
* Returns a [Task] by its id. | ||
*/ | ||
|
||
suspend fun getTaskById(id: Int): Task | ||
/** | ||
* Inserts a [Task] into the database. | ||
*/ | ||
|
||
suspend fun insertTask(task: Task) | ||
/** | ||
* Deletes a [Task] from the database. | ||
*/ | ||
suspend fun deleteTask(task: Task) | ||
|
||
suspend fun deleteTaskById(task: Task) | ||
} |
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
Oops, something went wrong.