Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CreateExperimentPostUseCase(
val timeRequired: TimeSlot?,

val leadResearcher: String,
val isOnCampus: Boolean,
val place: String?,
val region: Region?,
val area: Area?,
Expand Down Expand Up @@ -73,6 +74,7 @@ class CreateExperimentPostUseCase(
val postId: String,
val title: String,
val views: Int,
val isOnCampus: Boolean,
val place: String?,
val reward: String?,
val durationInfo: DurationInfo?
Expand Down Expand Up @@ -116,6 +118,7 @@ class CreateExperimentPostUseCase(
timeRequired = input.timeRequired,
count = input.count,
matchType = input.matchType,
isOnCampus = input.isOnCampus,
place = input.place,
region = input.region,
area = input.area,
Expand All @@ -140,6 +143,7 @@ class CreateExperimentPostUseCase(
postId = savedExperimentPost.id,
title = savedExperimentPost.title,
views = savedExperimentPost.views,
isOnCampus = savedExperimentPost.isOnCampus,
place = savedExperimentPost.place,
durationInfo = DurationInfo(
startDate = savedExperimentPost.startDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class GetExperimentPostDetailForUpdateUseCase(
)

data class Address(
val isOnCampus: Boolean,
val place: String?,
val region: Region?,
val area: Area?,
Expand Down Expand Up @@ -120,6 +121,7 @@ fun TargetGroup.toTargetGroupForUpdate(): GetExperimentPostDetailForUpdateUseCas

fun ExperimentPost.toAddressForUpdate(): GetExperimentPostDetailForUpdateUseCase.ExperimentPostDetailForUpdate.Address {
return GetExperimentPostDetailForUpdateUseCase.ExperimentPostDetailForUpdate.Address(
isOnCampus = this.isOnCampus,
place = this.place,
region = this.region,
area = this.area,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class GetExperimentPostDetailUseCase(
)

data class Address(
val isOnCampus: Boolean,
val place: String?,
val region: Region?,
val area: Area?,
Expand Down Expand Up @@ -120,6 +121,7 @@ fun TargetGroup.toTargetGroup(): GetExperimentPostDetailUseCase.ExperimentPostDe

fun ExperimentPost.toAddress(): GetExperimentPostDetailUseCase.ExperimentPostDetail.Address {
return GetExperimentPostDetailUseCase.ExperimentPostDetail.Address(
isOnCampus = this.isOnCampus,
place = this.place,
region = this.region,
area = this.area,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class GetExperimentPostsUseCase(
val experimentPostId: String,
val title: String,
val views: Int,
val isOnCampus: Boolean,
val place: String?,
val reward: String,
val recruitStatus: Boolean,
Expand Down Expand Up @@ -82,6 +83,7 @@ class GetExperimentPostsUseCase(
experimentPostId = post.id,
title = post.title,
views = post.views,
isOnCampus = post.isOnCampus,
place = post.place,
reward = post.reward,
recruitStatus = post.recruitStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class UpdateExperimentPostUseCase(
val timeRequired: TimeSlot?,

val leadResearcher: String?,
val isOnCampus: Boolean,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

isOnCampus 업데이트 미반영(기능 오류)

Input에 추가된 isOnCampus가 도메인 업데이트 경로로 전달되지 않아 값 변경이 저장/반영되지 않습니다. 응답(PostInfo)에서는 updatedPost.isOnCampus를 노출하므로, 사용자는 업데이트가 되지 않은 값(이전 값)을 보게 됩니다.

아래와 같이 UseCase에서 도메인 update 호출 시 인자를 추가하고, 도메인 모델의 update 시그니처/복사에도 필드를 반영해 주세요(도메인 파일의 수정 제안은 해당 파일 코멘트에 첨부).

         val experimentPost = existingPost.update(
             applyMethod = applyMethod,
             targetGroup = targetGroup,
             title = input.title,
             reward = input.reward,
             startDate = input.startDate,
             endDate = input.endDate,
             content = input.content,
             count = input.count,
             leadResearcher = input.leadResearcher,
             detailedAddress = input.detailedAddress,
             matchType = input.matchType,
+            isOnCampus = input.isOnCampus,
             place = input.place,
             region = input.region,
             area = input.area,
             timeRequired = input.timeRequired,
             imageListInfo = input.imageListInfo?.images,
             recruitStatus = input.recruitStatus,
             idGenerator = idGenerator
         )

Also applies to: 100-119, 127-127

val place: String?,
val region: Region?,
val area: Area?,
Expand Down Expand Up @@ -69,6 +70,7 @@ class UpdateExperimentPostUseCase(
val postId: String,
val title: String,
val views: Int,
val isOnCampus: Boolean,
val place: String?,
val reward: String?,
val durationInfo: DurationInfo?
Expand Down Expand Up @@ -122,6 +124,7 @@ class UpdateExperimentPostUseCase(
postId = updatedPost.id,
title = updatedPost.title,
views = updatedPost.views,
isOnCampus = updatedPost.isOnCampus,
place = updatedPost.place,
reward = updatedPost.reward,
durationInfo = DurationInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class CreateExperimentPostUseCaseTest : BehaviorSpec({
count = 35,
timeRequired = TimeSlot.LESS_30M,
leadResearcher = "야뿌 랩실 서버 25기 신수정",
isOnCampus = true,
place = "이화여자대학교",
region = Region.SEOUL,
area = Area.GEUMCHEONGU,
Expand Down Expand Up @@ -131,6 +132,7 @@ class CreateExperimentPostUseCaseTest : BehaviorSpec({
count = 35,
timeRequired = TimeSlot.LESS_30M,
leadResearcher = "야뿌 랩실 서버 25기 신수정",
isOnCampus = true,
place = "이화여자대학교",
region = Region.SEOUL,
area = Area.GEUMCHEONGU,
Expand Down Expand Up @@ -188,6 +190,7 @@ class CreateExperimentPostUseCaseTest : BehaviorSpec({
count = 35,
timeRequired = TimeSlot.LESS_30M,
leadResearcher = "야뿌 랩실 서버 25기 신수정",
isOnCampus = true,
place = "이화여자대학교",
region = Region.SEOUL,
area = Area.GEUMCHEONGU,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class GetExperimentPostApplyMethodUseCaseTest : BehaviorSpec({
applyMethod = applyMethod,
region = Region.SEOUL,
area = Area.GWANGJINGU,
isOnCampus = true,
place = "건국대학교",
detailedAddress = "건국대학교 공학관",
content = "야뿌들의 한끼 식사량을 체크하는 테스트입니다.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class GetExperimentPostDetailForUpdateUseCaseTest : BehaviorSpec({
applyMethod = applyMethod,
region = Region.SEOUL,
area = Area.GWANGJINGU,
isOnCampus = true,
place = "건국대학교",
detailedAddress = "건국대학교 공학관",
content = "야뿌들의 한끼 식사량을 체크하는 테스트입니다.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class GetExperimentPostDetailUseCaseTest : BehaviorSpec({
applyMethod = applyMethod,
region = Region.SEOUL,
area = Area.GWANGJINGU,
isOnCampus = true,
place = "건국대학교",
detailedAddress = "건국대학교 공학관",
content = "야뿌들의 한끼 식사량을 체크하는 테스트입니다.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class GetExperimentPostsUseCaseTest : BehaviorSpec({
id = "1",
title = "야뿌 피자 먹방 테스트",
views = 10,
isOnCampus = true,
place = "야뿌 대학교",
reward = "스타벅스 1만원권 쿠폰",
recruitStatus = false,
Expand Down Expand Up @@ -132,6 +133,7 @@ class GetExperimentPostsUseCaseTest : BehaviorSpec({
id = "1",
title = "Study Target Null Test",
views = 10,
isOnCampus = true,
place = "Test University",
reward = "Test Reward",
recruitStatus = false,
Expand Down Expand Up @@ -214,6 +216,7 @@ class GetExperimentPostsUseCaseTest : BehaviorSpec({
id = "1",
title = "Location Target Null Test",
views = 10,
isOnCampus = true,
place = "Test University",
reward = "Test Reward",
recruitStatus = false,
Expand Down Expand Up @@ -295,6 +298,7 @@ class GetExperimentPostsUseCaseTest : BehaviorSpec({
id = "1",
title = "Location Target Null Test",
views = 10,
isOnCampus = true,
place = "Test University",
reward = "Test Reward",
recruitStatus = false,
Expand Down Expand Up @@ -376,6 +380,7 @@ class GetExperimentPostsUseCaseTest : BehaviorSpec({
id = "1",
title = "야뿌 피자 먹방 테스트",
views = 10,
isOnCampus = true,
place = "Test University",
reward = "Test Reward",
recruitStatus = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class GetMyExperimentPostsUseCaseTest : BehaviorSpec({
timeRequired = TimeSlot.ABOUT_1H,
targetGroup = targetGroup,
applyMethod = applyMethod,
isOnCampus = true,
region = Region.SEOUL,
area = Area.GWANGJINGU,
place = "건국대학교",
Expand Down Expand Up @@ -87,6 +88,7 @@ class GetMyExperimentPostsUseCaseTest : BehaviorSpec({
applyMethod = applyMethod,
region = Region.BUSAN,
area = Area.GEUMJEONGGU,
isOnCampus = true,
place = "부산대학교",
detailedAddress = "부산대학교 자연과학대학",
content = "다음 세대의 AI를 위한 실험 연구입니다.",
Expand All @@ -112,6 +114,7 @@ class GetMyExperimentPostsUseCaseTest : BehaviorSpec({
applyMethod = applyMethod,
region = Region.SEOUL,
area = Area.GWANAKGU,
isOnCampus = true,
place = "서울대학교",
detailedAddress = "서울대학교 전산관",
content = "소셜 미디어에 대한 연구에 참여할 모집입니다.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class UpdateExperimentPostRecruitStatusUseCaseTest : BehaviorSpec({
timeRequired = TimeSlot.ABOUT_1H,
count = 10,
matchType = mockk(),
isOnCampus = true,
place = "야뿌대학교",
region = Region.SEOUL,
area = Area.GANGNAMGU,
Expand Down Expand Up @@ -110,6 +111,7 @@ class UpdateExperimentPostRecruitStatusUseCaseTest : BehaviorSpec({
timeRequired = TimeSlot.ABOUT_1H,
count = 10,
matchType = mockk(),
isOnCampus = true,
place = "야뿌대학교",
region = Region.SEOUL,
area = Area.GANGNAMGU,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class GetMatchingExperimentPostsUseCaseTest : BehaviorSpec({
count = 35,
timeRequired = TimeSlot.LESS_30M,
leadResearcher = "야뿌 랩실 서버 25기 신수정",
isOnCampus = true,
place = "이화여자대학교",
region = Region.SEOUL,
area = Area.GEUMCHEONGU,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class SendMatchingEmailUseCaseTest : BehaviorSpec({
count = 35,
timeRequired = TimeSlot.LESS_30M,
leadResearcher = "야뿌 랩실 서버 25기 신수정",
isOnCampus = true,
place = "이화여자대학교",
region = Region.SEOUL,
area = Area.GEUMCHEONGU,
Expand Down Expand Up @@ -164,6 +165,7 @@ class SendMatchingEmailUseCaseTest : BehaviorSpec({
count = 35,
timeRequired = TimeSlot.LESS_30M,
leadResearcher = "야뿌 랩실 서버 25기 신수정",
isOnCampus = true,
place = "이화여자대학교",
region = Region.SEOUL,
area = Area.GEUMCHEONGU,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ data class ExperimentPost(
var timeRequired: TimeSlot?,
var count: Int,
var matchType: MatchType,
var isOnCampus: Boolean,
var place: String?,
var region: Region?,
var area: Area?,
Expand Down Expand Up @@ -140,6 +141,7 @@ data class ExperimentPost(
timeRequired: TimeSlot?,
count: Int,
matchType: MatchType,
isOnCampus: Boolean,
place: String?,
region: Region?,
area: Area?,
Expand All @@ -165,6 +167,7 @@ data class ExperimentPost(
timeRequired = timeRequired,
count = count,
matchType = matchType,
isOnCampus = isOnCampus,
place = place,
region = region,
area = area,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class ExperimentPostEntity(
@Column(name = "match_type", nullable = false)
var matchType: MatchType,

@Column(name = "is_on_campus")
var isOnCampus: Boolean,

@Column(name = "place", length = 100)
var place: String?,

Expand Down Expand Up @@ -138,6 +141,7 @@ class ExperimentPostEntity(
timeRequired = timeRequired,
count = count,
matchType = matchType,
isOnCampus = isOnCampus,
place = place,
region = region,
area = area,
Expand Down Expand Up @@ -166,6 +170,7 @@ class ExperimentPostEntity(
timeRequired = experimentPost.timeRequired,
count = experimentPost.count,
matchType = experimentPost.matchType,
isOnCampus = experimentPost.isOnCampus,
place = experimentPost.place,
region = experimentPost.region,
area = experimentPost.area,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data class CreateExperimentPostRequest(

val leadResearcher: String, // 연구 책임 정보 -> 기본값: 연구자 정보에서 끌어와야 함, 추후에 자유롭게 수정 가능

val isOnCampus: Boolean,
val place: String?, // 대학교 이름 -> 기본값: 연구자 정보에서 끌어와야 함, 추후에 자유롭게 수정 가능
val region: Region?,
val area: Area?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data class UpdateExperimentPostRequest(

val leadResearcher: String?, // 연구 책임 정보 -> 기본값: 연구자 정보에서 끌어와야 함, 추후에 자유롭게 수정 가능

val isOnCampus: Boolean,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update 요청 스키마의 비호환 변경 위험

isOnCampus를 필수(Boolean)로 추가하면 기존 클라이언트 요청이 400으로 깨질 수 있습니다. 하위 호환을 위해 nullable+기본값 또는 기본값만 두는 것을 권장합니다. 업데이트 로직에서는 null이면 기존 값을 유지하는 패치 동작으로 처리하세요.

적용 예시:

-    val isOnCampus: Boolean,
+    val isOnCampus: Boolean? = null,

업데이트 적용 시(참고용):

// 예: usecase/mapper 내부
val newIsOnCampus = request.isOnCampus ?: existing.isOnCampus
🤖 Prompt for AI Agents
presentation/src/main/kotlin/com/dobby/api/dto/request/experiment/UpdateExperimentPostRequest.kt
around line 22: the new non-nullable Boolean property isOnCampus breaks backward
compatibility for existing clients; change the request field to nullable
(Boolean?) or provide a default so missing values don't cause 400s, and update
the update/mapper logic to treat null as "keep existing" (i.e., use
existing.isOnCampus when request.isOnCampus is null) to implement patch-style
behavior.

val place: String?, // 대학교 이름 -> 기본값: 연구자 정보에서 끌어와야 함, 추후에 자유롭게 수정 가능
val region: Region?,
val area: Area?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ data class ExperimentPostDetailResponse(

@Schema(description = "주소 응답 DTO")
data class AddressResponse(
@Schema(description = "교내 실험 여부", example = "true")
val isOnCampus: Boolean,

@Schema(description = "장소", example = "건국대학교 1층")
val place: String?,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ data class PostInfo(
val experimentPostId: String,
val title: String,
val views: Int,
val isOnCampus: Boolean,
val place: String?,
val reward: String?,
val durationInfo: DurationInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ object ExperimentPostMapper {
title = request.title,
content = request.content,
alarmAgree = request.alarmAgree,
isOnCampus = request.isOnCampus,
place = request.place,
count = request.count,
region = request.region,
Expand Down Expand Up @@ -101,6 +102,7 @@ object ExperimentPostMapper {
experimentPostId = input.postId,
title = input.title,
views = input.views,
isOnCampus = input.isOnCampus,
durationInfo = DurationInfo(
startDate = input.durationInfo?.startDate,
endDate = input.durationInfo?.endDate
Expand Down Expand Up @@ -142,6 +144,7 @@ object ExperimentPostMapper {
startDate = input.durationInfo?.startDate,
endDate = input.durationInfo?.endDate
),
isOnCampus = input.isOnCampus,
reward = input.reward,
place = input.place
)
Expand All @@ -156,6 +159,7 @@ object ExperimentPostMapper {
imageListInfo = toUpdateImageListInfo(request.imageListInfo),
title = request.title,
content = request.content,
isOnCampus = request.isOnCampus,
place = request.place,
count = request.count,
region = request.region,
Expand Down Expand Up @@ -226,6 +230,7 @@ object ExperimentPostMapper {

private fun GetExperimentPostDetailForUpdateUseCase.ExperimentPostDetailForUpdate.Address.toResponse(): ExperimentPostDetailResponse.AddressResponse {
return ExperimentPostDetailResponse.AddressResponse(
isOnCampus = this.isOnCampus,
place = this.place,
region = this.region,
area = this.area,
Expand Down Expand Up @@ -282,6 +287,7 @@ object ExperimentPostMapper {

private fun GetExperimentPostDetailUseCase.ExperimentPostDetail.Address.toResponse(): ExperimentPostDetailResponse.AddressResponse {
return ExperimentPostDetailResponse.AddressResponse(
isOnCampus = this.isOnCampus,
place = this.place,
region = this.region,
area = this.area,
Expand Down Expand Up @@ -397,6 +403,7 @@ object ExperimentPostMapper {
experimentPostId = post.postInfo.experimentPostId,
title = post.postInfo.title,
views = post.postInfo.views,
isOnCampus = post.postInfo.isOnCampus,
place = post.postInfo.place,
reward = post.postInfo.reward,
durationInfo = DurationInfo(
Expand Down
Loading