-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
169 additions
and
11 deletions.
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