Skip to content

Commit

Permalink
documentation of the last interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Draskovits Stefan committed Jan 29, 2017
1 parent 9edee47 commit 16e1a86
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,38 @@ import org.springframework.data.domain.Pageable
import java.util.*

interface ProjectService {
/**
* Get a Project with specified UUID if it exits
*/
fun getProject(id: UUID): ProjectResult?

/**
* List all Projects
*/
fun listAllProjects(name: String, disabled: Boolean, pageable: Pageable): Page<ProjectResult>

/**
* List all projects where a given User is a member
*/
fun listUserProjects(userId: UUID, name: String, disabled: Boolean, pageable: Pageable): Page<ProjectResult>

/**
* Create a project with given properties
*/
fun createProject(project: CreateProject): ProjectResult

/**
* Deletes a project permanently
*/
fun deleteProject(id: UUID)

/**
* Updates the properties of a project
*/
fun updateProject(id: UUID, project: UpdateProject): ProjectResult

/**
* List all projects roles of a project
*/
fun listProjectRoles(): List<ProjectRoleResult>
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import java.util.*


interface StatisticService {
/**
* Returns all Progresses of each submitted TicketId
*/
fun getTicketProgresses(ids: Collection<UUID>, principal: Principal): Map<UUID, TicketProgressResult>

/**
* Get Progress of one ticket
*/
fun getTicketProgress(id: UUID): TicketProgressResult
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import java.util.*


interface TicketService {
/**
* List all Tickets for a project with given filters
*/
fun listTicketsOverview(project: UUID,
numbers: List<Int>?,
title: String?,
Expand All @@ -27,14 +30,49 @@ interface TicketService {
parent: Int?,
pageable: Pageable): Page<TicketOverviewResult>

/**
* List Tickets with paging
*/
fun listTickets(project: UUID, pageable: Pageable): Page<TicketResult>

/**
* Get one Ticket
*/
fun getTicket(id: UUID): TicketResult

/**
* Get a ticket with the ticket id, which is unique for each project
*/
fun getTicket(projectId: UUID, ticketNumber: Int): TicketResult

/**
* get all tickets for the supplied ids.
*/
fun getTickets(ids: Collection<UUID>, principal: Principal): Map<UUID, TicketResult>

/**
* create a ticket
*/
fun createTicket(createTicket: CreateTicket, principal: Principal, projectId: UUID): TicketResult

/**
* update a ticket with Properties encapsulated in an Object
*/
fun updateTicket(updateTicket: UpdateTicket, ticketId: UUID, principal: Principal): TicketResult

/**
* Delete a ticket
*/
fun deleteTicket(id: UUID)

/**
* list a few Tickets. this function will be used for autocompletion
*/
fun listTicketsFuzzy(project: UUID, query: String, pageable: Pageable): List<TicketResult>

/**
* List tickets with story points. Similar to listTicketOverview but only for Storypoints
*/
fun listTicketsStoryPoints(project: UUID,
numbers: List<Int>?,
title: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,28 @@ import io.ticktag.service.ticketassignment.dto.TicketAssignmentResult
import java.util.*

interface TicketAssignmentService {
/**
* Get the an assigned user for a Tickets
*/
fun getTicketAssignment(ticketId: UUID, tagId: UUID, userId: UUID): TicketAssignmentResult

/**
* Assign a User to a ticket
*/
fun createTicketAssignment(ticketId: UUID, tagId: UUID, userId: UUID, principal: Principal): TicketAssignmentResult

/**
* Similar to creatTicketAssignment but only creates ticket if it not already exits
*/
fun createOrGetIfExistsTicketAssignment(ticketId: UUID, tagId: UUID, userId: UUID, principal: Principal): TicketAssignmentResult

/**
* Delete a User assignment to a Ticket
*/
fun deleteTicketAssignment(ticketId: UUID, tagId: UUID, userId: UUID, principal: Principal)

/**
* Delete all Assignments of a User to a ticket
*/
fun deleteTicketAssignments(ticketId: UUID, userId: UUID, principal: Principal)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import io.ticktag.service.ticketevent.dto.TicketEventResult
import java.util.*

interface TicketEventService {
/**
* List ticket events (History of a Ticket) for a given Ticket ID
*/
fun listTicketEvents(ticketId: UUID): List<TicketEventResult>

/**
* List all Events regarding a state change
*/
fun findAllStateChangedEvents(ticketIds: List<UUID>, principal: Principal): List<TicketEventResult>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,33 @@ import java.util.*


interface TicketTagService {
/**
* Get a ticket tag, which can be used to tag a ticket
*/
fun getTicketTag(id: UUID): TicketTagResult

/**
* get all Ticket Tags for a project
*/
fun listTicketTagsInProject(projectId: UUID): List<TicketTagResult>

/**
* get all Ticket tags of a Ticket Tag Group
*/
fun listTicketTagsInGroup(ticketTagGroupId: UUID): List<TicketTagResult>

/**
* Adds a Ticket Tag to a ticket tag group. This ticket will be added in the project of the ticket tag group
*/
fun createTicketTag(ticketTag: CreateTicketTag, ticketTagGroupId: UUID): TicketTagResult

/**
* delete a Ticket Tag
*/
fun deleteTicketTag(id: UUID)

/**
* Update a Ticket tag with the properties encapsulated in an Object
*/
fun updateTicketTag(id: UUID, ticketTag: UpdateTicketTag): TicketTagResult
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,30 @@ import io.ticktag.service.tickettaggroup.dto.UpdateTicketTagGroup
import java.util.*

interface TicketTagGroupService {
/**
* get a specific ticket tag group
* @param id id of the ticket tag group
*/
fun getTicketTagGroup(id: UUID): TicketTagGroupResult

/**
* list all Ticket tag groups of a project
*/
fun listTicketTagGroups(projectId: UUID): List<TicketTagGroupResult>

/**
* create a Ticket tag group in a specific project
*/
fun createTicketTagGroup(ticketTagGroup: CreateTicketTagGroup, projectId: UUID): TicketTagGroupResult

/**
* Delte a Ticket Tag group and all its Ticket tags
*/
fun deleteTicketTagGroup(id: UUID)

/**
* Update a Ticket Tag Group.
* The project can't be changed.
*/
fun updateTicketTagGroup(id: UUID, ticketTagGroup: UpdateTicketTagGroup): TicketTagGroupResult
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@ import io.ticktag.service.tickettagrelation.dto.TicketTagRelationResult
import java.util.*

interface TicketTagRelationService {
/**
* Get relation of a Ticket to a Tag ( It is an assignment of a Tag to a ticket.)
*/
fun getTicketTagRelation(ticketId: UUID, tagId: UUID): TicketTagRelationResult

/**
* Assign a tag to a ticket if this relation doesn't exist.
*/
fun createOrGetIfExistsTicketTagRelation(ticketId: UUID, tagId: UUID, principal: Principal): TicketTagRelationResult

/**
* Deletes one sssignment of a tag to a ticket.
*/
fun deleteTicketTagRelation(ticketId: UUID, tagId: UUID, principal: Principal)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,28 @@ import io.ticktag.service.timecategory.dto.UpdateTimeCategory
import java.util.*

interface TimeCategoryService {
/**
* Get a time category, which can be used to tag an activity.
*/
fun getTimeCategory(id: UUID): TimeCategoryResult

/**
* lists all time categories of a project
*/
fun listProjectTimeCategories(projectId: UUID): List<TimeCategoryResult>

/**
* adds a time category to a project
*/
fun createTimeCategory(projectId: UUID, timeCategory: CreateTimeCategory): TimeCategoryResult

/**
* deletes a time category.
*/
fun deleteTimeCategory(id: UUID)

/**
* updates the properties of a time category.
*/
fun updateTimeCategory(id: UUID, timeCategory: UpdateTimeCategory): TimeCategoryResult
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,66 @@ import org.springframework.data.domain.Pageable
import java.util.*

interface UserService {
/**
* check if the supplied password is correct for this user
* @param mail the email address is used to identify the user
* @param password the plaintext password
*/
fun checkPassword(mail: String, password: String): UserResult?

/**
* Creates a user
*/
fun createUser(createUser: CreateUser, principal: Principal): UserResult

/**
* gets a specific user if it exits
*/
fun getUser(id: UUID, principal: Principal): UserResult

/**
* List all users of a project. You need admin permissions for that
*/
fun listUsers(query: String, role: Role?, disabled: Boolean?, principal: Principal, pageable: Pageable): Page<UserResult>

/**
* List all users of a projects. Therefore a user has to be a member of the project
*/
fun listProjectUsers(projectId: UUID, disabled: Boolean?, principal: Principal): List<ProjectUserResult>

/**
* List all Roles a user can have.
*/
fun listRoles(): List<RoleResult>

/**
* Update user with given set of properties in UpdateUser class
*/
fun updateUser(principal: Principal, id: UUID, updateUser: UpdateUser): UserResult

/**
* get the profile picture of a user
*/
fun getUserImage(imageId: TempImageId): ByteArray

/**
* List a small amount of user, which fit to the query
* This function will be used for autocompletion
*/
fun listUsersFuzzy(projectId: UUID, query: String, pageable: Pageable, principal: Principal): List<UserResult>

/**
* Get all users with the supplied ids.
*/
fun getUsers(ids: Collection<UUID>, principal: Principal): Map<UUID, UserResult>

/**
* Find a user, which has the given username.
*/
fun getUserByUsername(username: String, principal: Principal): UserResult

/**
* Delete a user permanently
*/
fun deleteUser(id: UUID, principal: Principal)
}

0 comments on commit 16e1a86

Please sign in to comment.