Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyoil2 committed May 14, 2024
2 parents c1d6e01 + a90e28b commit f6f6052
Show file tree
Hide file tree
Showing 39 changed files with 509 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @softpeanut @jeongyoon05 @rlaisqls @tedsoftj1123 @alsdl0629 @ilyoil2
* @softpeanut @jeongyoon05 @rlaisqls @tedsoftj1123 @alsdl0629 @ilyoil2 @4mjeo @zios0707
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package team.aliens.dms.domain.bug.dto

data class CreateBugReportRequest(
val content: String,
val developmentArea: String,
val attachmentUrls: List<String>?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package team.aliens.dms.domain.bug.model

data class BugAttachment(
val attachmentUrls: List<String>?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package team.aliens.dms.domain.bug.model

import team.aliens.dms.common.annotation.Aggregate
import java.time.LocalDateTime
import java.util.UUID

@Aggregate
data class BugReport(

val id: UUID = UUID(0, 0),

val studentId: UUID,

val content: String,

val developmentArea: DevelopmentArea,

val createdAt: LocalDateTime?,

val attachmentUrls: BugAttachment?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package team.aliens.dms.domain.bug.model

enum class DevelopmentArea {
IOS,
ANDROID
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package team.aliens.dms.domain.bug.service

import team.aliens.dms.common.annotation.Service

@Service
class BugService(
commandBugService: CommandBugService
) : CommandBugService by commandBugService
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package team.aliens.dms.domain.bug.service

import team.aliens.dms.domain.bug.model.BugReport

interface CommandBugService {

fun saveBugReport(bugReport: BugReport): BugReport
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package team.aliens.dms.domain.bug.service

import team.aliens.dms.common.annotation.Service
import team.aliens.dms.domain.bug.model.BugReport
import team.aliens.dms.domain.bug.spi.CommandBugPort

@Service
class CommandBugServiceImpl(
private val commandBugPort: CommandBugPort,
) : CommandBugService {

override fun saveBugReport(bugReport: BugReport) =
commandBugPort.saveBugReport(bugReport)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package team.aliens.dms.domain.bug.spi

interface BugPort :
CommandBugPort
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package team.aliens.dms.domain.bug.spi

import team.aliens.dms.domain.bug.model.BugReport

interface CommandBugPort {

fun saveBugReport(bugReport: BugReport): BugReport
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package team.aliens.dms.domain.bug.usecase

import team.aliens.dms.common.annotation.UseCase
import team.aliens.dms.domain.bug.dto.CreateBugReportRequest
import team.aliens.dms.domain.bug.model.BugAttachment
import team.aliens.dms.domain.bug.model.BugReport
import team.aliens.dms.domain.bug.model.DevelopmentArea
import team.aliens.dms.domain.bug.service.BugService
import team.aliens.dms.domain.student.service.StudentService
import java.time.LocalDateTime

@UseCase
class CreateBugReportUseCase(
private val bugService: BugService,
private val studentService: StudentService
) {

fun execute(request: CreateBugReportRequest) {
val student = studentService.getCurrentStudent()

val attachmentUrls = request.attachmentUrls ?: emptyList()

bugService.saveBugReport(
BugReport(
studentId = student.id,
content = request.content,
developmentArea = DevelopmentArea.valueOf(request.developmentArea),
createdAt = LocalDateTime.now(),
attachmentUrls = BugAttachment(attachmentUrls)
)
)
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package team.aliens.dms.domain.outing.service

import team.aliens.dms.common.annotation.Service
import team.aliens.dms.domain.outing.exception.OutingApplicationAlreadyExistsException
import team.aliens.dms.domain.outing.exception.OutingAvailableTimeMismatchException
import team.aliens.dms.domain.outing.exception.OutingTypeAlreadyExistsException
import team.aliens.dms.domain.outing.model.OutingType
Expand All @@ -26,7 +25,6 @@ class CheckOutingServiceImpl(
arrivalTime: LocalTime
) {
checkOutingAvailableTime(outingDate, outingTime, arrivalTime)
checkOutingApplicationExistsByOutingDateAndStudentId(outingDate, studentId)
}

private fun checkOutingAvailableTime(
Expand All @@ -39,12 +37,6 @@ class CheckOutingServiceImpl(
?: throw OutingAvailableTimeMismatchException
}

private fun checkOutingApplicationExistsByOutingDateAndStudentId(outingDate: LocalDate, studentId: UUID) {
if (queryOutingApplicationPort.existOutingApplicationByOutingDateAndStudentId(outingDate, studentId)) {
throw OutingApplicationAlreadyExistsException
}
}

override fun checkOutingTypeExists(outingType: OutingType) {
if (queryOutingTypePort.existsOutingType(outingType)) {
throw OutingTypeAlreadyExistsException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
package team.aliens.dms.domain.tag.model

enum class WarningTag(warningMessage: String) {
SAFE(""),
FIRST_WARNING("1차 경고"),
SECOND_WARNING("2차 경고"),
THIRD_WARNING("3차 경고"),
ONE_OUT("OUT 1"),
TWO_OUT("OUT 2"),
THREE_OUT("OUT 3");
import team.aliens.dms.domain.tag.exception.TagNotFoundException

enum class WarningTag(val warningMessage: String, val point: Int) {
SAFE("SAFE", 0),

FIRST_WARNING("경고 1단계", 15),
SECOND_WARNING("경고 2단계", 20),
THIRD_WARNING("경고 3단계", 25),
ONE_OUT("OUT 1", 30),
TWO_OUT("OUT 2", 35),
THREE_OUT("OUT 3", 40),

C_FIRST_WARNING("경고 1단계(완료)", 15),
C_SECOND_WARNING("경고 2단계(완료)", 20),
C_THIRD_WARNING("경고 3단계(완료)", 25),
C_ONE_OUT("OUT 1(완료)", 30),
C_TWO_OUT("OUT 2(완료)", 35),
C_THREE_OUT("OUT 3(완료)", 40);

companion object {
fun byContent(warningMessage: String): WarningTag =
when (warningMessage) {
FIRST_WARNING.warningMessage -> FIRST_WARNING
SECOND_WARNING.warningMessage -> SECOND_WARNING
THIRD_WARNING.warningMessage -> THIRD_WARNING
ONE_OUT.warningMessage -> ONE_OUT
TWO_OUT.warningMessage -> TWO_OUT
THREE_OUT.warningMessage -> THREE_OUT

C_FIRST_WARNING.warningMessage -> C_FIRST_WARNING
C_SECOND_WARNING.warningMessage -> C_SECOND_WARNING
C_THIRD_WARNING.warningMessage -> C_THIRD_WARNING
C_ONE_OUT.warningMessage -> C_ONE_OUT
C_TWO_OUT.warningMessage -> C_TWO_OUT
C_THREE_OUT.warningMessage -> C_THREE_OUT
else -> throw TagNotFoundException
}

fun byPoint(minusPoint: Int) = when {
40 <= minusPoint -> THREE_OUT
35 <= minusPoint -> TWO_OUT
Expand All @@ -20,13 +48,20 @@ enum class WarningTag(warningMessage: String) {
else -> SAFE
}

fun getAllNames(): List<String> = listOf(
FIRST_WARNING.name,
SECOND_WARNING.name,
THIRD_WARNING.name,
ONE_OUT.name,
TWO_OUT.name,
THREE_OUT.name
fun getAllMessages(): List<String> = listOf(
FIRST_WARNING.warningMessage,
SECOND_WARNING.warningMessage,
THIRD_WARNING.warningMessage,
ONE_OUT.warningMessage,
TWO_OUT.warningMessage,
THREE_OUT.warningMessage,

C_FIRST_WARNING.warningMessage,
C_SECOND_WARNING.warningMessage,
C_THIRD_WARNING.warningMessage,
C_ONE_OUT.warningMessage,
C_TWO_OUT.warningMessage,
C_THREE_OUT.warningMessage
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.UUID

interface CommandTagService {

fun deleteAllStudentTagsByTagIdIn(tagIds: List<UUID>)
fun deleteAllStudentTagsByStudentIdIn(studentIds: List<UUID>)

fun deleteStudentTagById(studentId: UUID, tagId: UUID)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class CommandTagServiceImpl(
private val commandTagPort: CommandTagPort
) : CommandTagService {

override fun deleteAllStudentTagsByTagIdIn(tagIds: List<UUID>) {
commandStudentTagPort.deleteAllStudentTagsByTagIdIn(tagIds)
override fun deleteAllStudentTagsByStudentIdIn(studentIds: List<UUID>) {
commandStudentTagPort.deleteAllStudentTagsByStudentIdIn(studentIds)
}

override fun deleteStudentTagById(studentId: UUID, tagId: UUID) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ package team.aliens.dms.domain.tag.service

import team.aliens.dms.domain.tag.model.StudentTag
import team.aliens.dms.domain.tag.model.Tag
import team.aliens.dms.domain.tag.spi.vo.StudentTagDetailVO
import java.util.UUID

interface GetTagService {

fun getStudentTagsByTagNameIn(names: List<String>): List<StudentTag>

fun getStudentTagsByStudentId(studentId: UUID): List<StudentTag>

fun getAllWarningTags(names: List<String>): List<Tag>
fun getAllStudentTagDetails(): List<StudentTagDetailVO>

fun getTagsByTagNameIn(names: List<String>): List<Tag>

fun getTagByName(name: String): Tag

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import team.aliens.dms.domain.tag.model.StudentTag
import team.aliens.dms.domain.tag.model.Tag
import team.aliens.dms.domain.tag.spi.QueryStudentTagPort
import team.aliens.dms.domain.tag.spi.QueryTagPort
import team.aliens.dms.domain.tag.spi.vo.StudentTagDetailVO
import java.util.UUID

@Service
Expand All @@ -14,11 +15,17 @@ class GetTagServiceImpl(
private val queryStudentTagPort: QueryStudentTagPort
) : GetTagService {

override fun getStudentTagsByTagNameIn(names: List<String>): List<StudentTag> =
queryStudentTagPort.queryStudentTagsByTagNameIn(names)

override fun getStudentTagsByStudentId(studentId: UUID): List<StudentTag> =
queryStudentTagPort.queryStudentTagsByStudentId(studentId)

override fun getAllWarningTags(names: List<String>): List<Tag> =
queryTagPort.queryAllWarningTags(names)
override fun getAllStudentTagDetails(): List<StudentTagDetailVO> =
queryStudentTagPort.queryAllStudentTagDetails()

override fun getTagsByTagNameIn(names: List<String>): List<Tag> =
queryTagPort.queryTagsByTagNameIn(names)

override fun getTagByName(name: String) =
queryTagPort.queryTagByName(name) ?: throw TagNotFoundException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.util.UUID

interface CommandStudentTagPort {

fun deleteAllStudentTagsByTagIdIn(tagIds: List<UUID>)
fun deleteAllStudentTagsByStudentIdIn(studentIds: List<UUID>)

fun deleteStudentTagById(studentId: UUID, tagId: UUID)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package team.aliens.dms.domain.tag.spi

import team.aliens.dms.domain.tag.model.StudentTag
import team.aliens.dms.domain.tag.spi.vo.StudentTagDetailVO
import java.util.UUID

interface QueryStudentTagPort {

fun queryStudentTagsByTagNameIn(names: List<String>): List<StudentTag>

fun queryStudentTagsByStudentId(studentId: UUID): List<StudentTag>

fun queryAllStudentTagDetails(): List<StudentTagDetailVO>
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.util.UUID

interface QueryTagPort {

fun queryAllWarningTags(names: List<String>): List<Tag>
fun queryTagsByTagNameIn(names: List<String>): List<Tag>

fun queryTagsBySchoolId(schoolId: UUID): List<Tag>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package team.aliens.dms.domain.tag.spi.vo

import java.util.UUID

open class StudentTagDetailVO(
val studentId: UUID,
val studentName: String,
val tagId: UUID,
val tagColor: String,
val tagName: String
)
Loading

0 comments on commit f6f6052

Please sign in to comment.