diff --git a/src/main/kotlin/logic/repositories/AuditRepository.kt b/src/main/kotlin/logic/repositories/AuditRepository.kt new file mode 100644 index 0000000..db0bcde --- /dev/null +++ b/src/main/kotlin/logic/repositories/AuditRepository.kt @@ -0,0 +1,10 @@ +package com.berlin.logic.repositories + +import com.berlin.model.AuditLog + +interface AuditRepository { + fun addAuditLog(auditLog: AuditLog):Boolean + fun getAuditLogsByProjectId(projectId:String):List + fun getAuditLogsByTaskId(taskId:String):List + fun getAuditLogsByUserId(userId:String):List +} \ No newline at end of file diff --git a/src/main/kotlin/logic/repositories/AuthenticationRepository.kt b/src/main/kotlin/logic/repositories/AuthenticationRepository.kt new file mode 100644 index 0000000..5f56b95 --- /dev/null +++ b/src/main/kotlin/logic/repositories/AuthenticationRepository.kt @@ -0,0 +1,9 @@ +package com.berlin.logic.repositories + +import com.berlin.model.User + +interface AuthenticationRepository { + fun createUser(user:User):Boolean + fun getUserById(userId:String):User? + fun getAllUsers():List +} \ No newline at end of file diff --git a/src/main/kotlin/logic/repositories/ProjectRepository.kt b/src/main/kotlin/logic/repositories/ProjectRepository.kt new file mode 100644 index 0000000..17fbc66 --- /dev/null +++ b/src/main/kotlin/logic/repositories/ProjectRepository.kt @@ -0,0 +1,11 @@ +package com.berlin.logic.repositories + +import com.berlin.model.Project + +interface ProjectRepository { + fun createProject(project:Project):Boolean + fun getProjectById(projectId:String):Project? + fun getAllProjects():List + fun updateProject(project: Project):Boolean + fun deleteProject(projectId: String):Boolean +} \ No newline at end of file diff --git a/src/main/kotlin/logic/repositories/StateRepository.kt b/src/main/kotlin/logic/repositories/StateRepository.kt new file mode 100644 index 0000000..e0589d3 --- /dev/null +++ b/src/main/kotlin/logic/repositories/StateRepository.kt @@ -0,0 +1,11 @@ +package com.berlin.logic.repositories + +import com.berlin.model.State + +interface StateRepository { + fun createState(state: State):Boolean + fun getStatesByProjectId(projectId:String):List + fun deleteState(stateId:String):Boolean + fun updateState(state: State):Boolean + fun getStateByTaskId(taskId:String):State? +} \ No newline at end of file diff --git a/src/main/kotlin/logic/repositories/TaskRepository.kt b/src/main/kotlin/logic/repositories/TaskRepository.kt new file mode 100644 index 0000000..5dbbae8 --- /dev/null +++ b/src/main/kotlin/logic/repositories/TaskRepository.kt @@ -0,0 +1,13 @@ +package com.berlin.logic.repositories + +import com.berlin.model.Task +import com.berlin.model.User + +interface TaskRepository { + fun createTask(task:Task):Boolean + fun getTaskById(taskId:String):Task? + fun getTasksByProjectId(projectId:String):List + fun updateTask(task: Task):Boolean + fun deleteTaskById(taskId: String):Boolean + fun getAssignedUserByTaskId(taskId: String):User? +} \ No newline at end of file diff --git a/src/main/kotlin/model/AuditAction.kt b/src/main/kotlin/model/AuditAction.kt new file mode 100644 index 0000000..8e09f80 --- /dev/null +++ b/src/main/kotlin/model/AuditAction.kt @@ -0,0 +1,5 @@ +package com.berlin.model + +enum class AuditAction { + CREATE, UPDATE, DELETE +} \ No newline at end of file diff --git a/src/main/kotlin/model/AuditLog.kt b/src/main/kotlin/model/AuditLog.kt new file mode 100644 index 0000000..1cc246d --- /dev/null +++ b/src/main/kotlin/model/AuditLog.kt @@ -0,0 +1,12 @@ +package com.berlin.model + + +data class AuditLog( + val id:String, + val timestamp: Long, + val createdBy:User, + val auditAction:AuditAction, + val changesDescription:String?, + val entityType:EntityType, + val entityId:String +) diff --git a/src/main/kotlin/model/EntityType.kt b/src/main/kotlin/model/EntityType.kt new file mode 100644 index 0000000..f3b4354 --- /dev/null +++ b/src/main/kotlin/model/EntityType.kt @@ -0,0 +1,5 @@ +package com.berlin.model + +enum class EntityType { + PROJECT,TASK +} \ No newline at end of file diff --git a/src/main/kotlin/model/Project.kt b/src/main/kotlin/model/Project.kt new file mode 100644 index 0000000..8b77e24 --- /dev/null +++ b/src/main/kotlin/model/Project.kt @@ -0,0 +1,9 @@ +package com.berlin.model + +data class Project( + val id:String, + val name:String, + val description:String?, + val statesId:List, + val tasksId:List +) diff --git a/src/main/kotlin/model/State.kt b/src/main/kotlin/model/State.kt new file mode 100644 index 0000000..a0a3580 --- /dev/null +++ b/src/main/kotlin/model/State.kt @@ -0,0 +1,7 @@ +package com.berlin.model + +data class State( + val id:String, + val name:String, + val projectId:String, +) diff --git a/src/main/kotlin/model/Task.kt b/src/main/kotlin/model/Task.kt new file mode 100644 index 0000000..1c576a3 --- /dev/null +++ b/src/main/kotlin/model/Task.kt @@ -0,0 +1,13 @@ +package com.berlin.model + + +data class Task( + val id:String, + val projectId:String, + val title:String, + val description:String?, + val stateId:String, + val assignedTo:User, + val createBy:User, + val auditLogs:List + ) diff --git a/src/main/kotlin/model/User.kt b/src/main/kotlin/model/User.kt new file mode 100644 index 0000000..df2e76f --- /dev/null +++ b/src/main/kotlin/model/User.kt @@ -0,0 +1,9 @@ +package com.berlin.model + + +data class User( + val id:String, + val userName:String, + val password:String, + val role:UserRole +) diff --git a/src/main/kotlin/model/UserRole.kt b/src/main/kotlin/model/UserRole.kt new file mode 100644 index 0000000..e5ce06e --- /dev/null +++ b/src/main/kotlin/model/UserRole.kt @@ -0,0 +1,5 @@ +package com.berlin.model + +enum class UserRole { + ADMIN,MATE +} \ No newline at end of file