fix:전자서명 getContract API에 계약/서명자 상태 체크 추가
취소/거절/완료된 계약이나 이미 서명한 서명자가 서명 페이지에 접근할 때 즉시 명확한 에러 메시지를 표시하도록 개선. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,22 @@ public function getContract(string $token): JsonResponse
|
||||
return response()->json(['success' => false, 'message' => '계약을 찾을 수 없습니다.'], 404);
|
||||
}
|
||||
|
||||
// 계약 상태 체크: 서명 불가한 상태면 에러 반환
|
||||
$statusMessages = [
|
||||
'draft' => '아직 발송되지 않은 계약입니다.',
|
||||
'cancelled' => '취소된 계약입니다.',
|
||||
'rejected' => '거절된 계약입니다.',
|
||||
'completed' => '이미 완료된 계약입니다.',
|
||||
];
|
||||
if (isset($statusMessages[$contract->status])) {
|
||||
return response()->json(['success' => false, 'message' => $statusMessages[$contract->status]], 400);
|
||||
}
|
||||
|
||||
// 서명자가 이미 서명 완료한 경우
|
||||
if ($signer->status === 'signed') {
|
||||
return response()->json(['success' => false, 'message' => '이미 서명을 완료하였습니다.'], 400);
|
||||
}
|
||||
|
||||
EsignAuditLog::create([
|
||||
'tenant_id' => $contract->tenant_id,
|
||||
'contract_id' => $contract->id,
|
||||
|
||||
Reference in New Issue
Block a user