-
-
Save le0nidas/6050eaef54b7f9ba0018a1e487c77aa5 to your computer and use it in GitHub Desktop.
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
class TaskChecker { | |
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 | |
val connection = Connection() | |
val assigner = TaskAssigner(connection) | |
assigner.add(task) | |
return true | |
} | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment