Skip to content

Commit

Permalink
Main push (#160)
Browse files Browse the repository at this point in the history
* feat : front dev url 추가

* add: 아이디어톤, 해커톤 날짜 추가 (#157)

* [refact] 홈페이지 수정사항 반영 (#159)

* [fix] 시간 단위 수정 및 테스트 코드 작성

* [fix] 서류합격 validation 수정

* [fix] Type 변경

---------

Co-authored-by: mirageoasis <[email protected]>
Co-authored-by: mirageoasis <[email protected]>
Co-authored-by: JeongHyun Lee <[email protected]>
Co-authored-by: Jeonghyun Lee <[email protected]>
  • Loading branch information
5 people authored Nov 21, 2023
1 parent 04252af commit dbaca18
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ceos.backend.domain.application.validator;

import static ceos.backend.domain.application.domain.Pass.PASS;

import ceos.backend.domain.application.domain.Application;
import ceos.backend.domain.application.domain.ApplicationQuestion;
Expand Down Expand Up @@ -119,7 +120,7 @@ public void validateInterviewTimeExist(String uuid, String email) {
() -> {
throw ApplicantNotFound.EXCEPTION;
});
if (application.getInterviewDatetime() == null) {
if (application.getDocumentPass() == PASS && application.getInterviewDatetime() == null) {
throw NotSetInterviewTime.EXCEPTION;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.PositiveOrZero;
import java.time.LocalDate;
import lombok.Builder;
import lombok.Getter;
Expand Down Expand Up @@ -56,7 +56,7 @@ public class ApplicantInfoVo {

@Schema(defaultValue = "99999999", description = "지원자 남은 학기 수")
@NotNull(message = "지원자 남은 학기 수를 입력해주세요")
@Positive
@PositiveOrZero
private int semestersLeftNumber;

@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,26 @@ public class Recruitment extends BaseEntity {

@NotNull private String devStudyUrl;

@NotNull private LocalDate startDateDoc;
@NotNull private LocalDateTime startDateDoc;

@NotNull private LocalDate endDateDoc;
@NotNull private LocalDateTime endDateDoc;

@NotNull private LocalDate resultDateDoc;
@NotNull private LocalDateTime resultDateDoc;

@NotNull private LocalDate startDateInterview;
@NotNull private LocalDateTime startDateInterview;

@NotNull private LocalDate endDateInterview;
@NotNull private LocalDateTime endDateInterview;

@NotNull private LocalDate resultDateFinal;
@NotNull private LocalDateTime resultDateFinal;

@NotNull private String openChatUrl;

@NotNull private LocalDate otDate;

@NotNull private LocalDate ideathonDate;

@NotNull private LocalDate hackathonDate;

@NotNull private LocalDate demodayDate;

private LocalDateTime applicationExcelCreatedAt;
Expand All @@ -60,14 +64,16 @@ private Recruitment(
String prodStudyUrl,
String designStudyUrl,
String devStudyUrl,
LocalDate startDateDoc,
LocalDate endDateDoc,
LocalDate resultDateDoc,
LocalDate startDateInterview,
LocalDate endDateInterview,
LocalDate resultDateFinal,
LocalDateTime startDateDoc,
LocalDateTime endDateDoc,
LocalDateTime resultDateDoc,
LocalDateTime startDateInterview,
LocalDateTime endDateInterview,
LocalDateTime resultDateFinal,
String openChatUrl,
LocalDate otDate,
LocalDate ideathonDate,
LocalDate hackathonDate,
LocalDate demodayDate,
LocalDateTime applicationExcelCreatedAt) {
this.generation = generation;
Expand All @@ -82,6 +88,8 @@ private Recruitment(
this.resultDateFinal = resultDateFinal;
this.openChatUrl = openChatUrl;
this.otDate = otDate;
this.ideathonDate = ideathonDate;
this.hackathonDate = hackathonDate;
this.demodayDate = demodayDate;
this.applicationExcelCreatedAt = applicationExcelCreatedAt;
}
Expand All @@ -99,6 +107,8 @@ public void updateRecruitment(RecruitmentDTO recruitmentDTO) {
this.resultDateFinal = recruitmentDTO.getResultDateFinal();
this.openChatUrl = recruitmentDTO.getOpenChatUrl();
this.otDate = recruitmentDTO.getOtDate();
this.ideathonDate = recruitmentDTO.getIdeathonDate();
this.hackathonDate = recruitmentDTO.getHackathonDate();
this.demodayDate = recruitmentDTO.getDemodayDate();
}

Expand All @@ -113,7 +123,7 @@ public void validateGeneration(int generation) {
}
}

public void validateBetweenStartDateDocAndEndDateDoc(LocalDate now) {
public void validateBetweenStartDateDocAndEndDateDoc(LocalDateTime now) {
if (now.compareTo(this.getStartDateDoc()) < 0) {
throw NotApplicationDuration.EXCEPTION;
}
Expand All @@ -122,7 +132,7 @@ public void validateBetweenStartDateDocAndEndDateDoc(LocalDate now) {
}
}

public void validateFinalResultAbleDuration(LocalDate now) {
public void validateFinalResultAbleDuration(LocalDateTime now) {
if (now.compareTo(this.resultDateFinal.plusDays(5)) >= 0) {
throw NotFinalResultCheckDuration.EXCEPTION;
}
Expand All @@ -131,7 +141,7 @@ public void validateFinalResultAbleDuration(LocalDate now) {
}
}

public void validateBetweenStartDateDocAndResultDateDoc(LocalDate now) {
public void validateBetweenStartDateDocAndResultDateDoc(LocalDateTime now) {
if (now.compareTo(this.startDateDoc) < 0) {
throw NotDocumentPassDuration.EXCEPTION;
}
Expand All @@ -140,7 +150,7 @@ public void validateBetweenStartDateDocAndResultDateDoc(LocalDate now) {
}
}

public void validateBetweenResultDateDocAndResultDateFinal(LocalDate now) {
public void validateBetweenResultDateDocAndResultDateFinal(LocalDateTime now) {
if (now.compareTo(this.resultDateDoc) < 0) {
throw NotFinalPassDuration.EXCEPTION;
}
Expand All @@ -149,13 +159,13 @@ public void validateBetweenResultDateDocAndResultDateFinal(LocalDate now) {
}
}

public void validateBeforeStartDateDoc(LocalDate now) {
public void validateBeforeStartDateDoc(LocalDateTime now) {
if (now.compareTo(this.startDateDoc) >= 0) {
throw AlreadyApplicationDuration.EXCEPTION;
}
}

public void validAmenablePeriod(LocalDate now) {
public void validAmenablePeriod(LocalDateTime now) {
if (now.compareTo(this.startDateDoc) >= 0 && now.compareTo(this.resultDateFinal) <= 0) {
throw NotAllowedToModify.EXCEPTION;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import ceos.backend.domain.recruitment.domain.Recruitment;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -12,14 +13,16 @@ public class RecruitmentDTO {
private String prodStudyUrl;
private String designStudyUrl;
private String devStudyUrl;
private LocalDate startDateDoc;
private LocalDate endDateDoc;
private LocalDate resultDateDoc;
private LocalDate startDateInterview;
private LocalDate endDateInterview;
private LocalDate resultDateFinal;
private LocalDateTime startDateDoc;
private LocalDateTime endDateDoc;
private LocalDateTime resultDateDoc;
private LocalDateTime startDateInterview;
private LocalDateTime endDateInterview;
private LocalDateTime resultDateFinal;
private String openChatUrl;
private LocalDate otDate;
private LocalDate ideathonDate;
private LocalDate hackathonDate;
private LocalDate demodayDate;

@Builder
Expand All @@ -28,14 +31,16 @@ public RecruitmentDTO(
String prodStudyUrl,
String designStudyUrl,
String devStudyUrl,
LocalDate startDateDoc,
LocalDate endDateDoc,
LocalDate resultDateDoc,
LocalDate startDateInterview,
LocalDate endDateInterview,
LocalDate resultDateFinal,
LocalDateTime startDateDoc,
LocalDateTime endDateDoc,
LocalDateTime resultDateDoc,
LocalDateTime startDateInterview,
LocalDateTime endDateInterview,
LocalDateTime resultDateFinal,
String openChatUrl,
LocalDate otDate,
LocalDate ideathonDate,
LocalDate hackathonDate,
LocalDate demodayDate) {
this.generation = generation;
this.prodStudyUrl = prodStudyUrl;
Expand All @@ -49,6 +54,8 @@ public RecruitmentDTO(
this.resultDateFinal = resultDateFinal;
this.openChatUrl = openChatUrl;
this.otDate = otDate;
this.ideathonDate = ideathonDate;
this.hackathonDate = hackathonDate;
this.demodayDate = demodayDate;
}

Expand All @@ -66,6 +73,8 @@ public static RecruitmentDTO from(Recruitment recruitment) {
.resultDateFinal(recruitment.getResultDateFinal())
.openChatUrl(recruitment.getOpenChatUrl())
.otDate(recruitment.getOtDate())
.ideathonDate(recruitment.getIdeathonDate())
.hackathonDate(recruitment.getHackathonDate())
.demodayDate(recruitment.getDemodayDate())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import ceos.backend.domain.recruitment.domain.Recruitment;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -12,13 +13,15 @@ public class UserRecruitmentDTO {
private String prodStudyUrl;
private String designStudyUrl;
private String devStudyUrl;
private LocalDate startDateDoc;
private LocalDate endDateDoc;
private LocalDate resultDateDoc;
private LocalDate startDateInterview;
private LocalDate endDateInterview;
private LocalDate resultDateFinal;
private LocalDateTime startDateDoc;
private LocalDateTime endDateDoc;
private LocalDateTime resultDateDoc;
private LocalDateTime startDateInterview;
private LocalDateTime endDateInterview;
private LocalDateTime resultDateFinal;
private LocalDate otDate;
private LocalDate ideathonDate;
private LocalDate hackathonDate;
private LocalDate demodayDate;

@Builder
Expand All @@ -27,13 +30,15 @@ public UserRecruitmentDTO(
String prodStudyUrl,
String designStudyUrl,
String devStudyUrl,
LocalDate startDateDoc,
LocalDate endDateDoc,
LocalDate resultDateDoc,
LocalDate startDateInterview,
LocalDate endDateInterview,
LocalDate resultDateFinal,
LocalDateTime startDateDoc,
LocalDateTime endDateDoc,
LocalDateTime resultDateDoc,
LocalDateTime startDateInterview,
LocalDateTime endDateInterview,
LocalDateTime resultDateFinal,
LocalDate otDate,
LocalDate ideathonDate,
LocalDate hackathonDate,
LocalDate demodayDate) {
this.generation = generation;
this.prodStudyUrl = prodStudyUrl;
Expand All @@ -46,6 +51,8 @@ public UserRecruitmentDTO(
this.endDateInterview = endDateInterview;
this.resultDateFinal = resultDateFinal;
this.otDate = otDate;
this.ideathonDate = ideathonDate;
this.hackathonDate = hackathonDate;
this.demodayDate = demodayDate;
}

Expand All @@ -62,6 +69,8 @@ public static UserRecruitmentDTO from(Recruitment recruitment) {
.endDateInterview(recruitment.getEndDateInterview())
.resultDateFinal(recruitment.getResultDateFinal())
.otDate(recruitment.getOtDate())
.ideathonDate(recruitment.getIdeathonDate())
.hackathonDate(recruitment.getHackathonDate())
.demodayDate(recruitment.getDemodayDate())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import ceos.backend.domain.recruitment.helper.RecruitmentHelper;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

Expand All @@ -14,26 +14,26 @@ public class RecruitmentValidator {
public void validateBetweenStartDateDocAndEndDateDoc() {
recruitmentHelper
.takeRecruitment()
.validateBetweenStartDateDocAndEndDateDoc(LocalDate.now());
.validateBetweenStartDateDocAndEndDateDoc(LocalDateTime.now());
}

public void validateBeforeStartDateDoc() {
recruitmentHelper.takeRecruitment().validateBeforeStartDateDoc(LocalDate.now());
recruitmentHelper.takeRecruitment().validateBeforeStartDateDoc(LocalDateTime.now());
}

public void validateBetweenResultDateDocAndResultDateFinal() {
recruitmentHelper
.takeRecruitment()
.validateBetweenResultDateDocAndResultDateFinal(LocalDate.now());
.validateBetweenResultDateDocAndResultDateFinal(LocalDateTime.now());
}

public void validateFinalResultAbleDuration() {
recruitmentHelper.takeRecruitment().validateFinalResultAbleDuration(LocalDate.now());
recruitmentHelper.takeRecruitment().validateFinalResultAbleDuration(LocalDateTime.now());
}

public void validateBetweenStartDateDocAndResultDateDoc() {
recruitmentHelper
.takeRecruitment()
.validateBetweenStartDateDocAndResultDateDoc(LocalDate.now());
.validateBetweenStartDateDocAndResultDateDoc(LocalDateTime.now());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public class WebSecurityConfig {
@Value("${server.admin_url}")
private String ADMIN_URL;

@Value("${server.dev_url}")
private String DEV_URL;

@Value("${swagger.user}")
private String swaggerUser;

Expand Down Expand Up @@ -82,7 +85,7 @@ public class WebSecurityConfig {

private final String[] GetPermittedPatterns = {
"/awards/**",
"/recruitments/**",
"/recruitments",
"/projects/**",
"/activities/**",
"/managements/**",
Expand Down Expand Up @@ -188,7 +191,8 @@ private CorsConfiguration getDefaultCorsConfiguration() {
"http://localhost:3001",
USER_URL,
ADMIN_URL,
SERVER_URL));
SERVER_URL,
DEV_URL));
configuration.setAllowedHeaders(List.of("*"));
configuration.setAllowedMethods(List.of("*"));
configuration.setAllowCredentials(true);
Expand Down
Loading

0 comments on commit dbaca18

Please sign in to comment.