-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DDING-93] 지원자 상태 수정 API 구현 #241
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8b40c1a
feat: 지원자 상세 조회 API 구현
Seooooo24 5ff484b
fix: FormFieldAnswerListResponse.from 메서드 fieldId 매핑 추가
Seooooo24 2d22171
rename: FacadeCentralFormServiceImplTest 파일명 변경
Seooooo24 9fb14da
test: 지원자 상세 조회하기 API 테스트 코드 작성
Seooooo24 421e3ef
feat: 지원자 상세 조회 페이지 상태 수정 API 구현
Seooooo24 1b78f1b
refactor: UserFormApplicationApi 내부 메서드명 변경
Seooooo24 c23e201
test: 지원자 개인 상태 수정 API 테스트 코드 작성
Seooooo24 6079928
style: API 요약 변경
Seooooo24 3808c28
refactor: form ownership 검증 로직 삭제
Seooooo24 d6e28ae
fix: 지원자 상태 수정 API로 수정
Seooooo24 b3d768f
test: 기능 수정에 따른 테스트 코드 수정
Seooooo24 c0c009e
docs: Swagger 문서 예시 수정
Seooooo24 f13ae32
merge
Seooooo24 6b89e5e
refactor: status String으로 받도록 수정
Seooooo24 33c5cbc
refactor: upadate 메서드 내부의 save 메서드 삭제
Seooooo24 45e64e4
refactor: update 메서드명 명확하게 변경
Seooooo24 58226d7
refactor: 불필요한 toEntity() 메서드 삭제
Seooooo24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...gBE/domain/formapplication/controller/dto/request/UpdateFormApplicationStatusRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ddingdong.ddingdongBE.domain.formapplication.controller.dto.request; | ||
|
||
import ddingdong.ddingdongBE.domain.formapplication.entity.FormApplicationStatus; | ||
import ddingdong.ddingdongBE.domain.formapplication.service.dto.command.UpdateFormApplicationStatusCommand; | ||
import ddingdong.ddingdongBE.domain.user.entity.User; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
import java.util.List; | ||
|
||
public record UpdateFormApplicationStatusRequest( | ||
@NotNull(message = "지원자 id 리스트는 필수 입력 사항입니다.") | ||
@Schema(description = "수정할 지원자 id 리스트", example = "[1, 2, 3]") | ||
List<Long> applicationIds, | ||
|
||
@NotNull(message = "지원자 상태는 필수 입력 사항입니다.") | ||
@Schema(description = "수정할 지원자 상태", example = "FIRST_PASS") | ||
String status | ||
) { | ||
public UpdateFormApplicationStatusCommand toCommand(Long formId, User user) { | ||
return UpdateFormApplicationStatusCommand.builder() | ||
.formId(formId) | ||
.applicationIds(applicationIds) | ||
.status(FormApplicationStatus.findStatus(status)) | ||
.user(user) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
src/main/java/ddingdong/ddingdongBE/domain/formapplication/entity/FormApplicationStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package ddingdong.ddingdongBE.domain.formapplication.entity; | ||
|
||
import ddingdong.ddingdongBE.common.exception.InvalidatedMappingException.InvalidatedEnumValue; | ||
import java.util.Arrays; | ||
|
||
public enum FormApplicationStatus { | ||
SUBMITTED, | ||
FIRST_PASS, | ||
FINAL_PASS, | ||
FIRST_FAIL, | ||
FINAL_FAIL | ||
FINAL_FAIL; | ||
|
||
public static FormApplicationStatus findStatus(String status) { | ||
return Arrays.stream(values()) | ||
.filter(findStatus -> findStatus.name().equals(status)) | ||
.findFirst() | ||
.orElseThrow(() -> new InvalidatedEnumValue("FormApplicationStatus (status=" + status + ")를 찾을 수 없습니다.")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...dongBE/domain/formapplication/service/dto/command/UpdateFormApplicationStatusCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package ddingdong.ddingdongBE.domain.formapplication.service.dto.command; | ||
|
||
import ddingdong.ddingdongBE.domain.formapplication.entity.FormApplicationStatus; | ||
import ddingdong.ddingdongBE.domain.user.entity.User; | ||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
public record UpdateFormApplicationStatusCommand( | ||
Long formId, | ||
List<Long> applicationIds, | ||
FormApplicationStatus status, | ||
User user | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
상태 업데이트 API에도 오류 응답 문서화가 필요합니다.
상태 업데이트 API도 주요 오류 시나리오에 대한 응답 문서화가 필요합니다.
다음과 같이 추가하는 것을 제안합니다:
📝 Committable suggestion