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
@@ -1,7 +1,5 @@
package life.mosu.mosuserver.application.application;

import java.util.List;
import java.util.Set;
import life.mosu.mosuserver.application.application.dto.RegisterApplicationCommand;
import life.mosu.mosuserver.application.application.processor.GetApplicationsStepProcessor;
import life.mosu.mosuserver.application.application.processor.RegisterApplicationStepProcessor;
Expand All @@ -14,19 +12,17 @@
import life.mosu.mosuserver.domain.application.repository.ApplicationJpaRepository;
import life.mosu.mosuserver.domain.exam.entity.ExamJpaEntity;
import life.mosu.mosuserver.domain.exam.entity.ExamJpaRepository;
import life.mosu.mosuserver.presentation.application.dto.ApplicationGuestRequest;
import life.mosu.mosuserver.presentation.application.dto.ApplicationRequest;
import life.mosu.mosuserver.presentation.application.dto.ApplicationResponse;
import life.mosu.mosuserver.presentation.application.dto.CreateApplicationResponse;
import life.mosu.mosuserver.presentation.application.dto.ExamApplicationRequest;
import life.mosu.mosuserver.presentation.application.dto.SchoolApplicationCountResponse;
import life.mosu.mosuserver.presentation.application.dto.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

와일드카드(*) import를 사용하여 여러 클래스를 한 번에 가져오도록 변경하셨네요. 하지만 명시적으로 개별 클래스를 import하는 것이 코드의 가독성을 높이고, 어떤 클래스가 사용되는지 명확하게 파악하는 데 도움이 됩니다. 또한, 잠재적인 이름 충돌을 방지할 수 있습니다.

다른 파일들과의 일관성을 위해, 그리고 더 나은 유지보수성을 위해 이전처럼 명시적 import를 사용하는 것을 권장합니다.

Suggested change
import life.mosu.mosuserver.presentation.application.dto.*;
import life.mosu.mosuserver.presentation.application.dto.ApplicationGuestRequest;
import life.mosu.mosuserver.presentation.application.dto.ApplicationRequest;
import life.mosu.mosuserver.presentation.application.dto.ApplicationResponse;
import life.mosu.mosuserver.presentation.application.dto.CreateApplicationResponse;
import life.mosu.mosuserver.presentation.application.dto.ExamApplicationRequest;
import life.mosu.mosuserver.presentation.application.dto.SchoolApplicationCountResponse;

import life.mosu.mosuserver.presentation.common.FileRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

@Service
@RequiredArgsConstructor
@Slf4j
Expand Down Expand Up @@ -83,7 +79,7 @@ private CreateApplicationResponse handleApplication(
FileRequest admissionTicket
) {
List<ExamJpaEntity> exams = examJpaRepository.findAllById(examIds);
validator.examDateNotPassed(exams);
// validator.examDateNotPassed(exams);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

시험 마감 기한을 검증하는 validator.examDateNotPassed(exams) 호출이 주석 처리되었습니다. 이 검증 로직은 마감 기한이 지난 시험에 대한 원서 접수를 막는 중요한 역할을 하는 것으로 보입니다.

이 변경으로 인해 이미 마감된 시험에 원서가 접수될 수 있는 잠재적인 위험이 있습니다. PR 설명에 이 변경에 대한 이유가 없어 의도를 파악하기 어렵습니다. 만약 의도된 변경이 아니라면, 해당 라인의 주석을 해제하는 것이 좋겠습니다. 의도된 변경이라면, 그 이유를 코드 주석이나 PR 설명에 추가해주시면 좋겠습니다.

Suggested change
// validator.examDateNotPassed(exams);
validator.examDateNotPassed(exams);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Critical: Validation bypass allows applications to expired exams.

Commenting out validator.examDateNotPassed(exams) removes two essential safeguards:

  1. Automatic closure: Exams are no longer auto-closed when their deadline passes
  2. Runtime enforcement: Users can now submit applications to exams past their deadline

While examNotFull (line 83) checks for CLOSED status, it relies on exams being closed through other means. Without the deadline check, expired exams remain open and accept invalid applications.

Verify the following before merging:

Please clarify:

  • Why was this validation disabled? (Testing? Business requirement change?)
  • Is there an alternative mechanism to prevent applications to expired exams?
  • How will exams be closed when their deadline passes?

🏁 Script executed:

#!/bin/bash
# Check if exam closure is handled elsewhere (e.g., scheduled jobs, other validators)

# Search for other invocations of examDateNotPassed
rg -nP '\bexamDateNotPassed\b' --type=java

# Search for other mechanisms that close exams or check deadlines
rg -nP '(exam\.(close|setExamStatus)|ExamStatus\.CLOSED|getDeadlineTime)' --type=java -C3

# Search for scheduled jobs or cron tasks related to exam lifecycle
rg -nP '(@Scheduled|@CronJob|deadline|close.*exam)' --type=java -C3

Length of output: 22895


Critical: restore exam expiration enforcement

Commenting out validator.examDateNotPassed(exams) bypasses auto-closing of expired exams and their rejection, leaving deadlines unenforced. No other automated mechanism handles expiration. Restore this validation or implement an alternative expiration process before merging.

🤖 Prompt for AI Agents
In
src/main/java/life/mosu/mosuserver/application/application/ApplicationService.java
around line 82, the call to validator.examDateNotPassed(exams) was commented
out, which disables automatic closing/rejection of expired exams; restore the
expiration enforcement by re-enabling that validator call (or, if there was a
reason it was removed, implement an equivalent expiration sweep that runs before
this flow to close and reject exams past their deadlines), ensure the
validator/sweep runs synchronously before continuing processing here, and keep
any related error handling/logging so expired exams are properly
closed/rejected.

validator.examNotFull(exams);
validator.examIdsAndLunchSelection(examApplications);
validator.noDuplicateApplication(userId, examIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.time.LocalDate;

@Slf4j
@CronJob(cron = "0 0 9 13 10 ?", name = "examNumberGeneratorJob_20251019")
@CronJob(cron = "0 0 10 13 10 ?", name = "examNumberGeneratorJob_20251019")
@DisallowConcurrentExecution
@RequiredArgsConstructor
public class ExamNumberGenerationJobRound1 implements Job {
Expand Down
Loading
Loading