Skip to content

Comments

Refactor/#143 modify changerequest api#144

Merged
saokiritoni merged 3 commits intodevelopfrom
refactor/#143-modify-changerequest-api
Sep 23, 2025
Merged

Refactor/#143 modify changerequest api#144
saokiritoni merged 3 commits intodevelopfrom
refactor/#143-modify-changerequest-api

Conversation

@kwdahun
Copy link
Contributor

@kwdahun kwdahun commented Sep 17, 2025

@kwdahun kwdahun self-assigned this Sep 17, 2025
@kwdahun kwdahun requested a review from a team as a code owner September 17, 2025 14:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ModifyRequestDTO with a new SingleChangeRequestDTO for handling single field changes
  • Adds a new endpoint to retrieve only approved (FULFILLED) requests for users
  • Introduces a new PORT change 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.

}
}
case PORT -> {
ObjectMapper mapper = new ObjectMapper();
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

Creating new ObjectMapper instances in validation methods is inefficient. Consider injecting the existing ObjectMapper instance or creating a static final instance to reuse.

Copilot uses AI. Check for mistakes.
}
}
case EXPIRES_AT -> {
LocalDateTime.parse(newValue.trim());
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

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;
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@saokiritoni saokiritoni merged commit eba4378 into develop Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] Modify ChangeRequest structure

2 participants