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

fix: SchedulePlace 중간 테이블 생성 #167

Closed
wants to merge 2 commits into from

Conversation

thguss
Copy link
Member

@thguss thguss commented Aug 22, 2024

이슈

closed #166

변경 사항

  • 중간 테이블을 생성했습니다.
  • 중간 테이블을 활용하여 특정 place에 다중 scheduleId가 추가 가능하도록 했습니다.
  • Place:Schedule은 N:M 관계를 맺습니다.

스크린샷

부연 설명

체크리스트

  • Lint 적용 여부
  • 빌드 성공 여부
  • PR 제목은 포맷과 내용 둘 다 알맞게 작성되었는가
  • PR에 대해 구체적으로 설명이 되어있는가

@thguss
Copy link
Member Author

thguss commented Aug 22, 2024

출격준비

Copy link

✅ 빌드 성공 ✅
🚀 출격 준비 완료 👨🏻‍🚀

Copy link
Member

@KimDoubleB KimDoubleB left a comment

Choose a reason for hiding this comment

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

아직 다 보지 못했지만, 중간 점검 차...!

  • Schedule과 Place 매핑 테이블이여서 SchedulePlace로 정한 것 같은데... 이게 코드 상으로 쉽게 이해가 되지 않네요. 더 적합한 이름은 없을까요? 특정 스케줄의 장소 느낌...으로?
  • Place list가 필요한 곳에 SchedulePlace list가 포함된 곳들이 좀 보이는데요. 서비스 로직을 다 이해한 것은 아니지만, Place 정보만을 필요한 곳이라면 SchedulePlace 정보를 가지지 않고, Place list로 바꿔 이용하면 더 코드가 이해하기 좋을 것 같아요 (단순 생각이여서 틀린 말일수도...) 특히 SchedulePlaceId는 쉽사리 이해가 되지 않는 것 같아요 (매핑 테이블의 id이다보니 어떻게 활용하는지 쉽게 잘 이해가 안된다서 적어봅니다 )

새벽 리뷰라... 정확하지 않을 수 있는데... 아무튼... 한번 봐주시면 감사 감사 왕감사

Comment on lines 113 to 123
private fun mapPlacesBySchedule(
schedules: List<Schedule>,
places: List<Place>,
): Map<Schedule, List<Place>> {
val placesByScheduleId = places.groupBy { it.scheduleId }
schedulePlaces: List<SchedulePlace>,
): Map<Schedule, List<SchedulePlace>> {
val schedulePlaceByScheduleId = schedulePlaces.groupBy { it.scheduleId }

return schedules.associateWith { schedule ->
placesByScheduleId[schedule.id]
schedulePlaceByScheduleId[schedule.id]
?: throw PiikiiException(
exceptionCode = ExceptionCode.ILLEGAL_ARGUMENT_EXCEPTION,
detailMessage = "$EMPTY_CONFIRMED_PLACE Schedule ID: ${schedule.id}",
Copy link
Member

Choose a reason for hiding this comment

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

이 메서드는 schedule 당 place를 가지는거니깐
SchedulePlace가 아닌 List를 가지는게 더 말이 되지 않나요?

@thguss
Copy link
Member Author

thguss commented Aug 25, 2024

현상유지로 논의되어 해당 PR close

@thguss thguss closed this Aug 25, 2024
@K-Diger K-Diger deleted the fix/#166-schedule-place-entity branch September 21, 2024 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 버그 해결에 관한 이슈/PR입니다. module-domain module-output-storage-services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: 다중 Schedule 삭제 이상 이슈 대응
2 participants