src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt

changeset 235
4258b9e010ae
parent 199
59393c8cc557
child 242
b7f3e972b13c
     1.1 --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt	Sat Oct 09 17:46:12 2021 +0200
     1.2 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt	Sat Oct 09 20:05:39 2021 +0200
     1.3 @@ -25,14 +25,35 @@
     1.4  
     1.5  package de.uapcore.lightpit.viewmodel
     1.6  
     1.7 -import de.uapcore.lightpit.entities.Issue
     1.8  import de.uapcore.lightpit.entities.Project
     1.9 +import de.uapcore.lightpit.types.IssueHistoryType
    1.10  import java.sql.Timestamp
    1.11  import java.time.Instant
    1.12  
    1.13 +class IssueDiff(
    1.14 +    val id: Int,
    1.15 +    val currentSubject: String,
    1.16 +    var component: String,
    1.17 +    var status: String,
    1.18 +    var category: String,
    1.19 +    var subject: String,
    1.20 +    var description: String,
    1.21 +    var assignee: String,
    1.22 +    var eta: String,
    1.23 +    var affected: String,
    1.24 +    var resolved: String,
    1.25 +)
    1.26 +
    1.27 +class IssueFeedEntry(
    1.28 +    val time: Timestamp,
    1.29 +    val type: IssueHistoryType,
    1.30 +    val issue: IssueDiff
    1.31 +)
    1.32 +
    1.33  class IssueFeed(
    1.34      val project: Project,
    1.35 -    val issues: List<Issue>
    1.36 +    val entries: List<IssueFeedEntry>
    1.37  ) : View() {
    1.38 -    val lastModified = issues.map(Issue::updated).maxOrNull() ?: Timestamp.from(Instant.now())
    1.39 +    val lastModified: Timestamp =
    1.40 +        entries.map(IssueFeedEntry::time).maxOrNull() ?: Timestamp.from(Instant.now())
    1.41  }
    1.42 \ No newline at end of file

mercurial