feat(API): 직책/직원/근태 관리 API 개선
- Position 모델: key 필드 추가 및 마이그레이션 - PositionSeeder: 기본 직책 시더 추가 - TenantUserProfile: 프로필 이미지 관련 필드 추가 - Employee Request: 직원 등록/수정 요청 검증 강화 - EmployeeService: 직원 관리 서비스 로직 개선 - AttendanceService: 근태 관리 서비스 개선 🤖 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,7 @@ public function index(array $params): LengthAwarePaginator
|
||||
|
||||
$query = TenantUserProfile::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->with(['user', 'department', 'manager']);
|
||||
->with(['user', 'department', 'manager', 'rankPosition', 'titlePosition']);
|
||||
|
||||
// 검색 (이름, 이메일, 사원코드)
|
||||
if (! empty($params['q'])) {
|
||||
@@ -77,7 +77,7 @@ public function show(int $id): TenantUserProfile
|
||||
|
||||
$profile = TenantUserProfile::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->with(['user', 'department', 'manager'])
|
||||
->with(['user', 'department', 'manager', 'rankPosition', 'titlePosition'])
|
||||
->find($id);
|
||||
|
||||
if (! $profile) {
|
||||
@@ -155,7 +155,7 @@ public function store(array $data): TenantUserProfile
|
||||
]);
|
||||
$profile->save();
|
||||
|
||||
return $profile->fresh(['user', 'department', 'manager']);
|
||||
return $profile->fresh(['user', 'department', 'manager', 'rankPosition', 'titlePosition']);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ public function update(int $id, array $data): TenantUserProfile
|
||||
$profile->save();
|
||||
}
|
||||
|
||||
return $profile->fresh(['user', 'department', 'manager']);
|
||||
return $profile->fresh(['user', 'department', 'manager', 'rankPosition', 'titlePosition']);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ public function createAccount(int $id, string $password): TenantUserProfile
|
||||
'updated_by' => $userId,
|
||||
]);
|
||||
|
||||
return $profile->fresh(['user', 'department', 'manager']);
|
||||
return $profile->fresh(['user', 'department', 'manager', 'rankPosition', 'titlePosition']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,7 +376,7 @@ public function revokeAccount(int $id): TenantUserProfile
|
||||
// 2. 기존 토큰 무효화 (로그아웃 처리)
|
||||
$user->tokens()->delete();
|
||||
|
||||
return $profile->fresh(['user', 'department', 'manager']);
|
||||
return $profile->fresh(['user', 'department', 'manager', 'rankPosition', 'titlePosition']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user