Skip to content

Conversation

@chock-cho
Copy link
Member

@chock-cho chock-cho commented Sep 23, 2025

💡 작업 내용

  • 작업한 내용을 간략하게 리스트로 적어주세요

✅ 셀프 체크리스트

  • PR 제목을 형식에 맞게 작성했나요?
  • 브랜치 전략에 맞는 브랜치에 PR을 올리고 있나요?
  • 테스트는 잘 통과했나요?
  • 빌드에 성공했나요?
  • 본인을 assign 해주세요.
  • 해당 PR에 맞는 label을 붙여주세요.

🙋🏻‍ 확인해주세요

  • 관련된 Discussion 등이 있다면 첨부해주세요

🔗 Jira 티켓


https://yappsocks.atlassian.net/browse/YS-505

Summary by CodeRabbit

  • 신기능
    • 실험 공고에 ‘교내 실험 여부’(isOnCampus) 필드를 추가했습니다. 이제 공고 생성·수정 시 해당 값을 입력할 수 있으며, 생성/수정 결과 응답, 공고 목록, 공고 상세, 수정용 상세 조회에서 일관되게 확인할 수 있습니다. 이를 통해 실험이 교내에서 진행되는지 쉽게 구분할 수 있습니다.

@chock-cho chock-cho self-assigned this Sep 23, 2025
@chock-cho chock-cho added the ✨ FEATURE 기능 추가 label Sep 23, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

실험 게시글 전반에 isOnCampus(Boolean) 필드를 추가하고, 도메인-영속성-유스케이스-프레젠테이션-매퍼-테스트 전 계층에 전달/매핑을 반영했습니다. 생성/수정 입력과 출력, 상세/목록 조회 응답 및 엔티티/도메인 변환, 테스트 픽스처 모두 해당 필드를 포함하도록 수정되었습니다.

Changes

Cohort / File(s) Summary
Domain Model
domain/src/main/kotlin/com/dobby/model/experiment/ExperimentPost.kt
ExperimentPostisOnCampus 추가; newExperimentPost, update 시그니처 확장 및 필드 전달 반영
Persistence Entity
infrastructure/src/main/kotlin/com/dobby/persistence/entity/experiment/ExperimentPostEntity.kt
엔티티에 컬럼 is_on_campus/프로퍼티 isOnCampus 추가; toDomain/fromDomain 매핑 확장
Use Cases - Experiment posts
application/src/main/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCase.kt, .../GetExperimentPostDetailForUpdateUseCase.kt, .../GetExperimentPostDetailUseCase.kt, .../GetExperimentPostsUseCase.kt, .../UpdateExperimentPostUseCase.kt
입력/출력 DTO와 내부 매핑에 isOnCampus 추가 및 전달
Presentation - Requests
presentation/src/main/kotlin/com/dobby/api/dto/request/experiment/CreateExperimentPostRequest.kt, .../UpdateExperimentPostRequest.kt
요청 DTO에 isOnCampus 필드 추가
Presentation - Responses & Mapper
presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/ExperimentPostDetailResponse.kt, .../PostInfo.kt, .../mapper/ExperimentPostMapper.kt
응답 DTO(Address/PostInfo)에 isOnCampus 추가; 생성/수정/상세/목록 매퍼에 필드 매핑 추가
Tests - Use cases
application/src/test/kotlin/com/dobby/usecase/experiment/*
application/src/test/kotlin/com/dobby/usecase/member/email/*
테스트 픽스처의 ExperimentPost 생성자 및 유스케이스 입력에 isOnCampus 초기화 추가

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as API (Request DTO)
  participant UC as CreateExperimentPostUseCase
  participant Domain as ExperimentPost
  participant Repo as ExperimentPostEntity/Repo
  participant Mapper as Mapper (Response)

  Client->>API: CreateExperimentPostRequest{..., isOnCampus}
  API->>UC: Input{..., isOnCampus}
  UC->>Domain: newExperimentPost(..., isOnCampus)
  Domain-->>UC: ExperimentPost{..., isOnCampus}
  UC->>Repo: save(Entity{..., isOnCampus})
  Repo-->>UC: ExperimentPost{..., isOnCampus}
  UC->>Mapper: PostInfo mapping with isOnCampus
  Mapper-->>Client: Response{postInfo{..., isOnCampus}}
  note over UC,Repo: isOnCampus 필드가 전 구간에 전달/보존
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as API (Request DTO)
  participant UC as UpdateExperimentPostUseCase
  participant Repo as ExperimentPostEntity/Repo
  participant Domain as ExperimentPost
  participant Mapper as Mapper (Response)

  Client->>API: UpdateExperimentPostRequest{..., isOnCampus}
  API->>UC: Input{..., isOnCampus}
  UC->>Repo: findById(...)
  Repo-->>UC: ExperimentPost{...}
  UC->>Domain: update(..., isOnCampus)
  Domain-->>UC: ExperimentPost{..., isOnCampus}
  UC->>Repo: save(...)
  Repo-->>UC: ExperimentPost{..., isOnCampus}
  UC->>Mapper: PostInfo mapping with isOnCampus
  Mapper-->>Client: Response{postInfo{..., isOnCampus}}
Loading
sequenceDiagram
  autonumber
  actor Client
  participant UC1 as GetExperimentPostDetailUseCase
  participant UC2 as GetExperimentPostDetailForUpdateUseCase
  participant Repo as ExperimentPostEntity/Repo
  participant Mapper as Mapper (Response)

  Client->>UC1: detail(id)
  UC1->>Repo: load(id)
  Repo-->>UC1: ExperimentPost{..., isOnCampus}
  UC1->>Mapper: Address/PostInfo with isOnCampus
  Mapper-->>Client: DetailResponse{address{isOnCampus,...}}

  Client->>UC2: detailForUpdate(id)
  UC2->>Repo: load(id)
  Repo-->>UC2: ExperimentPost{..., isOnCampus}
  UC2->>Mapper: AddressForUpdate with isOnCampus
  Mapper-->>Client: Response{address{isOnCampus,...}}
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

귀퉁이 노트에 체크를 하나 ✔️
캠퍼스 안이냐, 바깥이냐—토끼는 안다!
필드 하나 더, 행 하나 더 늘어났네,
저장소부터 응답까지 길게 달려왔네.
깡충! isOnCampus, 이제 길 표지판 완성 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed 제목은 PR의 핵심 변경 사항을 명확하게 요약하고 있으며 기존 공고 조회 시 누락되었던 isOnCampus 필드값을 추가하는 목적을 분명히 전달합니다. 티켓 번호(YS-505)와 'feature' 태그가 포함되어 있어 변경 의도를 빠르게 파악할 수 있습니다. 불필요한 단어나 이모지 없이 간결하므로 제목 검사 기준을 충족합니다.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/YS-505

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chock-cho chock-cho merged commit 4728037 into dev Sep 23, 2025
3 of 4 checks passed
@chock-cho chock-cho deleted the feature/YS-505 branch September 23, 2025 13:10
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
domain/src/main/kotlin/com/dobby/model/experiment/ExperimentPost.kt (1)

61-80: 도메인 update에 isOnCampus 반영 누락

update(...) 시그니처 및 copy에서 isOnCampus가 누락되어 업데이트가 불가능합니다. 아래와 같이 보완해 주세요.

     fun update(
         targetGroup: TargetGroup?,
         applyMethod: ApplyMethod?,
         title: String?,
         reward: String?,
         startDate: LocalDate?,
         endDate: LocalDate?,
         content: String?,
         count: Int?,
         leadResearcher: String?,
         detailedAddress: String?,
         matchType: MatchType?,
+        isOnCampus: Boolean?,
         place: String?,
         region: Region?,
         area: Area?,
         timeRequired: TimeSlot?,
         imageListInfo: List<String>?,
         recruitStatus: Boolean?,
         idGenerator: IdGenerator
     ): ExperimentPost {
@@
         return this.copy(
             targetGroup = targetGroup?.let { this.targetGroup.update(it.startAge, it.endAge, it.genderType, it.otherCondition) } ?: this.targetGroup,
             applyMethod = applyMethod?.let { this.applyMethod.update(it.phoneNum, it.formUrl, it.content) } ?: this.applyMethod,
             title = title ?: this.title,
             reward = reward ?: this.reward,
             startDate = startDate ?: this.startDate,
             endDate = endDate ?: this.endDate,
             content = content ?: this.content,
             count = count ?: this.count,
             leadResearcher = leadResearcher ?: this.leadResearcher,
             detailedAddress = detailedAddress,
             matchType = matchType ?: this.matchType,
+            isOnCampus = isOnCampus ?: this.isOnCampus,
             timeRequired = timeRequired ?: this.timeRequired,
             place = place,
             region = region,
             area = area,
             images = updatedImages,
             updatedAt = TimeProvider.currentDateTime(),
             recruitStatus = recruitStatus ?: this.recruitStatus
         )
     }

Also applies to: 98-117

🧹 Nitpick comments (11)
application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostDetailForUpdateUseCaseTest.kt (1)

63-63: 픽스처에 isOnCampus 추가 OK. 검증 보강 권장

해당 유스케이스 결과에 isOnCampus가 노출된다면, 결과 객체에 대한 필드 검증도 1~2개 추가해 주세요(회귀 방지).

application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCaseTest.kt (1)

50-51: 픽스처에 isOnCampus 추가 OK. 결과 검증도 추가 권장

PostInfo에 isOnCampus가 포함된다면, result.first().postInfo.isOnCampus shouldBe true 같은 단언을 각 시나리오에 1개씩 추가해 주세요.

Also applies to: 136-137, 219-220, 302-303, 384-385

application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostDetailUseCaseTest.kt (1)

65-65: 픽스처에 isOnCampus 추가 OK. 응답 검증 1줄 추가 권장

응답의 address에 노출된다면 result.experimentPostDetail.address.isOnCampus shouldBe true 단언을 추가해 주세요.

presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/PostInfo.kt (1)

3-9: Boolean 'is' 프리픽스 직렬화 명시화 권장 (@JsonProperty 추가)

Jackson 사용 시 isOnCampusonCampus로 내려갈 수 있습니다. JSON 필드명을 고정해 주세요.

적용 예시:

 import java.time.LocalDate
+import com.fasterxml.jackson.annotation.JsonProperty
 data class PostInfo(
     val experimentPostId: String,
     val title: String,
     val views: Int,
-    val isOnCampus: Boolean,
+    @field:JsonProperty("isOnCampus")
+    val isOnCampus: Boolean,
     val place: String?,
     val reward: String?,
     val durationInfo: DurationInfo
 )

검증: 스웨거/실제 응답에서 키가 isOnCampus로 노출되는지 확인 바랍니다.

presentation/src/main/kotlin/com/dobby/api/dto/request/experiment/CreateExperimentPostRequest.kt (1)

3-7: 요청 스키마 잠재적 깨짐: isOnCampus를 기본값/nullable로 처리하거나 마이그레이션 공지 필요

PR 목적은 “조회 시 누락된 필드 추가”인데, 생성 요청에 필드를 필수(Boolean)로 추가하면 기존 클라이언트가 실패할 수 있습니다. 기본값을 두어 호환성을 유지하는 것을 권장합니다. 또한 JSON 필드명 고정도 함께 제안합니다.

 import com.dobby.enums.experiment.TimeSlot
 import java.time.LocalDate
+import com.fasterxml.jackson.annotation.JsonProperty

 data class CreateExperimentPostRequest(
@@
-    val isOnCampus: Boolean,
+    @field:JsonProperty("isOnCampus")
+    val isOnCampus: Boolean = false,
  • 대안: Boolean? = null 후 서버에서 기본값 보정.
  • 확인: 앱/프론트가 이미 본 필드를 전송하는지 여부.

Also applies to: 20-26

application/src/test/kotlin/com/dobby/usecase/experiment/GetMyExperimentPostsUseCaseTest.kt (1)

63-68: 새 필드 커버리지 보강 제안: isOnCampus도 검증

픽스처에 isOnCampus = true를 넣으셨으니, 결과 검증에 해당 필드도 포함하면 좋습니다.

예시:

result[0].isOnCampus shouldBe true
result[1].isOnCampus shouldBe true
result[2].isOnCampus shouldBe true
application/src/test/kotlin/com/dobby/usecase/member/email/GetMatchingExperimentPostsUseCaseTest.kt (1)

79-80: 매칭 결과 검증에 isOnCampus도 포함 권장

출력 검증 시 isOnCampus 포함해 회귀 방지 강화 제안.

예시:

output.matchingPosts.values.flatten().first().isOnCampus shouldBe true
application/src/test/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCaseTest.kt (1)

90-95: 생성 결과에 isOnCampus 검증 추가 제안

생성 응답 PostInfo에 필드가 포함되므로 함께 검증해 주세요.

             then("정상적으로 실험 게시글이 생성되어야 한다") {
                 result.postInfo.postId shouldBe "0"
                 result.postInfo.title shouldBe validInput.title
                 result.postInfo.place shouldBe validInput.place
                 result.postInfo.reward shouldBe validInput.reward
+                result.postInfo.isOnCampus shouldBe validInput.isOnCampus
             }
presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/ExperimentPostDetailResponse.kt (1)

8-10: AddressResponse의 isOnCampus JSON 키 고정: @field:JsonProperty("isOnCampus") 추가

직렬화 시 JavaBeans 규칙에 의해 'onCampus'로 변환될 수 있으니 해당 프로퍼티에 @field:JsonProperty("isOnCampus")를 명시하세요. 매퍼는 이미 값을 채우고 있습니다 — presentation/src/main/kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt (231–235, 288–292). 수정 위치: presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/ExperimentPostDetailResponse.kt (95–97).

application/src/main/kotlin/com/dobby/usecase/experiment/UpdateExperimentPostUseCase.kt (1)

36-36: 부분 업데이트 일관성: isOnCampus를 nullable로 두는 방안 제안

다른 필드가 대부분 nullable인데 isOnCampus만 non-null입니다. 부분 업데이트 패턴과 일관되게 Boolean?로 두는 것을 권장합니다(미지정 시 기존 값 유지).

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

도메인 updateisOnCampus: Boolean?를 받아 ?: this.isOnCampus로 처리하는 형태로 함께 정렬해 주세요(도메인 파일 제안 참고).

infrastructure/src/main/kotlin/com/dobby/persistence/entity/experiment/ExperimentPostEntity.kt (1)

73-75: DB null 허용 불일치: 컬럼을 not null로 명시

코틀린 속성이 Boolean(non-null)인데 JPA 컬럼에 nullable = false가 빠져 있습니다. 스키마/마이그레이션과 불일치할 수 있어 명시를 권장합니다.

-    @Column(name = "is_on_campus")
+    @Column(name = "is_on_campus", nullable = false)
     var isOnCampus: Boolean,

또한, 기존 데이터에 대한 DDL 마이그레이션(기본값 설정 및 NOT NULL 제약) 적용 여부도 확인해 주세요.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f5b102 and 8e8d0e7.

📒 Files selected for processing (21)
  • application/src/main/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCase.kt (4 hunks)
  • application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostDetailForUpdateUseCase.kt (2 hunks)
  • application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostDetailUseCase.kt (2 hunks)
  • application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCase.kt (2 hunks)
  • application/src/main/kotlin/com/dobby/usecase/experiment/UpdateExperimentPostUseCase.kt (3 hunks)
  • application/src/test/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCaseTest.kt (3 hunks)
  • application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostApplyMethodUseCaseTest.kt (1 hunks)
  • application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostDetailForUpdateUseCaseTest.kt (1 hunks)
  • application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostDetailUseCaseTest.kt (1 hunks)
  • application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCaseTest.kt (5 hunks)
  • application/src/test/kotlin/com/dobby/usecase/experiment/GetMyExperimentPostsUseCaseTest.kt (3 hunks)
  • application/src/test/kotlin/com/dobby/usecase/experiment/UpdateExperimentPostRecruitStatusUseCaseTest.kt (2 hunks)
  • application/src/test/kotlin/com/dobby/usecase/member/email/GetMatchingExperimentPostsUseCaseTest.kt (1 hunks)
  • application/src/test/kotlin/com/dobby/usecase/member/email/SendMatchingEmailUseCaseTest.kt (2 hunks)
  • domain/src/main/kotlin/com/dobby/model/experiment/ExperimentPost.kt (3 hunks)
  • infrastructure/src/main/kotlin/com/dobby/persistence/entity/experiment/ExperimentPostEntity.kt (3 hunks)
  • presentation/src/main/kotlin/com/dobby/api/dto/request/experiment/CreateExperimentPostRequest.kt (1 hunks)
  • presentation/src/main/kotlin/com/dobby/api/dto/request/experiment/UpdateExperimentPostRequest.kt (1 hunks)
  • presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/ExperimentPostDetailResponse.kt (1 hunks)
  • presentation/src/main/kotlin/com/dobby/api/dto/response/experiment/PostInfo.kt (1 hunks)
  • presentation/src/main/kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt (7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (12)
application/src/test/kotlin/com/dobby/usecase/experiment/GetExperimentPostApplyMethodUseCaseTest.kt (1)

55-55: isOnCampus 픽스처 반영 LGTM

테스트 데이터에 새 필드 반영 잘 됐습니다.

application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostDetailUseCase.kt (2)

62-67: Address에 isOnCampus 추가 OK. 응답 스키마/문서 동기화 확인 필요

  • 프레젠테이션 계층(예: ExperimentPostDetailResponse.AddressResponse)과 API 문서가 동일하게 갱신됐는지 확인 부탁드립니다.
  • Boolean 비널러블로 공개되므로, DB 마이그레이션/기본값(backfill) 상태가 일관적인지 점검이 필요합니다.

124-124: 도메인→응답 매핑 누락 없이 반영됨

isOnCampus 매핑 적절합니다.

application/src/test/kotlin/com/dobby/usecase/member/email/SendMatchingEmailUseCaseTest.kt (1)

99-100: isOnCampus 필드 반영 LGTM

테스트 초기화에 새 필드가 일관되게 반영되었습니다.

Also applies to: 168-169

application/src/test/kotlin/com/dobby/usecase/experiment/UpdateExperimentPostRecruitStatusUseCaseTest.kt (1)

57-57: isOnCampus 필드 반영 LGTM

유스케이스 동작과 무관한 필드지만, 데이터 일관성 유지에 적절히 반영됐습니다.

Also applies to: 114-114

application/src/main/kotlin/com/dobby/usecase/experiment/CreateExperimentPostUseCase.kt (2)

107-127: 생성 플로우 내 isOnCampus 전달 매핑 적절함

도메인 팩토리로의 전달과 저장 후 응답 매핑 모두 일관됩니다. LGTM.


140-147: 엔티티 매핑 확인됨 — 마이그레이션 존재 여부 확인 필요

  • infrastructure/src/main/kotlin/com/dobby/persistence/entity/experiment/ExperimentPostEntity.kt 에 @column(name = "is_on_campus") var isOnCampus: Boolean 로 매핑되어 있음.
  • DB 마이그레이션(V*.sql 또는 Liquibase changelog 등)에서 is_on_campus 컬럼을 추가하는 변경은 검색되지 않음 — DB 스키마에 컬럼이 반영됐는지 또는 마이그레이션 파일이 PR에 포함됐는지 확인하고, 누락 시 마이그레이션 추가.
application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostsUseCase.kt (1)

80-87: 목록 응답 isOnCampus 매핑 확인 — 문제 없음

presentation/src/main/kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt에서 request/input/response 변환에 isOnCampus가 일관되게 매핑되는 것이 확인되었습니다. LGTM.

infrastructure/src/main/kotlin/com/dobby/persistence/entity/experiment/ExperimentPostEntity.kt (1)

144-145: toDomain/fromDomain 매핑 반영 OK

도메인-엔티티 간 isOnCampus 매핑이 일관되게 반영되었습니다.

Also applies to: 173-174

application/src/main/kotlin/com/dobby/usecase/experiment/GetExperimentPostDetailForUpdateUseCase.kt (1)

62-67: 수정 화면용 Address에 isOnCampus 추가 및 매핑 반영 OK

조회 DTO와 변환 함수 모두 isOnCampus를 일관되게 노출합니다.

Also applies to: 124-129

domain/src/main/kotlin/com/dobby/model/experiment/ExperimentPost.kt (1)

170-171: 생성 경로(newExperimentPost)의 isOnCampus 포함 OK

생성 시그니처/생성자에 정상 반영되었습니다.

presentation/src/main/kotlin/com/dobby/api/mapper/ExperimentPostMapper.kt (1)

56-56: isOnCampus 매핑 전 경로 반영 OK

  • Create/Update 입력 매핑
  • Create/Update/List/Detail 응답 매핑
    모두 일관성 있게 전달/노출됩니다.

업데이트 입력을 Boolean?로 전환하는 경우(제안 반영 시), 요청 DTO와 매퍼도 함께 정렬되었는지 확인 부탁드립니다.

Also applies to: 105-106, 147-147, 162-162, 233-233, 290-290, 406-406

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 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.

chock-cho added a commit that referenced this pull request Oct 21, 2025
* feat: add isOnCampus field to create new experiment posts

* feat: add isOnCampus field in ExperimentPostEntity

* feat: add isOnCampus value on presentation layer

* fix: fix failed test cases

* feat: revise isOnCampus field nullable to non-nullable

* feature: add isOnCampus field in updateExperimentPost

* feature: add isOnCampus field in GET /{postId}/edit

* feature: add isOnCampus in AddressResponse
chock-cho added a commit that referenced this pull request Oct 21, 2025
* feat: add isOnCampus field to create new experiment posts

* feat: add isOnCampus field in ExperimentPostEntity

* feat: add isOnCampus value on presentation layer

* fix: fix failed test cases

* feat: revise isOnCampus field nullable to non-nullable

* feature: add isOnCampus field in updateExperimentPost

* feature: add isOnCampus field in GET /{postId}/edit

* feature: add isOnCampus in AddressResponse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ FEATURE 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants