Files
sam-docs/system/database/hr.md

68 lines
1.7 KiB
Markdown
Raw Normal View History

# 인사 / HR 도메인
> **모델 수**: HR 관련 (Tenants 하위) + Interview 5
> **핵심**: 급여, 근태, 휴가, 대출, 면접
> **API 엔드포인트**: 141개 (hr.php)
---
## 주요 테이블
### 급여 / 근무
| 테이블 | 모델 | 역할 |
|--------|------|------|
| payrolls | Payroll | 급여 마스터 |
| salaries | Salary | 급여 항목 |
| attendances | Attendance | 근태 기록 |
| attendance_requests | AttendanceRequest | 근태 요청 |
| leaves | Leave | 휴가 사용 기록 |
| leave_policies | LeavePolicy | 휴가 정책 |
| labors | Labor | 노무비 |
### 대출
| 테이블 | 모델 | 역할 |
|--------|------|------|
| loans | Loan | 직원 대출 |
### 면접 (Interview)
| 테이블 | 모델 | 역할 |
|--------|------|------|
| interview_templates | InterviewTemplate | 면접 양식 |
| interview_sessions | InterviewSession | 면접 세션 |
| interview_questions | InterviewQuestion | 면접 질문 |
| interview_categories | InterviewCategory | 면접 카테고리 |
| interview_responses | InterviewResponse | 면접 답변 |
---
## 관계 구조
```
TenantUserProfile (직원)
├─ hasMany Payroll
├─ hasMany Attendance
├─ hasMany Leave
├─ hasMany Loan
└─ hasMany AttendanceRequest
LeavePolicy
└─ belongsTo Tenant (테넌트별 휴가 정책)
InterviewTemplate
├─ hasMany InterviewCategory
│ └─ hasMany InterviewQuestion
└─ hasMany InterviewSession
└─ hasMany InterviewResponse
```
---
## 특이사항
- HR 모델은 대부분 `Tenants/` 디렉토리 하위
- 직원 정보는 `TenantUserProfile` (테넌트별 프로필)
- 면접 모델은 별도 `Interview/` 도메인으로 분리
- 급여 관련 최근 추가: long_term_care 컬럼 (2026-02-27)