Skip to content

Commit

Permalink
[refact] 합격 조회 response 수정 (#120)
Browse files Browse the repository at this point in the history
* [refact] 결과 보기 response 수정

* [chore] spotless 적용
  • Loading branch information
wjdtkdgns authored Jul 30, 2023
1 parent 43a3519 commit abea608
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.PositiveOrZero;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;
Expand Down Expand Up @@ -54,8 +53,7 @@ public class ApplicantInfo {
@Column(unique = true)
private String uuid;

@NotNull @PositiveOrZero
private int semestersLeftNumber;
@NotNull @PositiveOrZero private int semestersLeftNumber;

@Builder
private ApplicantInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import ceos.backend.global.common.dto.ParsedDuration;
import ceos.backend.global.util.ParsedDurationConvertor;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import java.time.LocalDate;
import lombok.Builder;
import lombok.Getter;

import java.time.LocalDate;

@Getter
public class GetResultResponse {
private Pass pass;
Expand All @@ -20,32 +19,51 @@ public class GetResultResponse {

private String name;

@JsonUnwrapped
private ParsedDuration parsedDuration;
@JsonUnwrapped private ParsedDuration parsedDuration;

private LocalDate otDate;

private boolean attendanceStatus;

@Builder
private GetResultResponse(Pass pass, int generation, String name, ParsedDuration parsedDuration, LocalDate otDate) {
private GetResultResponse(
Pass pass,
int generation,
String name,
ParsedDuration parsedDuration,
LocalDate otDate,
boolean attendanceStatus) {
this.pass = pass;
this.generation = generation;
this.name = name;
this.parsedDuration = parsedDuration;
this.otDate = otDate;
this.attendanceStatus = attendanceStatus;
}

public static GetResultResponse toDocumentResult(Application application, Recruitment recruitment) {
return GetResultResponse.builder().pass(application.getDocumentPass())
public static GetResultResponse toDocumentResult(
Application application, Recruitment recruitment) {
return GetResultResponse.builder()
.pass(application.getDocumentPass())
.generation(recruitment.getGeneration())
.name(application.getApplicantInfo().getName())
.parsedDuration(ParsedDurationConvertor.parsingDuration(application.getInterviewDatetime()))
.otDate(recruitment.getOtDate()).build();
.parsedDuration(
ParsedDurationConvertor.parsingDuration(application.getInterviewDatetime()))
.otDate(recruitment.getOtDate())
.attendanceStatus(application.isInterviewCheck())
.build();
}

public static GetResultResponse toFinalResult(Application application, Recruitment recruitment) {
return GetResultResponse.builder().pass(application.getFinalPass()).generation(recruitment.getGeneration())
public static GetResultResponse toFinalResult(
Application application, Recruitment recruitment) {
return GetResultResponse.builder()
.pass(application.getFinalPass())
.generation(recruitment.getGeneration())
.name(application.getApplicantInfo().getName())
.parsedDuration(ParsedDurationConvertor.parsingDuration(application.getInterviewDatetime()))
.otDate(recruitment.getOtDate()).build();
.parsedDuration(
ParsedDurationConvertor.parsingDuration(application.getInterviewDatetime()))
.otDate(recruitment.getOtDate())
.attendanceStatus(application.isFinalCheck())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public List<ApplicationInterview> toApplicationInterviewList(
return applicationInterviews;
}

public GetResultResponse toGetResultResponse(Application application, Recruitment recruitment, boolean isDocument) {
public GetResultResponse toGetResultResponse(
Application application, Recruitment recruitment, boolean isDocument) {
if (isDocument) {
return GetResultResponse.toDocumentResult(application, recruitment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import ceos.backend.domain.application.vo.QuestionListVo;
import ceos.backend.domain.recruitment.domain.Recruitment;
import ceos.backend.domain.recruitment.helper.RecruitmentHelper;
import ceos.backend.domain.recruitment.repository.RecruitmentRepository;
import ceos.backend.domain.recruitment.validator.RecruitmentValidator;
import ceos.backend.global.common.dto.PageInfo;
import ceos.backend.global.util.InterviewDateTimeConvertor;
Expand Down

0 comments on commit abea608

Please sign in to comment.