src/main/kotlin/de/uapcore/lightpit/dao/DataAccessObject.kt

Thu, 29 Dec 2022 14:50:35 +0100

author
Mike Becker <universe@uap-core.de>
date
Thu, 29 Dec 2022 14:50:35 +0100
changeset 257
c1be672af7ff
parent 248
90dc13c78b5d
child 263
aa22103809cd
permissions
-rw-r--r--

#164 add issue summary for developers

mike@159 1 /*
universe@180 2 * Copyright 2021 Mike Becker. All rights reserved.
mike@159 3 *
mike@159 4 * Redistribution and use in source and binary forms, with or without
mike@159 5 * modification, are permitted provided that the following conditions are met:
mike@159 6 *
mike@159 7 * 1. Redistributions of source code must retain the above copyright
mike@159 8 * notice, this list of conditions and the following disclaimer.
mike@159 9 *
mike@159 10 * 2. Redistributions in binary form must reproduce the above copyright
mike@159 11 * notice, this list of conditions and the following disclaimer in the
mike@159 12 * documentation and/or other materials provided with the distribution.
mike@159 13 *
mike@159 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mike@159 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mike@159 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mike@159 17 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mike@159 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mike@159 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mike@159 20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mike@159 21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mike@159 22 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mike@159 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mike@159 24 */
mike@159 25
mike@159 26 package de.uapcore.lightpit.dao
mike@159 27
universe@167 28 import de.uapcore.lightpit.entities.*
universe@184 29 import de.uapcore.lightpit.viewmodel.ComponentSummary
universe@184 30 import de.uapcore.lightpit.viewmodel.IssueSummary
universe@184 31 import de.uapcore.lightpit.viewmodel.VersionSummary
universe@167 32
universe@167 33 interface DataAccessObject {
universe@248 34
universe@167 35 fun listUsers(): List<User>
universe@167 36 fun findUser(id: Int): User?
universe@167 37 fun findUserByName(username: String): User?
universe@167 38 fun insertUser(user: User)
universe@167 39 fun updateUser(user: User)
universe@167 40
universe@184 41 /**
universe@184 42 * Lists all versions of the specified [project].
universe@184 43 *
universe@184 44 * The list is first ordered by the ordinal of the version and
universe@184 45 * then by name, both descending.
universe@184 46 */
universe@167 47 fun listVersions(project: Project): List<Version>
universe@184 48 fun listVersionSummaries(project: Project): List<VersionSummary>
universe@167 49 fun findVersion(id: Int): Version?
universe@167 50 fun findVersionByNode(project: Project, node: String): Version?
universe@167 51 fun insertVersion(version: Version)
universe@167 52 fun updateVersion(version: Version)
universe@167 53
universe@167 54 fun listComponents(project: Project): List<Component>
universe@184 55 fun listComponentSummaries(project: Project): List<ComponentSummary>
universe@167 56 fun findComponent(id: Int): Component?
universe@167 57 fun findComponentByNode(project: Project, node: String): Component?
universe@167 58 fun insertComponent(component: Component)
universe@167 59 fun updateComponent(component: Component)
universe@167 60
universe@184 61 /**
universe@184 62 * Lists all projects ordered by name.
universe@184 63 */
universe@167 64 fun listProjects(): List<Project>
universe@167 65 fun findProject(id: Int): Project?
universe@167 66 fun findProjectByNode(node: String): Project?
universe@167 67 fun insertProject(project: Project)
universe@167 68 fun updateProject(project: Project)
universe@167 69
universe@167 70 fun collectIssueSummary(project: Project): IssueSummary
universe@257 71 fun collectIssueSummary(assignee: User): IssueSummary
universe@167 72
universe@248 73 fun listIssues(project: Project, version: Version?, component: Component?): List<Issue>
universe@167 74 fun findIssue(id: Int): Issue?
universe@184 75 fun insertIssue(issue: Issue): Int
universe@167 76 fun updateIssue(issue: Issue)
universe@167 77
universe@167 78 fun listComments(issue: Issue): List<IssueComment>
universe@207 79 fun findComment(id: Int): IssueComment?
universe@232 80 fun insertComment(issueComment: IssueComment): Int
universe@207 81 fun updateComment(issueComment: IssueComment)
universe@232 82
universe@232 83 fun insertHistoryEvent(issue: Issue, newId: Int = 0)
universe@242 84 fun insertHistoryEvent(issue: Issue, issueComment: IssueComment, newId: Int = 0)
universe@235 85
universe@239 86 /**
universe@239 87 * Lists the issue history of the project with [projectId] for the past [days].
universe@239 88 */
universe@235 89 fun listIssueHistory(projectId: Int, days: Int): List<IssueHistoryEntry>
universe@241 90
universe@241 91 /**
universe@241 92 * Lists the issue comment history of the project with [projectId] for the past [days].
universe@241 93 */
universe@241 94 fun listIssueCommentHistory(projectId: Int, days: Int): List<IssueCommentHistoryEntry>
universe@232 95 }

mercurial