Skip to content

[Feature] implement category field and prioritize subway results in Landmark search#97

Merged
LeeHanEum merged 2 commits intodevelopfrom
feat/flowerspot-search-subway
Feb 7, 2026
Merged

[Feature] implement category field and prioritize subway results in Landmark search#97
LeeHanEum merged 2 commits intodevelopfrom
feat/flowerspot-search-subway

Conversation

@LeeHanEum
Copy link
Collaborator

@LeeHanEum LeeHanEum commented Feb 7, 2026

🌱 관련 이슈

📌 작업 내용 및 특이 사항

  • Landmark에 category 필드 추가
  • Kakao place search api 의 GroupCode와 LandmarkCategory 매핑
  • 랜드마크 검색 시 지하철 우선순위 높임

📝 참고

  • 정렬 조건은 facade 레이어에서 static하게 관리함

📌 체크 리스트

  • 리뷰어를 추가하셨나요 ?
  • 변경사항에 대해 충분히 설명하고 있나요 ?

Summary by CodeRabbit

  • New Features
    • Landmarks now include category information to identify location types (subway, restaurant, cafe, tour spot).
    • Automatic category detection and assignment for landmarks retrieved from map data.
    • Enhanced landmark search results with intelligent priority-based sorting to surface the most relevant locations.

@LeeHanEum LeeHanEum requested a review from char-yb February 7, 2026 09:35
@LeeHanEum LeeHanEum self-assigned this Feb 7, 2026
@LeeHanEum LeeHanEum linked an issue Feb 7, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

📝 Walkthrough

Walkthrough

This PR introduces landmark category support throughout the application stack. A new LandmarkCategory enum is added with values SUBWAY, RESTAURANT, CAFE, and TOUR_SPOT. The Kakao map client now extracts category information from API responses via a mapping helper and includes it in domain objects. PlaceFacade implements priority-based sorting to prioritize subway landmarks during administrative region searches.

Changes

Cohort / File(s) Summary
Domain Models
pida-core/core-domain/src/main/kotlin/com/pida/place/Landmark.kt, NewLandmark.kt
Added optional category: LandmarkCategory? field to both data classes; NewLandmark.toLandmark() propagates category to Landmark.
Landmark Category Definition
pida-core/core-domain/src/main/kotlin/com/pida/place/LandmarkCategory.kt
New public enum defining categories: SUBWAY, RESTAURANT, CAFE, TOUR_SPOT.
Kakao Integration
pida-clients/map-client/src/main/kotlin/com/pida/client/map/KakaoCategoryCode.kt, KakaoMapClient.kt
KakaoCategoryCode maps Kakao API codes to LandmarkCategory; extension function provides lookup. KakaoMapClient now populates category field when creating NewLandmark objects.
Landmark Selection Logic
pida-core/core-domain/src/main/kotlin/com/pida/place/PlaceFacade.kt
Added LANDMARK_CATEGORY_PRIORITY map prioritizing SUBWAY; landmarks are now sorted by priority before limiting results to MAX_LANDMARK_SEARCH_COUNT.
Database Layer
pida-storage/db-core/src/main/kotlin/com/pida/storage/db/core/landmark/LandmarkEntity.kt, LandmarkCoreRepository.kt
LandmarkEntity gains JPA-mapped category field with EnumType.STRING; repository and toLandmark() mapping updated to handle category propagation.

Sequence Diagram(s)

sequenceDiagram
    participant KakaoAPI as Kakao Map API
    participant Client as KakaoMapClient
    participant Code as KakaoCategoryCode
    participant Repo as LandmarkRepository
    participant Facade as PlaceFacade
    
    KakaoAPI->>Client: Return KakaoPlaceDocument<br/>with categoryGroupCode
    Client->>Code: toLandmarkCategory()
    Code->>Code: CODE_MAP lookup
    Code-->>Client: LandmarkCategory
    Client->>Repo: Save NewLandmark<br/>with category
    Repo->>Repo: Store in LandmarkEntity
    Facade->>Repo: Query landmarks<br/>in region
    Repo-->>Facade: List of Landmark<br/>with categories
    Facade->>Facade: Sort by<br/>LANDMARK_CATEGORY_PRIORITY
    Facade->>Facade: Limit to<br/>MAX_LANDMARK_SEARCH_COUNT
    Facade-->>Facade: Prioritized results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A subway-loving hop through the code,
Categories mapped on the Kakao road,
Priority sorting puts transit first,
Where metro dreams quench thirsty search bursts! 🚇

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main changes: adding a category field to Landmark and implementing priority sorting for subway results in landmark searches.
Linked Issues check ✅ Passed The PR implements the core requirement from issue #89 to prioritize subway results in landmark searches by adding category field mapping and priority-based sorting logic.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the category field and subway prioritization feature; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/flowerspot-search-subway

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.

@LeeHanEum LeeHanEum merged commit 1b9acc4 into develop Feb 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ 지하철 우선 검색

1 participant