feat: HR 모델 userProfile 관계 추가 및 서비스 개선
## 모델 개선 - Leave: userProfile relation 추가 - Salary: userProfile relation 추가 - TenantUserProfile: department, position 관계 및 label accessor 추가 ## 서비스 개선 - LeaveService: userProfile eager loading 추가 - SalaryService: 사원 정보 조회 개선 - CardService: 관계 정리 및 개선 - AttendanceService: 조회 기능 개선 ## 시더 - DummySalarySeeder 추가 - DummyCardSeeder 멀티테넌트 지원 개선 - DummyDataSeeder에 급여 시더 등록 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,12 @@ public function index(array $params): LengthAwarePaginator
|
||||
|
||||
$query = Leave::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->with(['user:id,name,email', 'approver:id,name']);
|
||||
->with([
|
||||
'user:id,name,email',
|
||||
'userProfile' => fn ($q) => $q->where('tenant_id', $tenantId),
|
||||
'userProfile.department:id,name',
|
||||
'approver:id,name',
|
||||
]);
|
||||
|
||||
// 사용자 필터
|
||||
if (! empty($params['user_id'])) {
|
||||
@@ -78,7 +83,12 @@ public function show(int $id): Leave
|
||||
|
||||
return Leave::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->with(['user:id,name,email', 'approver:id,name'])
|
||||
->with([
|
||||
'user:id,name,email',
|
||||
'userProfile' => fn ($q) => $q->where('tenant_id', $tenantId),
|
||||
'userProfile.department:id,name',
|
||||
'approver:id,name',
|
||||
])
|
||||
->findOrFail($id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user