Skip to content

Conversation

@doup2001
Copy link
Member

@doup2001 doup2001 commented Dec 29, 2025

📌 작업한 내용

🔍 참고 사항

🖼️ 스크린샷

🔗 관련 이슈

✅ 체크리스트

  • 로컬에서 빌드 및 테스트 완료
  • 코드 리뷰 반영 완료
  • 문서화 필요 여부 확인

Summary by CodeRabbit

  • 새로운 기능

    • 도시별 지역 필터 및 개별 필터 조회용 엔드포인트(지역/비용/면적)를 추가했습니다.
  • 개선사항

    • 지역/주소 파싱 및 정상화 로직을 개선해 도시 기준 그룹화가 더 정확해졌습니다.
    • API 문서의 예제 값 및 스펙이 갱신되었습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

복합 필터 응답에 도시별 계층인 District 레코드를 추가하고, 주소 파싱·정규화 및 도시별 그룹화 로직을 도입해 필터를 구성하는 서비스 메서드와 개별 필터 조회용 API(지역/비용/면적)를 추가했습니다. Swagger 예제값도 갱신되었습니다.

Changes

Cohort / File(s) 변경 사항
DTO: 필터 응답 구조
src/main/java/com/pinHouse/server/platform/housing/notice/application/dto/ComplexFilterResponse.java
새 중첩 퍼블릭 레코드 District(String city, List<String> districts) 추가. DistrictFilter 관련 스키마/주석(예시) 수정.
필터 생성·정규화 로직
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java
buildFilterResponse(List<ComplexDocument>) 추가, calculateDistrictFilter 공개화 및 구현 변경(도시별 그룹화), calculateCostFilter·calculateAreaFilter 접근제어 공개화, 주소 파싱·정규화용 TempDistrictInfo 레코드와 parseAddress(), extractMetroCityName(), shortenProvinceName() 등 헬퍼 추가.
서비스: 개별 필터 조회 추가
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/NoticeService.java
getDistrictFilter(String noticeId), getCostFilter(String noticeId), getAreaFilter(String noticeId) 신규 공개 메서드 추가(공지 검증 → 단지 로드 → 해당 필터 계산 호출).
유스케이스 인터페이스 확장
src/main/java/com/pinHouse/server/platform/housing/notice/application/usecase/NoticeUseCase.java
getDistrictFilter, getCostFilter, getAreaFilter 시그니처 추가.
프레젠테이션: 컨트롤러 엔드포인트 추가
src/main/java/com/pinHouse/server/platform/housing/notice/presentation/NoticeApi.java
GET /{noticeId}/filter/districts, /{noticeId}/filter/cost, /{noticeId}/filter/area 엔드포인트 추가. 각 엔드포인트는 서비스의 해당 메서드를 호출하고 ApiResponse.ok로 반환.
API 문서 메타데이터 업데이트
src/main/java/com/pinHouse/server/platform/housing/notice/presentation/swagger/NoticeApiSpec.java
getComplexFiltersnoticeId 예제값을 18214에서 19347로 변경하고, getDistrictFilter, getCostFilter, getAreaFilter API 스펙(반환 타입·파라미터·예제) 추가.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant Controller as NoticeApi
  participant Service as NoticeService
  participant FilterService as ComplexFilterService
  participant Repo as ComplexRepository
  Note over Controller,Repo: 개별 필터 조회 흐름 (지역/비용/면적)

  Client->>Controller: GET /{noticeId}/filter/districts
  Controller->>Service: getDistrictFilter(noticeId)
  Service->>Repo: findComplexesByNoticeId(noticeId)
  Repo-->>Service: List<ComplexDocument>
  Service->>FilterService: calculateDistrictFilter(List<ComplexDocument>)
  FilterService->>FilterService: parseAddress / normalize / group by city / sort
  FilterService-->>Service: DistrictFilter
  Service-->>Controller: DistrictFilter
  Controller-->>Client: ApiResponse.ok(DistrictFilter)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐇 도시에 숨은 이름들을 모아,
주소를 정리해 하나로 묶었네.
동(洞)과 동네가 반짝 정렬되고,
필터는 깔끔히 빛을 발하네 ✨
토끼가 기쁘게 깡충깡충!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning PR 설명이 완전히 작성되지 않았습니다. 모든 섹션이 템플릿 형식만 남아있고 실제 내용이 없습니다. 작업한 내용, 참고 사항, 관련 이슈, 체크리스트를 작성하세요. 최소한 무엇이 변경되었는지 설명해주세요.
Title check ❓ Inconclusive 제목이 매우 모호하고 일반적이어서 구체적인 변경사항을 전달하지 못합니다. '필터 수정'은 무엇을 수정했는지, 어떤 필터를 다루는지 명확하지 않습니다. 제목을 구체적으로 변경하세요. 예: '필터 조회 API를 3개의 개별 엔드포인트로 분리' 또는 '지역/비용/면적 필터 API 분리'
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0547fbb and 01926df.

📒 Files selected for processing (1)
  • src/main/java/com/pinHouse/server/platform/housing/notice/presentation/swagger/NoticeApiSpec.java

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.

@github-actions
Copy link

github-actions bot commented Dec 29, 2025

Test Results

22 tests  ±0   22 ✅ ±0   0s ⏱️ ±0s
 3 suites ±0    0 💤 ±0 
 3 files   ±0    0 ❌ ±0 

Results for commit 01926df. ± Comparison against base commit 8e6195e.

♻️ This comment has been updated with latest results.

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: 1

🧹 Nitpick comments (2)
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java (2)

301-304: METRO_CITIES 상수를 클래스 레벨로 추출하는 것을 권장합니다.

현재 parseAddress 메서드 내부에 정의된 METRO_CITIES는 클래스 레벨 상수로 추출하면 재사용성과 가독성이 향상됩니다.

🔎 제안된 수정
 @Slf4j
 @Service
 @RequiredArgsConstructor
 public class ComplexFilterService {

     private final PinPointMongoRepository pinPointRepository;
+    
+    private static final Set<String> METRO_CITIES = Set.of(
+            "서울", "부산", "대구", "인천", "광주", "대전", "울산", "세종"
+    );

그리고 메서드 내부의 정의를 제거합니다.


254-264: 스트림 그룹화 로직 개선을 권장합니다.

현재 Collectors.collectingAndThen 내에서 toList() 후 다시 스트림으로 변환하여 distinct().sorted().toList()를 수행합니다. Collectors.toCollection(TreeSet::new)을 사용하면 자동으로 중복 제거와 정렬이 됩니다.

🔎 제안된 수정
 Map<String, List<String>> cityToDistricts = tempDistricts.stream()
         .collect(Collectors.groupingBy(
                 TempDistrictInfo::city,
                 Collectors.mapping(
                         TempDistrictInfo::district,
-                        Collectors.collectingAndThen(
-                                Collectors.toList(),
-                                list -> list.stream().distinct().sorted().toList()
-                        )
+                        Collectors.collectingAndThen(
+                                Collectors.toCollection(TreeSet::new),
+                                ArrayList::new
+                        )
                 )
         ));

TreeSet은 자동으로 중복 제거 및 자연 정렬을 수행합니다.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e6195e and fd0280e.

📒 Files selected for processing (3)
  • src/main/java/com/pinHouse/server/platform/housing/notice/application/dto/ComplexFilterResponse.java
  • src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java
  • src/main/java/com/pinHouse/server/platform/housing/notice/presentation/swagger/NoticeApiSpec.java
⏰ 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: test
🔇 Additional comments (3)
src/main/java/com/pinHouse/server/platform/housing/notice/presentation/swagger/NoticeApiSpec.java (1)

62-62: LGTM!

Swagger 예제 값 업데이트가 적절합니다. API 명세와 실제 데이터의 일관성을 유지하는 좋은 변경입니다.

src/main/java/com/pinHouse/server/platform/housing/notice/application/dto/ComplexFilterResponse.java (1)

30-46: LGTM!

District 레코드를 통한 city별 그룹화 구조가 잘 설계되었습니다. 불변 레코드 사용과 Swagger 문서화가 적절합니다.

src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java (1)

246-278: 지역 필터 계산 로직이 잘 구현되었습니다.

주소 파싱 → 임시 구조체 생성 → city별 그룹화 → 최종 응답 구성의 파이프라인이 명확하고, 한국 주소 체계(광역시/특별시, 도)에 대한 처리가 잘 반영되었습니다.

Comment on lines 395 to 415
private String shortenProvinceName(String province) {
if (province == null || province.isBlank()) {
return "";
}

// "도" 제거
if (province.endsWith("도")) {
String base = province.substring(0, province.length() - 1);

// "충청북", "충청남", "경상북", "경상남", "전라북", "전라남" → 첫글자 + 마지막글자
if (base.startsWith("충청") || base.startsWith("경상") || base.startsWith("전라")) {
// "충청북" → "충북", "경상남" → "경남"
return base.charAt(0) + String.valueOf(base.charAt(base.length() - 1));
}

// 그 외 도는 "도"만 제거 ("경기도" → "경기", "강원도" → "강원")
return base;
}

return province;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

제주특별자치도 처리가 누락되었습니다.

현재 로직에서 "제주특별자치도"endsWith("도")를 만족하여 "제주특별자치"로 잘못 축약됩니다. "제주"로 올바르게 변환되어야 합니다.

🔎 제안된 수정
 private String shortenProvinceName(String province) {
     if (province == null || province.isBlank()) {
         return "";
     }

+    // "특별자치도" 제거 (제주)
+    if (province.endsWith("특별자치도")) {
+        return province.substring(0, province.length() - 5);
+    }
+
     // "도" 제거
     if (province.endsWith("도")) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private String shortenProvinceName(String province) {
if (province == null || province.isBlank()) {
return "";
}
// "도" 제거
if (province.endsWith("도")) {
String base = province.substring(0, province.length() - 1);
// "충청북", "충청남", "경상북", "경상남", "전라북", "전라남" → 첫글자 + 마지막글자
if (base.startsWith("충청") || base.startsWith("경상") || base.startsWith("전라")) {
// "충청북" → "충북", "경상남" → "경남"
return base.charAt(0) + String.valueOf(base.charAt(base.length() - 1));
}
// 그 외 도는 "도"만 제거 ("경기도" → "경기", "강원도" → "강원")
return base;
}
return province;
}
private String shortenProvinceName(String province) {
if (province == null || province.isBlank()) {
return "";
}
// "특별자치도" 제거 (제주)
if (province.endsWith("특별자치도")) {
return province.substring(0, province.length() - 5);
}
// "도" 제거
if (province.endsWith("도")) {
String base = province.substring(0, province.length() - 1);
// "충청북", "충청남", "경상북", "경상남", "전라북", "전라남" → 첫글자 + 마지막글자
if (base.startsWith("충청") || base.startsWith("경상") || base.startsWith("전라")) {
// "충청북" → "충북", "경상남" → "경남"
return base.charAt(0) + String.valueOf(base.charAt(base.length() - 1));
}
// 그 외 도는 "도"만 제거 ("경기도" → "경기", "강원도" → "강원")
return base;
}
return province;
}
🤖 Prompt for AI Agents
In
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java
around lines 395 to 415, the shortening logic incorrectly transforms "제주특별자치도"
into "제주특별자치" — add a specific check before the generic endsWith("도") handling
to detect "제주특별자치" (or the full "제주특별자치도") and return "제주"; implement this by
trimming the trailing "도", then if the remaining base startsWith("제주특별자치")
return the fixed short form "제주", otherwise continue with the existing
special-case and default shortening logic.

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: 1

♻️ Duplicate comments (1)
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java (1)

350-370: 이전 리뷰에서 지적된 제주특별자치도 처리 문제가 해결되지 않았습니다.

현재 로직에서 "제주특별자치도"endsWith("도")를 먼저 만족하여 "제주특별자치"로 잘못 축약됩니다. "제주"로 올바르게 변환되어야 합니다.

🔎 제안된 수정
 private String shortenProvinceName(String province) {
     if (province == null || province.isBlank()) {
         return "";
     }

+    // "특별자치도" 제거 (제주)
+    if (province.endsWith("특별자치도")) {
+        return province.substring(0, province.length() - 5);
+    }
+
     // "도" 제거
     if (province.endsWith("도")) {
🧹 Nitpick comments (3)
src/main/java/com/pinHouse/server/platform/housing/notice/application/usecase/NoticeUseCase.java (1)

36-43: 주석의 명확성을 개선하세요.

Line 42의 주석에서 "방타입"이라는 용어가 사용되었으나, 실제로 AreaFiltertypeCode 기반의 면적 필터를 반환합니다. "방타입"은 일반적으로 방 개수(1룸, 2룸 등)를 의미하므로 오해의 소지가 있습니다.

🔎 주석 개선 제안
-    /// 공고의 단지 방타입 필터 정보 조회
+    /// 공고의 단지 면적(타입코드) 필터 정보 조회
     ComplexFilterResponse.AreaFilter getAreaFilter(String noticeId);
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/NoticeService.java (1)

182-225: 세 메서드의 중복 코드를 고려하세요.

getDistrictFilter, getCostFilter, getAreaFilter 메서드가 동일한 패턴을 따르고 있습니다 (공고 검증 → 단지 로드 → 필터 계산). 중복을 줄이기 위해 제네릭 헬퍼 메서드로 통합하는 것을 고려할 수 있습니다.

다만, 서비스 계층에서 명시적인 메서드 분리가 가독성 측면에서 선호될 수 있으므로 현재 구조도 합리적입니다.

💡 통합 리팩터링 예시
private <T> T getFilterByType(
    String noticeId,
    Function<List<ComplexDocument>, T> filterCalculator
) {
    // 공고 존재 확인
    loadNotice(noticeId);
    
    // 단지 목록 조회
    List<ComplexDocument> complexes = complexService.loadComplexes(noticeId);
    
    // 필터 계산
    return filterCalculator.apply(complexes);
}

@Override
@Transactional(readOnly = true)
public ComplexFilterResponse.DistrictFilter getDistrictFilter(String noticeId) {
    return getFilterByType(noticeId, complexFilterService::calculateDistrictFilter);
}
src/main/java/com/pinHouse/server/platform/housing/notice/presentation/NoticeApi.java (1)

114-124: 주석의 명확성을 개선하세요.

Line 114의 주석에서 "방타입"이라는 용어가 사용되었으나, 실제로는 면적(타입코드) 필터를 조회합니다. NoticeUseCase의 Line 42와 동일한 문제입니다.

🔎 주석 개선 제안
-    /// 공고의 단지 방타입 필터 정보 조회
+    /// 공고의 단지 면적(타입코드) 필터 정보 조회
     @GetMapping("/{noticeId}/filter/area")
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd0280e and 0547fbb.

📒 Files selected for processing (4)
  • src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java
  • src/main/java/com/pinHouse/server/platform/housing/notice/application/service/NoticeService.java
  • src/main/java/com/pinHouse/server/platform/housing/notice/application/usecase/NoticeUseCase.java
  • src/main/java/com/pinHouse/server/platform/housing/notice/presentation/NoticeApi.java
🔇 Additional comments (5)
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java (5)

186-196: LGTM!

필터 응답을 구성하는 통합 메서드가 명확하고 각 필터 계산을 적절히 위임하고 있습니다.


201-233: LGTM!

도시별 지역 그룹화 로직이 명확하며, 스트림을 효과적으로 사용하고 있습니다. 다만, parseAddress 메서드의 정확성에 의존하므로 해당 메서드의 철저한 테스트가 필요합니다.


316-342: LGTM!

광역시 및 특별시 이름 추출 로직이 다양한 접미사를 적절히 처리하고 있습니다.


375-409: LGTM!

가격 필터 계산 로직이 통계값(최소/최대/평균)과 분포를 올바르게 계산하고 있습니다.


463-476: LGTM!

면적 필터 계산이 고유한 타입 코드를 정확히 수집하고 정렬하고 있습니다.

Comment on lines +248 to 307
private TempDistrictInfo parseAddress(ComplexDocument complex) {
String county = complex.getCounty();
String city = complex.getCity();

if (county == null || county.isBlank()) {
return null;
}

try {
PinPoint pinPoint = pinPointRepository.findById(pinPointId)
.orElse(null);
// 광역시 및 특별시 목록
final Set<String> METRO_CITIES = Set.of(
"서울", "부산", "대구", "인천", "광주", "대전", "울산", "세종"
);

if (pinPoint != null) {
return pinPoint.getLocation();
// county를 공백으로 분리
String[] countyParts = county.trim().split("\\s+");

String finalCity;
String finalDistrict;

// 광역시/특별시 여부 확인
boolean isMetroCity = false;
String metroCityName = null;

if (countyParts.length >= 1) {
String cityName = countyParts[0];
// "광주광역시", "부산광역시", "서울특별시" 등에서 도시 이름 추출
String cityBase = extractMetroCityName(cityName);
if (cityBase != null && METRO_CITIES.contains(cityBase)) {
isMetroCity = true;
metroCityName = cityBase;
}
} catch (Exception e) {
log.error("Failed to fetch PinPoint: {}", pinPointId, e);
}

return null;
if (isMetroCity) {
// 광역시/특별시인 경우
finalCity = metroCityName;

if (countyParts.length >= 2) {
// "부산시 해운대구" 또는 "광주광역시 서구" → city: "부산", district: "해운대구"
finalDistrict = countyParts[1];
} else {
// "대구광역시"만 있는 경우 → city: "대구", district: "대구광역시" (원본 유지)
finalDistrict = county;
}
} else {
// 일반시인 경우
// city 필드가 광역시일 수도 있으므로 확인
String cityBase = extractMetroCityName(city);
if (cityBase != null && METRO_CITIES.contains(cityBase)) {
// city 필드가 "대구광역시"인 경우 → city: "대구"
finalCity = cityBase;
} else {
// city 필드가 도인 경우 → "경기도" → "경기"
finalCity = shortenProvinceName(city);
}
finalDistrict = county;
}

return new TempDistrictInfo(finalCity, finalDistrict);
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Find test files related to ComplexFilterService
fd -e java -path "*test*" | xargs rg -l "ComplexFilterService" | head -20

Repository: PinHouse/PinHouse_BE

Length of output: 450


🏁 Script executed:

# Check for parseAddress method and its test cases
rg -nA 20 "void test.*[Pp]arse[Aa]ddress|@Test.*\n.*parseAddress" --type=java

Repository: PinHouse/PinHouse_BE

Length of output: 255


🏁 Script executed:

# Find the helper methods: extractMetroCityName and shortenProvinceName
rg -nA 10 "extractMetroCityName|shortenProvinceName" --type=java src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java

Repository: PinHouse/PinHouse_BE

Length of output: 1870


🏁 Script executed:

# Look for sample address data or test data patterns
rg -nP "county|city" --type=java src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | grep -E "(county|city)\s*=" | head -30

Repository: PinHouse/PinHouse_BE

Length of output: 211


🏁 Script executed:

# Check how ComplexDocument is populated and what data it receives
fd -e java -type f | xargs rg -l "ComplexDocument" | head -10

Repository: PinHouse/PinHouse_BE

Length of output: 1244


🏁 Script executed:

# Search for test files more thoroughly
find . -type f -name "*Test.java" -o -name "*test*.java" 2>/dev/null | xargs rg -l "ComplexFilterService\|parseAddress" 2>/dev/null

Repository: PinHouse/PinHouse_BE

Length of output: 48


🏁 Script executed:

# Get the complete implementation of helper methods
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '309,380p'

Repository: PinHouse/PinHouse_BE

Length of output: 2606


🏁 Script executed:

# Check where ComplexDocument data comes from
rg -n "setCounty|setCity|county|city" --type java src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | head -20

Repository: PinHouse/PinHouse_BE

Length of output: 1296


🏁 Script executed:

# Look for test resources or sample data files
find . -type f \( -name "*.json" -o -name "*.xml" -o -name "*.properties" \) 2>/dev/null | xargs rg -l "county\|city\|광역시\|특별시" 2>/dev/null | head -10

Repository: PinHouse/PinHouse_BE

Length of output: 46


🏁 Script executed:

# Check the ComplexDocument class definition to understand county/city fields
rg -A 10 "class ComplexDocument|private.*county|private.*city" --type java src/main/java/com/pinHouse/server/platform/housing/notice/domain/model/ComplexDocument.java 2>/dev/null || find . -name "ComplexDocument.java" -type f | xargs cat -n | head -80

Repository: PinHouse/PinHouse_BE

Length of output: 2646


🏁 Script executed:

# Search for test cases related to parseAddress
find . -type f -name "*.java" | xargs grep -l "parseAddress" 2>/dev/null

Repository: PinHouse/PinHouse_BE

Length of output: 169


🏁 Script executed:

# Look for ComplexFilterService tests specifically
find . -type f -name "*ComplexFilterServiceTest*" -o -name "*Test.java" | xargs grep -l "parseAddress\|ComplexFilterService" 2>/dev/null | head -5

Repository: PinHouse/PinHouse_BE

Length of output: 46


🏁 Script executed:

# Check how city field can be null or what values it gets
rg -B5 -A5 "getCity\(\)|getCounty\(\)" src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java

Repository: PinHouse/PinHouse_BE

Length of output: 1111


🏁 Script executed:

# Check for 제주 (Jeju) handling - special autonomous province
rg -n "제주\|세종\|특별자치" src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java

Repository: PinHouse/PinHouse_BE

Length of output: 46


🏁 Script executed:

# Look at the test directories to understand project structure
find . -type d -name "test" -o -type d -name "tests" 2>/dev/null | head -5

Repository: PinHouse/PinHouse_BE

Length of output: 74


🏁 Script executed:

# Look for test files in the test directory
find ./src/test -type f -name "*.java" | xargs grep -l "ComplexFilterService\|parseAddress\|TempDistrictInfo" 2>/dev/null

Repository: PinHouse/PinHouse_BE

Length of output: 48


🏁 Script executed:

# Check the entire test directory structure
find ./src/test -type f -name "*.java" | head -20

Repository: PinHouse/PinHouse_BE

Length of output: 345


🏁 Script executed:

# Look for any integration or unit tests that might test address parsing
find ./src/test -type f -name "*.java" | xargs grep -l "address\|county\|city" 2>/dev/null | head -10

Repository: PinHouse/PinHouse_BE

Length of output: 46


🏁 Script executed:

# Check the full parseAddress method one more time and review the logic for edge cases
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '248,307p'

Repository: PinHouse/PinHouse_BE

Length of output: 2457


🏁 Script executed:

# Check if 제주 (Jeju) is handled in the helper methods
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '316,370p'

Repository: PinHouse/PinHouse_BE

Length of output: 1982


🏁 Script executed:

# Check if there's any documentation about expected city/county formats
find . -type f \( -name "README*" -o -name "*.md" \) | xargs grep -i "city\|county\|address" 2>/dev/null | head -20

Repository: PinHouse/PinHouse_BE

Length of output: 98


🏁 Script executed:

# Check the Address class to understand the data structure better
find . -type f -name "Address.java" | xargs cat -n 2>/dev/null | head -50

Repository: PinHouse/PinHouse_BE

Length of output: 773


🏁 Script executed:

# Verify how parseAddress is called and what happens with null return
rg -B3 -A5 "parseAddress\(" src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java

Repository: PinHouse/PinHouse_BE

Length of output: 470


🏁 Script executed:

# Check Korean administrative divisions to verify if 제주특별자치도 is handled
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '350,370p'

Repository: PinHouse/PinHouse_BE

Length of output: 921


🏁 Script executed:

# Check if there are any data files or queries that show what city/county values actually look like
find . -type f \( -name "*.json" -o -name "*.yaml" -o -name "*.yml" \) | xargs grep -i "특별자치\|제주\|세종" 2>/dev/null | head -20

Repository: PinHouse/PinHouse_BE

Length of output: 46


🏁 Script executed:

# Verify the exact behavior when shortenProvinceName receives "제주특별자치도"
cat > /tmp/test_jeju.java << 'EOF'
public class TestJeju {
    public static void main(String[] args) {
        String jeju = "제주특별자치도";
        if (jeju.endsWith("도")) {
            String base = jeju.substring(0, jeju.length() - 1);
            System.out.println("Base after removing '도': [" + base + "]");
            System.out.println("Expected: [제주]");
            System.out.println("Actual result: [" + base + "]");
        }
    }
}
EOF
javac /tmp/test_jeju.java 2>&1 || echo "Java not available"

Repository: PinHouse/PinHouse_BE

Length of output: 127


🏁 Script executed:

# Check if there's any special handling needed for Jeju in the codebase
rg -n "제주\|Jeju\|jeju" src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java

Repository: PinHouse/PinHouse_BE

Length of output: 46


🏁 Script executed:

# Verify what happens with null city field in the parseAddress method more carefully
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '292,304p'

Repository: PinHouse/PinHouse_BE

Length of output: 639


shortenProvinceName 메서드에서 제주특별자치도 처리 누락

shortenProvinceName은 "도" 문자만 제거하기 때문에, city = "제주특별자치도"인 경우 "제주특별자치"를 반환하게 됩니다 (올바른 값: "제주"). extractMetroCityName에서 "특별자치시"를 처리하는 것과 유사하게, shortenProvinceName도 "특별자치도" 접미사를 처리해야 합니다.

🤖 Prompt for AI Agents
In
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java
around lines 248 to 307, the shortenProvinceName method currently only strips a
trailing "도" so "제주특별자치도" becomes "제주특별자치" — update shortenProvinceName to
detect and strip the full "특별자치도" suffix (returning "제주") as well as existing
cases (e.g., remove "도", "도시" variants if needed), preserving behavior for other
inputs; implement the check/order so longer suffixes are removed first (e.g., if
endsWith("특별자치도") remove that, else if endsWith("도") remove that) and ensure
null/blank safety.

@doup2001 doup2001 merged commit c8a6901 into develop Dec 29, 2025
2 of 3 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.

2 participants