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
2 changes: 0 additions & 2 deletions src/main/kotlin/com/moa/controller/HomeController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.moa.common.auth.Auth
import com.moa.common.auth.AuthMemberInfo
import com.moa.common.response.ApiResponse
import com.moa.service.ProfileService
import com.moa.service.WorkPolicyService
import com.moa.service.WorkdayService
import com.moa.service.dto.HomeResponse
import io.swagger.v3.oas.annotations.tags.Tag
Expand All @@ -17,7 +16,6 @@ import java.time.LocalDate
class HomeController(
private val profileService: ProfileService,
private val workdayService: WorkdayService,
private val workPolicyService: WorkPolicyService,
) {

@GetMapping("/api/v1/home")
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/com/moa/service/EarningsCalculator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class EarningsCalculator(
* @param date 기준 날짜 (이 날짜가 속한 월의 마지막 날을 기준으로 유효한 급여 정책을 적용합니다)
* @return 계산된 기본 월급 금액. 적용할 수 있는 급여 정보가 존재하지 않으면 `null`을 반환합니다.
*/
fun getDefaultMonthlySalary(memberId: Long, date: LocalDate): Int? {
fun getDefaultMonthlySalary(memberId: Long, date: LocalDate): Long? {
val lastDayOfMonth = YearMonth.from(date).atEndOfMonth()
val payroll = payrollVersionRepository
.findTopByMemberIdAndEffectiveFromLessThanEqualOrderByEffectiveFromDesc(
Expand All @@ -40,9 +40,9 @@ class EarningsCalculator(

return when (SalaryType.from(payroll.salaryInputType)) {
SalaryType.YEARLY -> payroll.salaryAmount.toBigDecimal()
.divide(BigDecimal(12), 0, RoundingMode.HALF_UP).toInt()
.divide(BigDecimal(12), 0, RoundingMode.HALF_UP).toLong()

SalaryType.MONTHLY -> payroll.salaryAmount.toInt()
SalaryType.MONTHLY -> payroll.salaryAmount
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/moa/service/WorkdayService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class WorkdayService(
}

return MonthlyEarningsResponse(
workedEarnings = totalEarnings.toInt(),
workedEarnings = totalEarnings.toLong(),
standardSalary = defaultSalary,
workedMinutes = workedMinutes,
standardMinutes = standardMinutes,
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/moa/service/dto/HomeResponse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import java.time.LocalTime

data class HomeResponse(
val workplace: String?,
val workedEarnings: Int,
val standardSalary: Int,
val workedEarnings: Long,
val standardSalary: Long,
val dailyPay: Int,
val type: DailyWorkScheduleType,
@field:JsonFormat(pattern = "HH:mm")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.moa.service.dto

data class MonthlyEarningsResponse(
val workedEarnings: Int,
val standardSalary: Int,
val workedEarnings: Long,
val standardSalary: Long,
val workedMinutes: Long,
val standardMinutes: Long,
)