Skip to content

Commit

Permalink
Merge pull request #102 from depromeet/feature/#98
Browse files Browse the repository at this point in the history
Feature/#98 공고관련 이슈 해결
  • Loading branch information
sejoon00 authored Aug 30, 2024
2 parents 0fc55e3 + 0d5a8e4 commit 301ee85
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public Recruit toEntity(User user, Season season) {
.season(season)
.title(title)
.siteUrl(siteUrl)
.recruitStatus(RecruitStatus.APPLICATION_COMPLETED)
.recruitStatus(RecruitStatus.PREPARATION_IN_PROGRESS)
.user(user)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum RecruitStatus {
DOCUMENT_PASSED("서류 통과"),
DOCUMENT_REJECTION("서류 탈락"),
INTERVIEW_PASSED("면접 통과"),
INTERVIEW_REJECTION("서류 탈락"),
INTERVIEW_REJECTION("면접 탈락"),
FINAL_ACCEPTANCE("최종 합격"),
FINAL_REJECTED("최종 탈락");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public enum RecruitStatusCategory {

private final List<RecruitStatus> statuses;

public static boolean isRejectionStatus(RecruitStatus status) {
return REJECTION_STATUS.getStatuses().contains(status);
public static boolean isRejectionStatusOrFinalAcceptance(RecruitStatus status) {
return REJECTION_STATUS.getStatuses().contains(status) || RecruitStatus.FINAL_ACCEPTANCE.equals(status);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.server.bbo_gak.domain.recruit.service;

import com.server.bbo_gak.domain.recruit.dao.RecruitRepository;
import com.server.bbo_gak.domain.recruit.dao.RecruitScheduleRepository;
import com.server.bbo_gak.domain.recruit.dto.request.RecruitCreateRequest;
import com.server.bbo_gak.domain.recruit.dto.request.RecruitScheduleCreateRequest;
import com.server.bbo_gak.domain.recruit.dto.response.RecruitGetInnerResponse;
Expand Down Expand Up @@ -30,7 +29,6 @@ public class RecruitService {
private final RecruitRepository recruitRepository;
private final SeasonService seasonService;
private final RecruitScheduleService recruitScheduleService;
private final RecruitScheduleRepository recruitScheduleRepository;

public List<RecruitGetResponse> getTotalRecruitList(User user) {
List<Recruit> recruits = recruitRepository.findAllByUserId(user.getId());
Expand Down Expand Up @@ -82,7 +80,7 @@ private LocalDate getNearestUpcomingDate(Recruit recruit) {

private Map<Boolean, List<Recruit>> partitionRecruits(List<Recruit> recruits) {
return recruits.stream()
.filter(recruit -> !RecruitStatusCategory.isRejectionStatus(
.filter(recruit -> !RecruitStatusCategory.isRejectionStatusOrFinalAcceptance(
recruit.getRecruitStatus())) // 불합격 상태 필터링
.collect(Collectors.partitioningBy(this::isNeedsScheduleUpdate));
}
Expand Down Expand Up @@ -121,7 +119,6 @@ private void addRecruitScheduleIfRequired(RecruitCreateRequest request, Recruit
RecruitScheduleCreateRequest.of(
request.recruitScheduleStage(), request.deadLine())
);
recruitScheduleRepository.save(recruitSchedule);
recruit.addSchedule(recruitSchedule);
}
}
Expand Down

0 comments on commit 301ee85

Please sign in to comment.