Mon, 05 Aug 2024 19:38:47 +0200
fix removing filter not working
fixes #407
/* * Copyright 2021 Mike Becker. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package de.uapcore.lightpit.dao import de.uapcore.lightpit.entities.* import de.uapcore.lightpit.types.CommitRef import de.uapcore.lightpit.viewmodel.ComponentSummary import de.uapcore.lightpit.viewmodel.IssueSummary import de.uapcore.lightpit.viewmodel.VersionSummary interface DataAccessObject { fun listUsers(): List<User> fun findUser(id: Int): User? fun findUserByName(username: String): User? fun insertUser(user: User) fun updateUser(user: User) /** * Lists all versions of the specified [project]. * * The list is first ordered by the ordinal of the version and * then by name, both descending. */ fun listVersions(project: Project): List<Version> fun listVersionSummaries(project: Project): List<VersionSummary> fun findVersion(id: Int): Version? fun findVersionByNode(project: Project, node: String): Version? fun insertVersion(version: Version) fun updateVersion(version: Version) fun listComponents(project: Project): List<Component> fun listComponentSummaries(project: Project): List<ComponentSummary> fun findComponent(id: Int): Component? fun findComponentByNode(project: Project, node: String): Component? fun insertComponent(component: Component) fun updateComponent(component: Component) /** * Lists all projects ordered by name. */ fun listProjects(): List<Project> fun findProject(id: Int): Project? fun findProjectByNode(node: String): Project? fun insertProject(project: Project) fun updateProject(project: Project) fun collectIssueSummary(project: Project): IssueSummary fun collectIssueSummary(assignee: User): IssueSummary fun mergeCommitRefs(refs: List<CommitRef>) /** * Lists all issues. * The result will only [includeDone] issues, if requested. */ fun listIssues(includeDone: Boolean): List<Issue> /** * Lists issues for the specified [project]. * The result will only [includeDone] issues, if requested. */ fun listIssues(project: Project, includeDone: Boolean): List<Issue> /** * Lists all issues for the specified [project]. * The result will only [includeDone] issues, if requested. * When a [specificVersion] or a [specificComponent] is requested, * the result is filtered for [version] or [component] respectively. * In both cases null means that only issues without version or component shall be returned. */ fun listIssues( project: Project, includeDone: Boolean, specificVersion: Boolean, version: Version?, specificComponent: Boolean, component: Component? ): List<Issue> fun findIssue(id: Int): Issue? fun insertIssue(issue: Issue): Int fun updateIssue(issue: Issue) fun listComments(issue: Issue): List<IssueComment> fun findComment(id: Int): IssueComment? fun insertComment(issueComment: IssueComment): Int fun updateComment(issueComment: IssueComment) /** * Inserts an issue relation, if it does not already exist. */ fun insertIssueRelation(rel: IssueRelation) fun deleteIssueRelation(rel: IssueRelation) fun listIssueRelations(issue: Issue): List<IssueRelation> fun getIssueRelationMap(includeDone: Boolean): IssueRelationMap fun getIssueRelationMap(project: Project, includeDone: Boolean): IssueRelationMap fun insertHistoryEvent(issue: Issue, newId: Int = 0) fun insertHistoryEvent(issue: Issue, issueComment: IssueComment, newId: Int = 0) /** * Lists the issue history, optionally restricted to [project], for the past [days]. */ fun listIssueHistory(project: Project?, days: Int): List<IssueHistoryEntry> /** * Lists the issue comment history, optionally restricted to [project], for the past [days]. */ fun listIssueCommentHistory(project: Project?, days: Int): List<IssueCommentHistoryEntry> fun listCommitRefs(issue: Issue): List<CommitRef> }