feat: [hr] 근태현황 MNG 프론트엔드 구현

- Attendance 모델 (attendances 테이블, 상태/색상 매핑, check_in/check_out accessor)
- AttendanceService (목록/월간통계/CRUD, 부서/사원 드롭다운)
- API 컨트롤러 (HTMX+JSON 이중 응답, stats/index/store/update/destroy)
- 페이지 컨트롤러 (index 페이지 렌더링)
- 웹/API 라우트 등록 (hr/attendances, api/admin/hr/attendances)
- index.blade.php (통계카드+필터+등록/수정 모달)
- partials/table.blade.php (HTMX 부분 로드 테이블)
This commit is contained in:
김보곤
2026-02-26 19:34:07 +09:00
parent b9a4a6b835
commit e8d38953d0
8 changed files with 1043 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Http\Controllers\HR;
use App\Http\Controllers\Controller;
use App\Models\HR\Attendance;
use App\Services\HR\AttendanceService;
use Illuminate\Contracts\View\View;
class AttendanceController extends Controller
{
public function __construct(
private AttendanceService $attendanceService
) {}
/**
* 근태현황 목록 페이지
*/
public function index(): View
{
$stats = $this->attendanceService->getMonthlyStats();
$departments = $this->attendanceService->getDepartments();
$employees = $this->attendanceService->getActiveEmployees();
$statusMap = Attendance::STATUS_MAP;
return view('hr.attendances.index', [
'stats' => $stats,
'departments' => $departments,
'employees' => $employees,
'statusMap' => $statusMap,
]);
}
}