-
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
20 changed files
with
637 additions
and
213 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(); | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
...g/ddingdongBE/domain/formapplication/controller/dto/response/FormApplicationResponse.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,76 @@ | ||
package ddingdong.ddingdongBE.domain.formapplication.controller.dto.response; | ||
|
||
import ddingdong.ddingdongBE.domain.form.entity.FieldType; | ||
import ddingdong.ddingdongBE.domain.formapplication.entity.FormApplicationStatus; | ||
import ddingdong.ddingdongBE.domain.formapplication.service.dto.query.FormApplicationQuery; | ||
import ddingdong.ddingdongBE.domain.formapplication.service.dto.query.FormApplicationQuery.FormFieldAnswerListQuery; | ||
|
||
import io.swagger.v3.oas.annotations.media.ArraySchema; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Builder | ||
public record FormApplicationResponse ( | ||
@Schema(description = "제출일시", example = "2025-01-01T00:00") | ||
LocalDateTime submittedAt, | ||
@Schema(description = "지원자 이름", example = "김띵동") | ||
String name, | ||
@Schema(description = "지원자 학번", example = "60201111") | ||
String studentNumber, | ||
@Schema(description = "지원자 학과", example = "융합소프트웨어학부") | ||
String department, | ||
@Schema(description = "status", example = "SUBMITTED") | ||
FormApplicationStatus status, | ||
@ArraySchema(schema = @Schema(implementation = FormFieldAnswerListResponse.class)) | ||
List<FormFieldAnswerListResponse> formFieldAnswers | ||
){ | ||
@Builder | ||
record FormFieldAnswerListResponse ( | ||
@Schema(description = "폼지 질문 ID", example = "1") | ||
Long fieldId, | ||
@Schema(description = "폼지 질문", example = "성별이 무엇입니까??") | ||
String question, | ||
@Schema(description = "폼지 질문 유형", example = "RADIO", allowableValues = {"CHECK_BOX", "RADIO", "TEXT", "LONG_TEXT", "FILE"}) | ||
FieldType type, | ||
@Schema(description = "폼지 지문", example = "[\"여성\", \"남성\"]") | ||
List<String> options, | ||
@Schema(description = "필수 여부", example = "true") | ||
Boolean required, | ||
@Schema(description = "질문 순서", example = "1") | ||
Integer order, | ||
@Schema(description = "섹션", example = "공통") | ||
String section, | ||
@Schema(description = "질문 답변 값", example = "[\"지문1\"]") | ||
List<String> value | ||
) { | ||
public static FormFieldAnswerListResponse from(FormFieldAnswerListQuery formFieldAnswerListQuery) { | ||
return FormFieldAnswerListResponse.builder() | ||
.fieldId(formFieldAnswerListQuery.fieldId()) | ||
.question(formFieldAnswerListQuery.question()) | ||
.type(formFieldAnswerListQuery.type()) | ||
.options(formFieldAnswerListQuery.options()) | ||
.required(formFieldAnswerListQuery.required()) | ||
.order(formFieldAnswerListQuery.order()) | ||
.section(formFieldAnswerListQuery.section()) | ||
.value(formFieldAnswerListQuery.value()) | ||
.build(); | ||
} | ||
} | ||
public static FormApplicationResponse from(FormApplicationQuery formApplicationQuery) { | ||
List<FormFieldAnswerListResponse> responses = formApplicationQuery.formFieldAnswers().stream() | ||
.map(FormFieldAnswerListResponse::from) | ||
.toList(); | ||
|
||
return FormApplicationResponse.builder() | ||
.submittedAt(formApplicationQuery.createdAt()) | ||
.name(formApplicationQuery.name()) | ||
.studentNumber(formApplicationQuery.studentNumber()) | ||
.department(formApplicationQuery.department()) | ||
.status(formApplicationQuery.status()) | ||
.formFieldAnswers(responses) | ||
.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
5 changes: 5 additions & 0 deletions
5
...gdong/ddingdongBE/domain/formapplication/service/FacadeCentralFormApplicationService.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,10 +1,15 @@ | ||
package ddingdong.ddingdongBE.domain.formapplication.service; | ||
|
||
import ddingdong.ddingdongBE.domain.formapplication.service.dto.command.UpdateFormApplicationStatusCommand; | ||
import ddingdong.ddingdongBE.domain.formapplication.service.dto.query.FormApplicationQuery; | ||
import ddingdong.ddingdongBE.domain.formapplication.service.dto.query.MyFormApplicationPageQuery; | ||
import ddingdong.ddingdongBE.domain.user.entity.User; | ||
|
||
public interface FacadeCentralFormApplicationService { | ||
|
||
MyFormApplicationPageQuery getMyFormApplicationPage(Long formId, User user, int size, Long currentCursorId); | ||
|
||
FormApplicationQuery getFormApplication(Long formId, Long applicationId, User user); | ||
|
||
void updateStatus(UpdateFormApplicationStatusCommand command); | ||
} |
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
4 changes: 4 additions & 0 deletions
4
src/main/java/ddingdong/ddingdongBE/domain/formapplication/service/FormAnswerService.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,10 +1,14 @@ | ||
package ddingdong.ddingdongBE.domain.formapplication.service; | ||
|
||
import ddingdong.ddingdongBE.domain.formapplication.entity.FormAnswer; | ||
import ddingdong.ddingdongBE.domain.formapplication.entity.FormApplication; | ||
|
||
import java.util.List; | ||
|
||
public interface FormAnswerService { | ||
|
||
void createAll(List<FormAnswer> formAnswers); | ||
|
||
List<FormAnswer> getAllByApplication(FormApplication formApplication); | ||
|
||
} |
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
Oops, something went wrong.