Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class TaskChecker {
private val safeSendTaskToAssigner: (Task) -> Unit = ::sendTaskToAssigner
fun check(task: Task): CheckResult {
if (isNotCreatedInCurrentWeek(task)) return Invalid
if (isResolved(task)) return Invalid
if (isNotAssigned(task)) return Invalid
return Valid
private fun isNotAssigned(task: Task): Boolean {
if (task.assignedTo != Nobody) return false
return true
private fun sendTaskToAssigner(task: Task) {
val connection = Connection()
val assigner = TaskAssigner(connection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment