feat:영업/매니저 시나리오 100% 완료 시 계약완료 자동 전환
- SalesScenarioChecklist에 checkAndConvertProspectStatus() 메서드 추가 - toggleByProspect()에서 체크 완료 시 자동 전환 로직 호출 - AdminProspectController에서 목록 조회 시 기존 100% 데이터 자동 전환 - API 응답에 상태 변경 정보 포함 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user