-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from SUIN-BUNDANG-LINE/SBL-148-survey-result-a…
…pi-fix2 [SBL-148] 설문 결과 API를 클라이언트 요구사항에 맞게 수정, 선택지와 필터에 개수 제한 추가
- Loading branch information
Showing
13 changed files
with
206 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/sbl/sulmun2yong/survey/domain/result/QuestionResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.sbl.sulmun2yong.survey.domain.result | ||
|
||
import java.util.SortedSet | ||
import java.util.UUID | ||
|
||
data class QuestionResult( | ||
val questionId: UUID, | ||
val resultDetails: List<ResultDetails>, | ||
/** 해당 질문의 모든 응답 집합 */ | ||
val contents: SortedSet<String>, | ||
) { | ||
fun getMatchedParticipants(questionFilter: QuestionFilter): Set<UUID> = | ||
resultDetails.mapNotNull { if (it.isMatched(questionFilter)) it.participantId else null }.toSet() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
src/main/kotlin/com/sbl/sulmun2yong/survey/domain/result/ResultFilter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
package com.sbl.sulmun2yong.survey.domain.result | ||
|
||
import com.sbl.sulmun2yong.survey.exception.InvalidResultFilterException | ||
|
||
data class ResultFilter( | ||
val questionFilters: List<QuestionFilter>, | ||
) | ||
) { | ||
companion object { | ||
const val MAX_SIZE = 20 | ||
} | ||
|
||
init { | ||
require(questionFilters.size <= MAX_SIZE) { throw InvalidResultFilterException() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/sbl/sulmun2yong/survey/exception/InvalidResultFilterException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.sbl.sulmun2yong.survey.exception | ||
|
||
import com.sbl.sulmun2yong.global.error.BusinessException | ||
import com.sbl.sulmun2yong.global.error.ErrorCode | ||
|
||
class InvalidResultFilterException : BusinessException(ErrorCode.INVALID_RESULT_FILTER) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.