Skip to content

Commit

Permalink
Merge pull request #785 from peer-42seoul/hotfix-change-recruit-statu…
Browse files Browse the repository at this point in the history
…s-when-team-disperse

[Hotfix] change recruit status when status of team is change
  • Loading branch information
weejihye authored Feb 5, 2024
2 parents 9a268ba + 8744505 commit 5555602
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/peer/backend/entity/team/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import peer.backend.entity.BaseEntity;
import peer.backend.entity.board.recruit.Recruit;
import peer.backend.entity.board.recruit.enums.RecruitDueEnum;
import peer.backend.entity.board.recruit.enums.RecruitStatus;
import peer.backend.entity.board.team.Board;
import peer.backend.entity.team.enums.TeamMemberStatus;
import peer.backend.entity.team.enums.TeamOperationFormat;
Expand Down Expand Up @@ -128,10 +129,15 @@ public Integer getMaxMember() {
}


//TODO: 팀 상태, 모집글 상태 변경 로직 개선 필요함.
public void update(TeamSettingInfoDto teamSettingInfoDto) {
this.name = teamSettingInfoDto.getName();
this.dueTo = RecruitDueEnum.from(teamSettingInfoDto.getDueTo());
this.status = teamSettingInfoDto.getStatus();
if (this.status != TeamStatus.RECRUITING)
recruit.setStatus(RecruitStatus.DONE);
else
recruit.setStatus(RecruitStatus.ONGOING);
String[] regions = teamSettingInfoDto.getRegion();
if (teamSettingInfoDto.getRegion().length == 2) {
this.region1 = regions[0];
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/peer/backend/service/team/TeamService.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import peer.backend.dto.team.TeamSettingInfoDto;
import peer.backend.entity.board.recruit.RecruitInterview;
import peer.backend.entity.board.recruit.enums.RecruitDueEnum;
import peer.backend.entity.board.recruit.enums.RecruitStatus;
import peer.backend.entity.board.team.Board;
import peer.backend.entity.board.team.enums.BoardType;
import peer.backend.entity.composite.TeamUserJobPK;
Expand Down Expand Up @@ -507,6 +508,7 @@ public Team disperseTeam(User user, Long teamId) {
throw new ConflictException("팀이 모집 중 상태일 경우 팀을 해산 할 수 없습니다!");
}
team.setStatus(TeamStatus.DISPERSE);
team.getRecruit().setStatus(RecruitStatus.DONE);
return team;
}

Expand Down

0 comments on commit 5555602

Please sign in to comment.