feat: [approval] 사직서 양식 추가
- ResignationService 생성 (정보 조회 + PDF 생성) - 사직서 전용 폼/조회 파셜 추가 - create/show 블레이드에 사직서 JS 로직 통합 - 컨트롤러 resignationInfo/resignationPdf 메서드 추가 - API 라우트 resignation-info, resignation-pdf 등록
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
use App\Services\CareerCertService;
|
||||
use App\Services\EmploymentCertService;
|
||||
use App\Services\GoogleCloudStorageService;
|
||||
use App\Services\ResignationService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -368,6 +369,43 @@ public function appointmentCertPdf(int $id)
|
||||
return $service->generatePdfResponse($content);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 사직서
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* 사원 사직서 정보 조회
|
||||
*/
|
||||
public function resignationInfo(int $userId): JsonResponse
|
||||
{
|
||||
try {
|
||||
$tenantId = session('selected_tenant_id');
|
||||
$service = app(ResignationService::class);
|
||||
$data = $service->getCertInfo($userId, $tenantId);
|
||||
|
||||
return response()->json(['success' => true, 'data' => $data]);
|
||||
} catch (\Throwable $e) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '사원 정보를 불러올 수 없습니다.',
|
||||
], 400);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 사직서 PDF 다운로드
|
||||
*/
|
||||
public function resignationPdf(int $id)
|
||||
{
|
||||
$approval = \App\Models\Approvals\Approval::where('tenant_id', session('selected_tenant_id'))
|
||||
->findOrFail($id);
|
||||
|
||||
$content = $approval->content ?? [];
|
||||
$service = app(ResignationService::class);
|
||||
|
||||
return $service->generatePdfResponse($content);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 워크플로우
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user