diff --git a/src/main/java/com/bamdoliro/maru/domain/form/domain/value/Score.java b/src/main/java/com/bamdoliro/maru/domain/form/domain/value/Score.java index 1130d933..6adaa78d 100644 --- a/src/main/java/com/bamdoliro/maru/domain/form/domain/value/Score.java +++ b/src/main/java/com/bamdoliro/maru/domain/form/domain/value/Score.java @@ -1,5 +1,6 @@ package com.bamdoliro.maru.domain.form.domain.value; +import com.bamdoliro.maru.shared.util.MathUtil; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import lombok.AccessLevel; @@ -41,11 +42,11 @@ public class Score { private Double totalScore; public Score(Double subjectGradeScore, Integer attendanceScore, Integer volunteerScore, Integer bonusScore) { - this.subjectGradeScore = subjectGradeScore; + this.subjectGradeScore = MathUtil.roundTo(subjectGradeScore, 3); this.attendanceScore = attendanceScore; this.volunteerScore = volunteerScore; this.bonusScore = bonusScore; - this.firstRoundScore = subjectGradeScore + attendanceScore + volunteerScore + bonusScore; + this.firstRoundScore = MathUtil.roundTo(subjectGradeScore + attendanceScore + volunteerScore + bonusScore, 3); } public void updateSubjectScore(Double subjectGradeScore) { diff --git a/src/main/java/com/bamdoliro/maru/domain/form/service/CalculateFormScoreService.java b/src/main/java/com/bamdoliro/maru/domain/form/service/CalculateFormScoreService.java index 0d3d829f..4d0eba5c 100644 --- a/src/main/java/com/bamdoliro/maru/domain/form/service/CalculateFormScoreService.java +++ b/src/main/java/com/bamdoliro/maru/domain/form/service/CalculateFormScoreService.java @@ -5,7 +5,6 @@ import com.bamdoliro.maru.domain.form.domain.value.Attendance; import com.bamdoliro.maru.domain.form.domain.value.Score; import com.bamdoliro.maru.domain.form.domain.value.SubjectMap; -import com.bamdoliro.maru.shared.util.MathUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -22,7 +21,7 @@ import static com.bamdoliro.maru.domain.form.constant.FormConstant.MIN_VOLUNTEER_SCORE; import static com.bamdoliro.maru.domain.form.constant.FormConstant.MIN_VOLUNTEER_TIME; import static com.bamdoliro.maru.domain.form.constant.FormConstant.REGULAR_TYPE_DEFAULT_SCORE; -import static com.bamdoliro.maru.domain.form.constant.FormConstant.SPECIAL_TYPE_DEFAULT_SCORE ; +import static com.bamdoliro.maru.domain.form.constant.FormConstant.SPECIAL_TYPE_DEFAULT_SCORE; @RequiredArgsConstructor @Service @@ -63,7 +62,7 @@ private Double calculateRegularScore(Form form) { 7.2 * 2 * subjectMap.getScoreOf(3, 1); } - return REGULAR_TYPE_DEFAULT_SCORE + MathUtil.roundTo(score, 3); + return REGULAR_TYPE_DEFAULT_SCORE + score; } private Double calculateSpecialScore(Form form) { @@ -77,7 +76,7 @@ private Double calculateSpecialScore(Form form) { 4.32 * 2 * subjectMap.getScoreOf(3, 1); } - return SPECIAL_TYPE_DEFAULT_SCORE + MathUtil.roundTo(score, 3); + return SPECIAL_TYPE_DEFAULT_SCORE + score; } private Integer calculateAttendanceScore(Form form) {