Skip to content

Conversation

@gustj3104
Copy link
Contributor

@gustj3104 gustj3104 commented Dec 21, 2025

📄 작업 내용

장소 도메인과 생성, 수정 기능을 구현했습니다.
Package마다 하나의 장소만 존재하도록 unique 제약, 1:1 관계로 생성되도록 구현했고, Package와 생애주기가 동일하므로 같은 애그리거트로 추가했습니다.

위도, 경도, kakaoPlaceId, 주소(도로명 주소 및 지번 주소)

  • 카카오맵에 없는 장소는 저장하지 않도록 kakaoPlaceId도 non-null로 설정했습니다
  • 도로명 주소 또는 지번 주소 하나 이상 존재하도록 제약해두었습니다. 기획에 따라서 수정이 필요할 수 있을 것 같습니다!
  • 패키지에 따라 장소가 존재하지 않거나, Location을 추후에 등록하게 될 여지가 있을 것 같아 Package 내 Location은 nullable로 설정했습니다.

Location 생성, 수정 기능

  • Package 기준으로 Location이 존재하면 교체, 없으면 생성되도록 구현했습니다.
  • 교체 시 Package, Id(PK)는 유지하면서 위치 관련 필드만 수정되도록 했습니다.
  • 교체, 생성의 비즈니스 로직 차이가 없어서 upsert 하나로 통합했습니다.

🙋🏻 이슈 / 궁금증 / 추가사항

저번 디렉터리 구조 변경할 때 gradle의 프로젝트명 변경이 이루어지지 않은 파일이 있어서 같이 수정했는데, PR 범위가 섞여 죄송합니다..

close #8

@gustj3104 gustj3104 requested a review from sosow0212 December 21, 2025 08:15
@gustj3104 gustj3104 self-assigned this Dec 21, 2025
@gustj3104 gustj3104 added the feat 기능 추가 label Dec 21, 2025
@gustj3104 gustj3104 linked an issue Dec 21, 2025 that may be closed by this pull request
Copy link
Contributor

@sosow0212 sosow0212 left a comment

Choose a reason for hiding this comment

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

의존 관련해서 한 가지 확인만 부탁드릴게요~ 수고하셨습니다!

Comment on lines 27 to 31
@Column(name = "road_address_name")
val roadAddressName: String?,

@Column(name = "address_name")
val addressName: String?,
Copy link
Contributor

Choose a reason for hiding this comment

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

혹시 이거 두 개는 뭘 의미하는 컬럼일까요?

Copy link
Contributor

Choose a reason for hiding this comment

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

아아 도로명주소랑 지명주소군요!

private val packageLocationRepository: PackageLocationRepository,
) {

fun upsertPackageLocation(command: CreateLocationCommand): PackageLocation {
Copy link
Contributor

Choose a reason for hiding this comment

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

패키지가 추가될 때 장소가 추가될 것 같은데, 그러면 Package.of(..., + Location)으로 생성한 후 packageRepository.save()로 같이 저장하는 건 어떨까요?

의도적 분리라면, PackageService에서 ApplicationEventPublisher.publish(PackageCreatedEvent)를 통해서 끊어주는 것도 괜찮을 것 같습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Location이 존재하지 않는 경우가 실제로 존재하는지 문의드려보고 없는 경우 package save 시에 함께 저장하는 방향으로,
있다면 ApplicationEventPublisher.publish(PackageCreatedEvent)로 수정해보겠습니다!

@sosow0212
Copy link
Contributor

추가적으로 현재 Product에도 임시로 location을 String 타입으로 선언해둔 상태인데 이건 이제 필요 없을까요? 해당 부분도 확인 부탁드릴게요~

@gustj3104
Copy link
Contributor Author

gustj3104 commented Dec 22, 2025

설계할 때 여쭤봤을 때 패키지의 장소가 product의 장소 중 하나가 되는 건 아니고, 패키지 자체가 하나의 장소를 가진다고 설명해주셔서 product의 location은 그대로 유지했습니다!

@gustj3104
Copy link
Contributor Author

장소 도메인 수정하여 커밋했습니다!
패키지 API 쪽 디렉터리 변경을 머지하고 작업해서 커밋 로그가 지저분해져 확인하시기 어려우실 수 있을 것 같아요 죄송합니다.
실제 수정 범위는 packageLocation(application, domain, dto)와 packageEventListener, packageCreateEvent, packageCommandService 쪽입니다.
패키지 생성 시에 Location을 request로 받는 부분은 패키지 API가 머지된 이후에 다른 PR에서 이어서 작업하겠습니다!

@gustj3104 gustj3104 merged commit c0633bf into develop Dec 31, 2025
1 check passed
@gustj3104 gustj3104 deleted the feat/8 branch December 31, 2025 10:34
gustj3104 added a commit that referenced this pull request Dec 31, 2025
* feat: 장소 도메인 설계

* feat: 장소 생성, 수정 기능 구현

* fix: Jpa 필드명 수정

* fix: 디렉터리명 수정

* feat: 테스트 코드 구현

* feat: pkg 디렉토리로 감싸도록 수정 및 API 구현

* refactor: 패키지 조회 무한 스크롤 방식으로 수정

* feat: 상품 이미지 추가 구현

* refactor: 스웨거 설명 변경

* feat: 패키지 이벤트 추가

* fix: replace -> update로 수정

* fix: location test 메서드명 수정

* refactor: payload 구조로 변경

---------

Co-authored-by: sosow0212 <[email protected]>
gustj3104 added a commit that referenced this pull request Jan 7, 2026
* feat: 회원 설문 도메인, API 구현

* 패키지, 상품 API 구현 (#27)

* feat: pkg 디렉토리로 감싸도록 수정 및 API 구현

* refactor: 패키지 조회 무한 스크롤 방식으로 수정

* feat: 상품 이미지 추가 구현

* refactor: 스웨거 설명 변경

* refactor: 반환자 변경

* feat: 장소 도메인 및 기능 설계 (#24)

* feat: 장소 도메인 설계

* feat: 장소 생성, 수정 기능 구현

* fix: Jpa 필드명 수정

* fix: 디렉터리명 수정

* feat: 테스트 코드 구현

* feat: pkg 디렉토리로 감싸도록 수정 및 API 구현

* refactor: 패키지 조회 무한 스크롤 방식으로 수정

* feat: 상품 이미지 추가 구현

* refactor: 스웨거 설명 변경

* feat: 패키지 이벤트 추가

* fix: replace -> update로 수정

* fix: location test 메서드명 수정

* refactor: payload 구조로 변경

---------

Co-authored-by: sosow0212 <[email protected]>

* fix: 여러 장소를 저장하도록 수정

* feat: 테스트 코드 추가

* feat: QueryService로 조회 로직 이전

* fix: 디렉터리 구조 수정

* fix: 옵션, 메서드명 수정

---------

Co-authored-by: Jaeyoon Lee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

장소 도메인 추가

3 participants