Skip to content

Commit

Permalink
perf(#137): changeToRegular 이름 변경 및 changeToRegularSecondRound 메서드 추가
Browse files Browse the repository at this point in the history
- changeToRegularSecondRound 메서드를 추가했어요.
- 위 메서드 추가를 위해 changeToRegular 메서드를 changeToRegularFirstRound로 변경했어요.
  • Loading branch information
jyj1289 committed Sep 24, 2024
1 parent 9998cf3 commit ccb352d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion src/main/java/com/bamdoliro/maru/domain/form/domain/Form.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,33 @@ public boolean isFailedNow() {
return status.equals(FormStatus.FAILED);
}

public void changeToRegular(CalculateFormScoreService calculateFormScoreService) {
public void changeToRegularFirstRound(CalculateFormScoreService calculateFormScoreService) {
this.changedToRegular = true;
this.type = FormType.REGULAR;

Double subjectGradeScore = calculateFormScoreService.calculateSubjectGradeScore(this);
this.score.updateSubjectScore(subjectGradeScore);
}

public void changeToRegularSecondRound(CalculateFormScoreService calculateFormScoreService) {
this.changedToRegular = true;

if (type.isMeister()) {
this.type = FormType.REGULAR;
Double subjectGradeScore = calculateFormScoreService.calculateSubjectGradeScore(this);
this.score.updateSubjectScore(subjectGradeScore);

this.score.updateSecondRoundMeisterScoreToRegular();
} else if (type.isSocial()){
this.type = FormType.REGULAR;
Double subjectGradeScore = calculateFormScoreService.calculateSubjectGradeScore(this);
this.score.updateSubjectScore(subjectGradeScore);

Double depthInterviewScore = calculateFormScoreService.calculateDepthInterviewScoreToRegular(this);
this.score.updateSecondRoundSocialScoreToRegular(depthInterviewScore);
}
}

public void update(Applicant applicant, Parent parent, Education education, Grade grade, Document document, FormType type) {
this.applicant = applicant;
this.parent = parent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public class SendMessageUseCaseTest {
when(formRepository.findChangedToRegularFirstRoundForm()).thenReturn(List.of(form));

form.firstPass();
form.changeToRegular(calculateFormScoreService);
form.changeToRegularFirstRound(calculateFormScoreService);
SendMessageByTypeRequest request = new SendMessageByTypeRequest("부산소마고 공지사항", "헤헤", FormType.REGULAR, true);

//when
Expand Down

0 comments on commit ccb352d

Please sign in to comment.