Skip to content

Fix overflow by changing integer type to long type in payroll calculation logic#35

Merged
jeyongsong merged 2 commits intomainfrom
fix-earning-overflow
Mar 10, 2026
Merged

Fix overflow by changing integer type to long type in payroll calculation logic#35
jeyongsong merged 2 commits intomainfrom
fix-earning-overflow

Conversation

@jeyongsong
Copy link
Member

This pull request primarily updates salary and earnings-related data types from Int to Long to better handle larger values and improve data consistency across the application. Additionally, it removes the unused WorkPolicyService dependency from the HomeController.

Data type updates for salary and earnings

  • Changed the return type of getDefaultMonthlySalary in EarningsCalculator from Int? to Long?, and updated internal calculations to use Long instead of Int for monthly salary values. (src/main/kotlin/com/moa/service/EarningsCalculator.kt) [1] [2]
  • Updated MonthlyEarningsResponse data class to use Long for workedEarnings and standardSalary fields instead of Int. (src/main/kotlin/com/moa/service/dto/MonthlyEarningsResponse.kt)
  • Modified WorkdayService to return workedEarnings as Long instead of Int. (src/main/kotlin/com/moa/service/WorkdayService.kt)

Code cleanup

  • Removed the unused WorkPolicyService dependency from the HomeController constructor and corresponding import statement. (src/main/kotlin/com/moa/controller/HomeController.kt) [1] [2]

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

Test Results

32 tests   32 ✅  0s ⏱️
 3 suites   0 💤
 3 files     0 ❌

Results for commit adf01c5.

♻️ This comment has been updated with latest results.

@jeyongsong jeyongsong changed the title Fix overflow by changing integer type to long type in payrol… Fix overflow by changing integer type to long type in payroll calculation logic Mar 10, 2026
@jeyongsong jeyongsong merged commit bae0362 into main Mar 10, 2026
3 checks passed
@jeyongsong jeyongsong deleted the fix-earning-overflow branch March 10, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant