Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import inha.gdgoc.domain.admin.recruit.core.dto.response.RecruitCoreApplicationDecisionResponse;
import inha.gdgoc.domain.admin.recruit.core.dto.response.RecruitCoreApplicationPageResponse;
import inha.gdgoc.domain.admin.recruit.core.service.RecruitCoreAdminService;
import inha.gdgoc.domain.recruit.core.dto.response.RecruitCoreApplicantDetailResponse;
import inha.gdgoc.domain.recruit.core.entity.RecruitCoreApplication;
import inha.gdgoc.domain.recruit.core.enums.RecruitCoreResultStatus;
import inha.gdgoc.domain.user.enums.TeamType;
Expand Down Expand Up @@ -65,6 +66,12 @@ public RecruitCoreApplicationPageResponse list(
);
}

@PreAuthorize(ORGANIZER_OR_HR_LEAD_RULE)
@GetMapping("/{applicationId}")
public ResponseEntity<RecruitCoreApplicantDetailResponse> detail(@PathVariable Long applicationId) {
return ResponseEntity.ok(adminService.getApplicationDetail(applicationId));
}

@PreAuthorize(ORGANIZER_OR_HR_LEAD_RULE)
@PostMapping("/{applicationId}/accept")
public ResponseEntity<RecruitCoreApplicationDecisionResponse> accept(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import inha.gdgoc.domain.admin.recruit.core.dto.request.RecruitCoreApplicationAcceptRequest;
import inha.gdgoc.domain.admin.recruit.core.dto.request.RecruitCoreApplicationRejectRequest;
import inha.gdgoc.domain.recruit.core.dto.response.RecruitCoreApplicantDetailResponse;
import inha.gdgoc.domain.admin.recruit.core.dto.response.RecruitCoreApplicationDecisionResponse;
import inha.gdgoc.domain.recruit.core.entity.RecruitCoreApplication;
import inha.gdgoc.domain.recruit.core.enums.RecruitCoreResultStatus;
Expand Down Expand Up @@ -43,6 +44,11 @@ public Page<RecruitCoreApplication> searchApplications(
return repository.findAll(spec, pageable);
}

@Transactional(readOnly = true)
public RecruitCoreApplicantDetailResponse getApplicationDetail(Long applicationId) {
return RecruitCoreApplicantDetailResponse.from(getApplication(applicationId));
}

@Transactional
public RecruitCoreApplicationDecisionResponse accept(
Long applicationId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ private void validateLeadAndCorePolicy(
}

if (editorRole == UserRole.LEAD) {
if (!(targetCurrentRole == UserRole.MEMBER || targetCurrentRole == UserRole.CORE)) {
throw new BusinessException(GlobalErrorCode.FORBIDDEN_USER, "LEAD๋Š” MEMBER/CORE๋งŒ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.");
if (!(targetCurrentRole == UserRole.GUEST || targetCurrentRole == UserRole.MEMBER || targetCurrentRole == UserRole.CORE)) {
throw new BusinessException(GlobalErrorCode.FORBIDDEN_USER, "LEAD๋Š” GUEST/MEMBER/CORE๋งŒ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.");
}
if (!(newRole == UserRole.MEMBER || newRole == UserRole.CORE)) {
throw new BusinessException(GlobalErrorCode.FORBIDDEN_USER, "LEAD๋Š” MEMBER/CORE๋กœ๋งŒ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.");
if (!(newRole == UserRole.GUEST || newRole == UserRole.MEMBER || newRole == UserRole.CORE)) {
throw new BusinessException(GlobalErrorCode.FORBIDDEN_USER, "LEAD๋Š” GUEST/MEMBER/CORE๋กœ๋งŒ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.");
}
}

Expand Down
Loading