- 6단계 영업 프로세스 체크리스트 UI 구현 - 사용자별 체크포인트 저장/조회 API 추가 - 레거시 스타일 가로 아코디언 UI 적용 - 단계별 진행률 표시 및 꿀팁 모달 추가
140 lines
3.8 KiB
PHP
140 lines
3.8 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Lab;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\SalesScenarioService;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* R&D Labs > M. 관리 메뉴 컨트롤러
|
|
*/
|
|
class ManagementController extends Controller
|
|
{
|
|
public function __construct(
|
|
private SalesScenarioService $salesScenarioService
|
|
) {}
|
|
|
|
// 바로빌 테넌트 관리
|
|
public function barobillTenant()
|
|
{
|
|
return view('lab.management.barobill-tenant');
|
|
}
|
|
|
|
// 전자세금계산서 전략
|
|
public function taxInvoiceStrategy()
|
|
{
|
|
return view('lab.management.tax-invoice-strategy');
|
|
}
|
|
|
|
// 전자세금계산서
|
|
public function taxInvoice()
|
|
{
|
|
return view('lab.management.tax-invoice');
|
|
}
|
|
|
|
// 사업자등록번호 진위 확인
|
|
public function businessVerify()
|
|
{
|
|
return view('lab.management.business-verify');
|
|
}
|
|
|
|
// 영업관리 & 매니저 미팅관리
|
|
public function salesMeeting()
|
|
{
|
|
return view('lab.management.sales-meeting');
|
|
}
|
|
|
|
// 카드 세무항목 매칭 전략
|
|
public function cardTaxMatching()
|
|
{
|
|
return view('lab.management.card-tax-matching');
|
|
}
|
|
|
|
// 한국 카드사 API 보고서
|
|
public function cardApiReport()
|
|
{
|
|
return view('lab.management.card-api-report');
|
|
}
|
|
|
|
// 카드 사용내역 수집 후 매칭
|
|
public function cardUsageMatching()
|
|
{
|
|
return view('lab.management.card-usage-matching');
|
|
}
|
|
|
|
// 계좌입출금 내역 조회 API
|
|
public function accountApi()
|
|
{
|
|
return view('lab.management.account-api');
|
|
}
|
|
|
|
// 영업관리 시나리오
|
|
public function salesScenario()
|
|
{
|
|
$steps = SalesScenarioService::getScenarioSteps();
|
|
$user = auth()->user();
|
|
$checklist = $user ? $this->salesScenarioService->getUserChecklist($user) : [];
|
|
$progress = $user ? $this->salesScenarioService->getOverallProgress($user) : ['total' => 0, 'checked' => 0, 'percent' => 0];
|
|
|
|
return view('lab.management.sales-scenario', compact('steps', 'checklist', 'progress'));
|
|
}
|
|
|
|
// 영업관리 시나리오 체크리스트 조회 API
|
|
public function salesScenarioChecklist(): JsonResponse
|
|
{
|
|
$user = auth()->user();
|
|
|
|
if (! $user) {
|
|
return response()->json(['success' => false, 'message' => '인증이 필요합니다.'], 401);
|
|
}
|
|
|
|
$data = $this->salesScenarioService->getUserChecklist($user);
|
|
$progress = $this->salesScenarioService->getOverallProgress($user);
|
|
|
|
return response()->json([
|
|
'success' => true,
|
|
'data' => $data,
|
|
'progress' => $progress,
|
|
]);
|
|
}
|
|
|
|
// 영업관리 시나리오 체크포인트 토글 API
|
|
public function salesScenarioToggle(Request $request): JsonResponse
|
|
{
|
|
$user = auth()->user();
|
|
|
|
if (! $user) {
|
|
return response()->json(['success' => false, 'message' => '인증이 필요합니다.'], 401);
|
|
}
|
|
|
|
$validated = $request->validate([
|
|
'step_id' => 'required|integer|min:1|max:6',
|
|
'checkpoint_index' => 'required|integer|min:0',
|
|
'is_checked' => 'required|boolean',
|
|
]);
|
|
|
|
$checkedIndices = $this->salesScenarioService->toggleCheckpoint(
|
|
$user,
|
|
$validated['step_id'],
|
|
$validated['checkpoint_index'],
|
|
$validated['is_checked']
|
|
);
|
|
|
|
$progress = $this->salesScenarioService->getOverallProgress($user);
|
|
|
|
return response()->json([
|
|
'success' => true,
|
|
'data' => $checkedIndices,
|
|
'progress' => $progress,
|
|
]);
|
|
}
|
|
|
|
// 매니저 시나리오
|
|
public function managerScenario()
|
|
{
|
|
return view('lab.management.manager-scenario');
|
|
}
|
|
}
|