[fix] 급여명세서 계산 정확도 개선 및 Worker API null 안전성 보완#176
Conversation
- Add null safety checks for User object in WorkerDto.Response.from() - Add null safety checks for Worker/User objects in ContractDto - Update API_SPECIFICATION.md with profileImageUrl field - Fixes review feedback for fix/154-worker-kakao-info
…e premiums and preventing double counting
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 37 minutes and 25 seconds.Comment |
🔖 관련 GitHub Issue
📝 변경 사항
주요 변경 내용
profileImageUrl및overtimeSalary필드 추가JOIN FETCH w.user추가상세 설명
1. profileImageUrl 추가 및 null 안전성 개선
Kakao OAuth 계정의 프로필 이미지 URL을 API 응답에 포함하도록
WorkerDto.Response,ContractDto.Response,ContractDto.ListResponse에profileImageUrl필드를 추가했습니다.기존 코드에서
contract.getWorker().getUser().getName()방식으로 접근할 경우 User가 탈퇴/null인 경우 NPE가 발생할 수 있어 null 체크를 추가했습니다.2. N+1 문제 해결
WorkerContractRepository의 4개 쿼리 및WorkRecordRepository의 계약 조회 쿼리에JOIN FETCH w.user를 추가해 User 정보를 즉시 로딩합니다.3. 급여 계산 로직 개선
WorkRecord에overtimeHours,overtimeSalary필드 추가 (일일 8시간 초과분)WorkRecord.calculateSalaryWithAllowanceRules()를 단순화: 기본급(1.0배) + 각 가산분(0.5배씩) 방식으로 통일WeeklyAllowance의 주간 연장수당 계산 시 이미 일일 연장으로 처리된 시간을 차감해 이중 계산 방지SalaryService에서 일일 연장 가산분과 주간 연장 가산분을 별도로 집계 후 합산WorkRecord.calculateTime()에서totalHours계산 시breakMinutes미반영 버그 수정WorkRecordDto에overtimeSalary필드 추가API_SPECIFICATION.md) 업데이트📸 스크린샷 (선택사항)
스크린샷 보기
Before
After
✅ 체크리스트
🔗 관련 PR