// The taskCompleted method is invoked when the user completes a task // through the UI. // If this task completion prolongs or introduces a streak, we should call // showStreakDialog with: // - user's current reading goal streak - number of consecutive days goal was met // - breakdown of which of the last 7 days user met their reading goal typealias Date = Int // value is the number of days since some epoch day // This service provides access to the user’s reading goal setting interface ReadingGoalService { // - Returns: The # of minutes of daily reading the user wants to achieve fun getDailyReadingGoal(): Int } data class Task( val timeToRead: Int, val date: Date ) // This service returns the list of all Articles the user has ever read. interface TaskService { // - Returns: a sequence of ??? which contain information about articles read // - Note: A user can read zero, one or more articles on each day fun allTasks(): List<Task> } class Activity ( private val taskService: TaskService, private val readingGoalService: ReadingGoalService ) { // Called when the user read the article fun taskCompleted() { } // Shows a dialog with the streak information from ??? fun showStreakDialog(streakInfo: StreakInfo) { // do not implement this method } }
Check out your Company Bowl for anonymous work chats.