Skip to content

Commit

Permalink
feat(#137): 특별전형에서 불합격시 일반전형으로 재응시
Browse files Browse the repository at this point in the history
- 특별전형에서 불합격시 일반전형으로 재응시하는 기능을 추가했어요.
  • Loading branch information
jyj1289 committed Sep 24, 2024
1 parent 084f161 commit 09cde53
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.bamdoliro.maru.domain.form.domain.type.FormStatus;
import com.bamdoliro.maru.domain.form.domain.type.FormType;
import com.bamdoliro.maru.domain.form.exception.MissingTotalScoreException;
import com.bamdoliro.maru.domain.form.service.CalculateFormScoreService;
import com.bamdoliro.maru.infrastructure.persistence.form.FormRepository;
import com.bamdoliro.maru.shared.annotation.UseCase;
import com.bamdoliro.maru.shared.constants.FixedNumber;
Expand All @@ -18,6 +19,7 @@
public class SelectSecondPassUseCase {

private final FormRepository formRepository;
private final CalculateFormScoreService calculateFormScoreService;

@Transactional
public void execute() {
Expand All @@ -43,7 +45,7 @@ public void execute() {
form.pass();
societyDiversityCount--;
} else {
form.fail();
changeToRegularAndCalculateScoreAgain(form);
}
}

Expand All @@ -52,7 +54,7 @@ public void execute() {
form.pass();
meisterTalentCount--;
} else {
form.fail();
changeToRegularAndCalculateScoreAgain(form);
}
}

Expand Down Expand Up @@ -84,6 +86,10 @@ public void execute() {
}
}

private void changeToRegularAndCalculateScoreAgain(Form form) {
form.changeToRegularSecondRound(calculateFormScoreService);
}

private void validate() {
List<Form> firstPassedFormList = formRepository.findByStatus(FormStatus.FIRST_PASSED);
firstPassedFormList.stream()
Expand Down

0 comments on commit 09cde53

Please sign in to comment.