Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SBL-98] 설문 저장, 설문 제작 정보 API 형식 수정 #54

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ data class SurveySaveRequest(
)

data class SectionCreateRequest(
val id: UUID,
val sectionId: UUID,
val title: String,
val description: String,
val questions: List<QuestionCreateRequest>,
val routeDetails: RouteDetailsCreateRequest,
) {
fun toDomain(sectionIds: SectionIds) =
Section(
id = SectionId.Standard(id),
id = SectionId.Standard(sectionId),
title = title,
description = description,
routingStrategy = getRoutingStrategy(),
Expand Down Expand Up @@ -76,7 +76,7 @@ data class SurveySaveRequest(
)

data class QuestionCreateRequest(
val id: UUID,
val questionId: UUID,
val type: QuestionType,
val title: String,
val description: String,
Expand All @@ -88,14 +88,14 @@ data class SurveySaveRequest(
when (type) {
QuestionType.TEXT_RESPONSE ->
StandardTextQuestion(
id = id,
id = questionId,
title = title,
description = description,
isRequired = isRequired,
)
QuestionType.SINGLE_CHOICE ->
StandardSingleChoiceQuestion(
id = id,
id = questionId,
title = title,
description = description,
isRequired = isRequired,
Expand All @@ -107,7 +107,7 @@ data class SurveySaveRequest(
)
QuestionType.MULTIPLE_CHOICE ->
StandardMultipleChoiceQuestion(
id = id,
id = questionId,
title = title,
description = description,
isRequired = isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ data class SurveyMakeInfoResponse(
)

data class SectionMakeInfoResponse(
val id: UUID,
val sectionId: UUID,
val title: String,
val description: String,
val questions: List<QuestionMakeInfoResponse>,
Expand All @@ -54,7 +54,7 @@ data class SurveyMakeInfoResponse(
companion object {
fun from(section: Section) =
SectionMakeInfoResponse(
id = section.id.value,
sectionId = section.id.value,
title = section.title,
description = section.description,
questions = section.questions.map { QuestionMakeInfoResponse.from(it) },
Expand Down Expand Up @@ -96,7 +96,7 @@ data class SurveyMakeInfoResponse(
)

data class QuestionMakeInfoResponse(
val id: UUID,
val questionId: UUID,
val type: QuestionType,
val title: String,
val description: String,
Expand All @@ -107,7 +107,7 @@ data class SurveyMakeInfoResponse(
companion object {
fun from(question: Question) =
QuestionMakeInfoResponse(
id = question.id,
questionId = question.id,
type = question.questionType,
title = question.title,
description = question.description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SurveyManagementService(
val rewards = surveySaveRequest.rewards.map { Reward(name = it.name, category = it.category, count = it.count) }
val newSurvey =
with(surveySaveRequest) {
val sectionIds = SectionIds.from(surveySaveRequest.sections.map { SectionId.Standard(it.id) })
val sectionIds = SectionIds.from(surveySaveRequest.sections.map { SectionId.Standard(it.sectionId) })
survey.updateContent(
title = this.title,
description = this.description,
Expand Down
Loading