Skip to content

Refactor notification services and add earnings calculation functiona…#24

Merged
subsub97 merged 2 commits intomainfrom
home-api
Feb 21, 2026
Merged

Refactor notification services and add earnings calculation functiona…#24
subsub97 merged 2 commits intomainfrom
home-api

Conversation

@subsub97
Copy link
Collaborator

This pull request introduces a comprehensive set of changes to enhance earnings calculation, reporting, and notification features related to workdays and payroll. The main improvements include the addition of monthly earnings calculation, daily pay computation for workdays, and significant refactoring for better modularity and maintainability. Below are the most important changes grouped by theme:

Earnings Calculation and Reporting:

  • Added a new EarningsCalculator service to encapsulate logic for calculating default monthly salary and daily earnings, including handling of work/vacation days and overtime.
  • Introduced a new API endpoint /workdays/earnings in WorkdayController to provide monthly earnings data, returning a MonthlyEarningsResponse with total earnings, default salary, worked minutes, and standard minutes. [1] [2]
  • Enhanced WorkdayService to use the new earnings calculation logic, including computing daily pay for each workday and aggregating monthly earnings. Refactored schedule resolution and response creation for consistency. [1] [2] [3] [4] [5] [6]

Salary and Work Minutes Calculation:

  • Expanded SalaryCalculator with methods to calculate work minutes (accounting for overnight shifts) and prorated earnings based on actual vs. policy work minutes.
  • Updated imports and dependencies to support new calculation logic, including handling of LocalTime and Duration.

Notification and Service Refactoring:

  • Moved notification-related services and schedulers to the com.moa.service.notification package for better modularity and clarity. [1] [2] [3] [4] [5]
  • Updated imports in controllers and services to reflect the new package structure.

User-Facing Improvements:

  • Changed notification messages for clock-in and clock-out events to more natural Korean phrasing.

Repository and Query Adjustments:

  • Minor stylistic update to JPQL query in WorkPolicyVersionRepository for consistency.

These changes collectively improve the accuracy and transparency of earnings calculations, provide new reporting capabilities, and improve code organization for future development.…lity

@subsub97 subsub97 requested a review from jeyongsong February 21, 2026 17:30
@github-actions
Copy link

github-actions bot commented Feb 21, 2026

Test Results

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

Results for commit 3152f14.

♻️ This comment has been updated with latest results.

Copy link
Member

@jeyongsong jeyongsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

가시죠~~~

@subsub97 subsub97 merged commit 4fed1a3 into main Feb 21, 2026
2 checks passed
@subsub97 subsub97 deleted the home-api branch February 21, 2026 17:42
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.

2 participants