-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accepting or rejecting requests updates the corresponding db row
Closes #48
- Loading branch information
1 parent
e0ce17b
commit 9a0af7c
Showing
5 changed files
with
56 additions
and
5 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
25 changes: 25 additions & 0 deletions
25
src/main/kotlin/com/timcastelijns/room15bot/bot/usecases/UpdateAccessRequestUseCase.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,25 @@ | ||
package com.timcastelijns.room15bot.bot.usecases | ||
|
||
import com.timcastelijns.room15bot.data.db.AccessRequestDao | ||
|
||
class UpdateAccessRequestUseCase( | ||
private val accessRequestDao: AccessRequestDao | ||
) : UseCase<UpdateAccessRequestParams, Unit> { | ||
|
||
override fun execute(params: UpdateAccessRequestParams) { | ||
accessRequestDao.update( | ||
params.userId, | ||
params.processed, | ||
params.processedBy, | ||
params.accessGranted | ||
) | ||
} | ||
|
||
} | ||
|
||
data class UpdateAccessRequestParams( | ||
val userId: Long, | ||
val processed: Boolean, | ||
val processedBy: String, | ||
val accessGranted: Boolean | ||
) |
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