Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a data consistency issue by ensuring only ACTIVE status spots are returned from various spot-related APIs. This prevents users from accessing spots that may be inactive or deleted.
- Updated repository methods to filter by SpotStatus.ACTIVE
- Added status validation in service layer methods
- Modified native queries to include spot_status conditions
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| SpotRepository.java | Updated query methods and native SQL to filter by ACTIVE status |
| SpotNativeQueryRepository.java | Added ACTIVE status filter to spot list queries |
| SpotService.java | Added status validation and updated search methods to use ACTIVE filter |
| GuidedSpotCustomRepository.java | Added ACTIVE status condition to guided spot suggestions query |
| MemberService.java | Added ACTIVE status check when mapping saved spots |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @Param("keyword") String keyword, | ||
| @Param("limit") int limit | ||
| @Param("limit") int limit, | ||
| @Param("spotStatus") String spotStatus |
There was a problem hiding this comment.
The parameter type should be SpotStatus enum instead of String to maintain type safety and consistency with other methods in the same class.
| @Param("spotStatus") String spotStatus | |
| @Param("spotStatus") SpotStatus spotStatus |
| AND spot_status = :spotStatus | ||
| LIMIT :limit | ||
| """, nativeQuery = true) | ||
| List<SpotEntity> findByNameContainingWithLimitIgnoreCase( | ||
| @Param("keyword") String keyword, | ||
| @Param("limit") int limit | ||
| @Param("limit") int limit, | ||
| @Param("spotStatus") String spotStatus |
There was a problem hiding this comment.
The native query expects a String parameter but SpotStatus enum will be passed. Either change the parameter type to String or use spotStatus.name() when calling this method.
💡 Issue
📄 Description