fix: 맛집 중복 체크 및 카테고리 필터 로직 개선

1. placeId 기반 중복 체크 제거
   - 이전 대화에서 명확히 한 대로 placeId는 매칭에 사용하지 않음

2. 주소 기반 매칭 개선
   - 주소가 있을 때만 주소 기반 중복 체크 수행

3. 위치 기반 매칭 추가
   - 50m 이내 동일한 이름의 맛집 중복 체크 추가

4. 검색 결과 선택 로직 개선
   - 주소가 없을 때 가장 가까운 거리의 업체 선택

5. 카테고리 필터 버그 수정
   - 카테고리 표시명과 실제 값 불일치 문제 해결
   - 부분 일치 및 정규화된 비교 지원

6. 빈 상태 메시지 개선
   - 필터링 중일 때 적절한 안내 메시지 표시
   - 필터 초기화 버튼 추가

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
JiWoong Sul
2025-07-30 19:27:04 +09:00
parent 85fde36157
commit 9a61e2f391
4 changed files with 126 additions and 24 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:lunchpick/core/utils/category_mapper.dart';
import 'package:lunchpick/domain/entities/restaurant.dart';
import 'package:lunchpick/domain/repositories/restaurant_repository.dart';
import 'package:lunchpick/presentation/providers/di_providers.dart';
@@ -207,7 +208,13 @@ final filteredRestaurantsProvider = StreamProvider<List<Restaurant>>((ref) async
// 카테고리 필터 적용
if (selectedCategory != null) {
filtered = filtered.where((restaurant) {
return restaurant.category == selectedCategory;
// 정확한 일치 또는 부분 일치 확인
// restaurant.category가 "음식점>한식>백반/한정식" 형태일 때
// selectedCategory가 "백반/한정식"이면 매칭
return restaurant.category == selectedCategory ||
restaurant.category.contains(selectedCategory) ||
CategoryMapper.normalizeNaverCategory(restaurant.category, restaurant.subCategory) == selectedCategory ||
CategoryMapper.getDisplayName(restaurant.category) == selectedCategory;
}).toList();
}