주요 기능:
- 일일 로그 CRUD (생성, 조회, 수정, 삭제, 복원, 영구삭제)
- 로그 항목(Entry) 관리 (추가, 상태변경, 삭제, 순서변경)
- 주간 타임라인 (최근 7일 진행률 표시)
- 테이블 리스트 아코디언 상세보기
- 담당자 자동완성 (일반 사용자는 슈퍼관리자 목록 제외)
- HTMX 기반 동적 테이블 로딩 및 필터링
- Soft Delete 지원
파일 추가:
- Models: AdminPmDailyLog, AdminPmDailyLogEntry
- Controllers: DailyLogController (Web, API)
- Service: DailyLogService
- Requests: StoreDailyLogRequest, UpdateDailyLogRequest
- Views: index, show, table partial, modal-form partial
라우트 추가:
- Web: /daily-logs, /daily-logs/today, /daily-logs/{id}
- API: /api/admin/daily-logs/* (CRUD + 항목관리)
92 lines
2.7 KiB
PHP
92 lines
2.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Admin\AdminPmDailyLogEntry;
|
|
use App\Services\ProjectManagement\DailyLogService;
|
|
use App\Services\ProjectManagement\ProjectService;
|
|
use Illuminate\View\View;
|
|
|
|
class DailyLogController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly DailyLogService $dailyLogService,
|
|
private readonly ProjectService $projectService
|
|
) {}
|
|
|
|
/**
|
|
* 일일 로그 목록 화면
|
|
*/
|
|
public function index(): View
|
|
{
|
|
$tenantId = session('current_tenant_id', 1);
|
|
|
|
$projects = $this->projectService->getActiveProjects();
|
|
$stats = $this->dailyLogService->getStats($tenantId);
|
|
$weeklyTimeline = $this->dailyLogService->getWeeklyTimeline($tenantId);
|
|
$assigneeTypes = AdminPmDailyLogEntry::getAssigneeTypes();
|
|
$entryStatuses = AdminPmDailyLogEntry::getStatuses();
|
|
$assignees = $this->dailyLogService->getAssigneeList($tenantId);
|
|
|
|
return view('daily-logs.index', compact(
|
|
'projects',
|
|
'stats',
|
|
'weeklyTimeline',
|
|
'assigneeTypes',
|
|
'entryStatuses',
|
|
'assignees'
|
|
));
|
|
}
|
|
|
|
/**
|
|
* 일일 로그 상세 화면
|
|
*/
|
|
public function show(int $id): View
|
|
{
|
|
$tenantId = session('current_tenant_id', 1);
|
|
|
|
$log = $this->dailyLogService->getDailyLogById($id, true);
|
|
|
|
if (! $log) {
|
|
abort(404, '일일 로그를 찾을 수 없습니다.');
|
|
}
|
|
|
|
$projects = $this->projectService->getActiveProjects();
|
|
$assigneeTypes = AdminPmDailyLogEntry::getAssigneeTypes();
|
|
$entryStatuses = AdminPmDailyLogEntry::getStatuses();
|
|
$assignees = $this->dailyLogService->getAssigneeList($tenantId);
|
|
|
|
return view('daily-logs.show', compact(
|
|
'log',
|
|
'projects',
|
|
'assigneeTypes',
|
|
'entryStatuses',
|
|
'assignees'
|
|
));
|
|
}
|
|
|
|
/**
|
|
* 오늘 날짜 로그 화면 (자동 생성)
|
|
*/
|
|
public function today(): View
|
|
{
|
|
$tenantId = session('current_tenant_id', 1);
|
|
$today = now()->format('Y-m-d');
|
|
|
|
$log = $this->dailyLogService->getOrCreateByDate($tenantId, $today);
|
|
|
|
$projects = $this->projectService->getActiveProjects();
|
|
$assigneeTypes = AdminPmDailyLogEntry::getAssigneeTypes();
|
|
$entryStatuses = AdminPmDailyLogEntry::getStatuses();
|
|
$assignees = $this->dailyLogService->getAssigneeList($tenantId);
|
|
|
|
return view('daily-logs.show', compact(
|
|
'log',
|
|
'projects',
|
|
'assigneeTypes',
|
|
'entryStatuses',
|
|
'assignees'
|
|
));
|
|
}
|
|
}
|