Refactor/#143 modify changerequest api#144
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the change request API to support single-field change requests instead of the previous modification approach. The change introduces a more granular approach to handling individual field modifications.
- Replaces the existing
ModifyRequestDTOwith a newSingleChangeRequestDTOfor handling single field changes - Adds a new endpoint to retrieve only approved (FULFILLED) requests for users
- Introduces a new
PORTchange type to the existing enum
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| RequestQueryService.java | Adds method to fetch approved requests by user ID |
| RequestCommandService.java | Replaces modification request logic with single change request handling |
| ChangeType.java | Adds PORT enum value and reorders existing values |
| SingleChangeRequestDTO.java | New DTO class for handling single field change requests with validation |
| RequestApi.java | Adds API documentation for new approved requests endpoint |
| RequestController.java | Updates controller to use new single change request DTO and adds approved requests endpoint |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/main/java/DGU_AI_LAB/admin_be/domain/requests/dto/request/SingleChangeRequestDTO.java
Show resolved
Hide resolved
| } | ||
| } | ||
| case PORT -> { | ||
| ObjectMapper mapper = new ObjectMapper(); |
There was a problem hiding this comment.
Creating new ObjectMapper instances in validation methods is inefficient. Consider injecting the existing ObjectMapper instance or creating a static final instance to reuse.
| } | ||
| } | ||
| case EXPIRES_AT -> { | ||
| LocalDateTime.parse(newValue.trim()); |
There was a problem hiding this comment.
Using LocalDateTime.parse() without specifying a DateTimeFormatter may cause parsing failures if the input format doesn't match ISO-8601. Consider using a specific formatter or documenting the expected format.
|
|
||
| import DGU_AI_LAB.admin_be.domain.requests.controller.docs.RequestApi; | ||
| import DGU_AI_LAB.admin_be.domain.requests.dto.request.ModifyRequestDTO; | ||
| import DGU_AI_LAB.admin_be.domain.requests.dto.request.SingleChangeRequestDTO; |
There was a problem hiding this comment.
The removed import for ModifyRequestDTO suggests this class may no longer be used. Verify that ModifyRequestDTO can be safely removed from the codebase to avoid dead code.
🌱 관련 이슈