Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a place registration API that allows users to apply for new spots to be added to the system. The implementation includes data models for spot applications and their options, along with validation and status tracking.
- Adds entities and repositories for applying spots with options
- Implements the spot application service and controller endpoint
- Updates enums to support new price values and application status
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ApplySpotEntity.java | New entity for storing spot application data with status tracking |
| ApplySpotOptionEntity.java | Junction entity linking spot applications to their selected options |
| ApplySpotRequest.java | Request DTO with validation for spot application data |
| SpotService.java | Implements spot application logic with option validation |
| SpotController.java | Adds POST endpoint for spot applications |
| Various repositories | New repositories for spot application data access |
| Enum updates | Adds new status enum and updates existing price/feature enums |
| @Valid List<Feature> featureList, | ||
|
|
||
| @NotBlank(message = "recommendedMenu는 공백일 수 없습니다.") | ||
| @Size(min = 1, max = 30, message = "recommendedMenu는 1자 이상 30자 이하이어야 합니다.") |
There was a problem hiding this comment.
The @SiZe validation constraint for recommendedMenu allows up to 30 characters, but the corresponding database column in ApplySpotEntity is defined with length = 50. This inconsistency could cause confusion - either update the validation to max = 50 or update the entity column length to 30.
| @Size(min = 1, max = 30, message = "recommendedMenu는 1자 이상 30자 이하이어야 합니다.") | |
| @Size(min = 1, max = 50, message = "recommendedMenu는 1자 이상 50자 이하이어야 합니다.") |
|
|
||
| public record ApplySpotRequest( | ||
| @NotBlank(message = "spotName은 공백일 수 없습니다.") | ||
| @Size(min = 1, max = 20, message = "spotName은 1자 이상 20자 이하이어야 합니다.") |
There was a problem hiding this comment.
The @SiZe validation constraint for spotName allows up to 20 characters, but the corresponding database column in ApplySpotEntity is defined with length = 30. This inconsistency could cause confusion - either update the validation to max = 30 or update the entity column length to 20.
| @Size(min = 1, max = 20, message = "spotName은 1자 이상 20자 이하이어야 합니다.") | |
| @Size(min = 1, max = 30, message = "spotName은 1자 이상 30자 이하이어야 합니다.") |
|
|
||
| applySpotOptionEntityList.add( | ||
| ApplySpotOptionEntity.builder() | ||
| .applySpotId(applySpotEntity.getId()) |
There was a problem hiding this comment.
Using applySpotEntity.getId() before the entity is persisted will return null, as the ID is generated only after saving to the database. Move the option processing logic after the applySpotRepository.save(applySpotEntity) call and retrieve the ID from the saved entity.
| .applySpotId(applySpotEntity.getId()) | |
| .applySpotId(savedApplySpotEntity.getId()) |
💡 Issue
📄 Description