feat:영업/매니저 시나리오 100% 완료 시 계약완료 자동 전환

- SalesScenarioChecklist에 checkAndConvertProspectStatus() 메서드 추가
- toggleByProspect()에서 체크 완료 시 자동 전환 로직 호출
- AdminProspectController에서 목록 조회 시 기존 100% 데이터 자동 전환
- API 응답에 상태 변경 정보 포함

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-02 12:46:53 +09:00
parent 2f02390262
commit 3bd5550bb1
3 changed files with 46 additions and 1 deletions

View File

@@ -299,10 +299,18 @@ public function toggleProspectChecklist(Request $request): JsonResponse
$management = SalesTenantManagement::findOrCreateByProspect($prospectId);
$management->updateProgress($scenarioType, $progress['percentage']);
// 가망고객 상태 조회 (자동 전환이 발생했을 수 있음)
$prospect = TenantProspect::find($prospectId);
$fullProgress = SalesScenarioChecklist::getProspectProgress($prospectId);
return response()->json([
'success' => true,
'progress' => $progress,
'checked' => $checked,
'prospect_status' => $prospect?->status,
'prospect_status_label' => $prospect?->status_label,
'is_converted' => $prospect?->status === TenantProspect::STATUS_CONVERTED,
'full_progress' => $fullProgress,
]);
}