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

Mon, 30 Oct 2023 14:44:36 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 30 Oct 2023 14:44:36 +0100
changeset 292
703591e739f4
parent 284
671c1c8fbf1c
permissions
-rw-r--r--

add possibility to show issues w/o version or component - fixes #335

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@284 29 import de.uapcore.lightpit.types.CommitRef
universe@184 30 import de.uapcore.lightpit.viewmodel.ComponentSummary
universe@184 31 import de.uapcore.lightpit.viewmodel.IssueSummary
universe@184 32 import de.uapcore.lightpit.viewmodel.VersionSummary
universe@167 33
universe@167 34 interface DataAccessObject {
universe@248 35
universe@167 36 fun listUsers(): List<User>
universe@167 37 fun findUser(id: Int): User?
universe@167 38 fun findUserByName(username: String): User?
universe@167 39 fun insertUser(user: User)
universe@167 40 fun updateUser(user: User)
universe@167 41
universe@184 42 /**
universe@184 43 * Lists all versions of the specified [project].
universe@184 44 *
universe@184 45 * The list is first ordered by the ordinal of the version and
universe@184 46 * then by name, both descending.
universe@184 47 */
universe@167 48 fun listVersions(project: Project): List<Version>
universe@184 49 fun listVersionSummaries(project: Project): List<VersionSummary>
universe@167 50 fun findVersion(id: Int): Version?
universe@167 51 fun findVersionByNode(project: Project, node: String): Version?
universe@167 52 fun insertVersion(version: Version)
universe@167 53 fun updateVersion(version: Version)
universe@167 54
universe@167 55 fun listComponents(project: Project): List<Component>
universe@184 56 fun listComponentSummaries(project: Project): List<ComponentSummary>
universe@167 57 fun findComponent(id: Int): Component?
universe@167 58 fun findComponentByNode(project: Project, node: String): Component?
universe@167 59 fun insertComponent(component: Component)
universe@167 60 fun updateComponent(component: Component)
universe@167 61
universe@184 62 /**
universe@184 63 * Lists all projects ordered by name.
universe@184 64 */
universe@167 65 fun listProjects(): List<Project>
universe@167 66 fun findProject(id: Int): Project?
universe@167 67 fun findProjectByNode(node: String): Project?
universe@167 68 fun insertProject(project: Project)
universe@167 69 fun updateProject(project: Project)
universe@167 70
universe@167 71 fun collectIssueSummary(project: Project): IssueSummary
universe@257 72 fun collectIssueSummary(assignee: User): IssueSummary
universe@167 73
universe@284 74 fun mergeCommitRefs(refs: List<CommitRef>)
universe@284 75
universe@268 76 fun listIssues(project: Project, includeDone: Boolean): List<Issue>
universe@292 77 fun listIssues(
universe@292 78 project: Project,
universe@292 79 includeDone: Boolean,
universe@292 80 specificVersion: Boolean,
universe@292 81 version: Version?,
universe@292 82 specificComponent: Boolean,
universe@292 83 component: Component?
universe@292 84 ): List<Issue>
universe@167 85 fun findIssue(id: Int): Issue?
universe@184 86 fun insertIssue(issue: Issue): Int
universe@167 87 fun updateIssue(issue: Issue)
universe@167 88
universe@167 89 fun listComments(issue: Issue): List<IssueComment>
universe@207 90 fun findComment(id: Int): IssueComment?
universe@232 91 fun insertComment(issueComment: IssueComment): Int
universe@207 92 fun updateComment(issueComment: IssueComment)
universe@232 93
universe@263 94 /**
universe@263 95 * Inserts an issue relation, if it does not already exist.
universe@263 96 */
universe@263 97 fun insertIssueRelation(rel: IssueRelation)
universe@263 98 fun deleteIssueRelation(rel: IssueRelation)
universe@263 99 fun listIssueRelations(issue: Issue): List<IssueRelation>
universe@268 100 fun getIssueRelationMap(project: Project, includeDone: Boolean): IssueRelationMap
universe@263 101
universe@232 102 fun insertHistoryEvent(issue: Issue, newId: Int = 0)
universe@242 103 fun insertHistoryEvent(issue: Issue, issueComment: IssueComment, newId: Int = 0)
universe@235 104
universe@239 105 /**
universe@239 106 * Lists the issue history of the project with [projectId] for the past [days].
universe@239 107 */
universe@235 108 fun listIssueHistory(projectId: Int, days: Int): List<IssueHistoryEntry>
universe@241 109
universe@241 110 /**
universe@241 111 * Lists the issue comment history of the project with [projectId] for the past [days].
universe@241 112 */
universe@241 113 fun listIssueCommentHistory(projectId: Int, days: Int): List<IssueCommentHistoryEntry>
universe@284 114 fun listCommitRefs(issue: Issue): List<CommitRef>
universe@232 115 }

mercurial