feat:E-Sign 작성자 서명/도장 선택 기능 (자동서명 제거)
- 작성자 자동서명 로직 제거 → 양쪽 모두 서명 과정 필수 - 서명 화면에서 '직접 서명' / '법인도장' 선택 UI 추가 - 도장 선택 시 기존 stamp 이미지로 바로 제출 - getContract API에 has_stamp 필드 추가 - submitSignature에 use_stamp 플래그 처리 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -456,48 +456,21 @@ public function send(Request $request, int $id): JsonResponse
|
||||
'updated_by' => auth()->id(),
|
||||
]);
|
||||
|
||||
// 법인도장이 있는 작성자 자동 서명 처리
|
||||
$creatorSigner = $contract->signers->firstWhere('role', 'creator');
|
||||
if ($creatorSigner && $creatorSigner->signature_image_path) {
|
||||
$creatorSigner->update([
|
||||
'status' => 'signed',
|
||||
'signed_at' => now(),
|
||||
'sign_ip_address' => $request->ip(),
|
||||
'sign_user_agent' => $request->userAgent(),
|
||||
]);
|
||||
|
||||
EsignAuditLog::create([
|
||||
'tenant_id' => $tenantId,
|
||||
'contract_id' => $contract->id,
|
||||
'signer_id' => $creatorSigner->id,
|
||||
'action' => 'signed',
|
||||
'ip_address' => $request->ip(),
|
||||
'user_agent' => $request->userAgent(),
|
||||
'metadata' => ['auto_stamp' => true, 'signer_name' => $creatorSigner->name],
|
||||
'created_at' => now(),
|
||||
]);
|
||||
|
||||
// 계약 상태를 partially_signed로 변경
|
||||
$contract->update(['status' => 'partially_signed']);
|
||||
}
|
||||
|
||||
// 서명 순서 유형에 따라 알림 발송
|
||||
if ($contract->sign_order_type === 'parallel') {
|
||||
// 동시 서명: 서명 안 한 서명자에게만 발송
|
||||
// 동시 서명: 모든 서명자에게 발송
|
||||
foreach ($contract->signers as $s) {
|
||||
if ($s->status === 'signed') continue;
|
||||
$s->update(['status' => 'notified']);
|
||||
Mail::to($s->email)->send(new EsignRequestMail($contract, $s));
|
||||
}
|
||||
} else {
|
||||
// 순차 서명: 다음 미서명 서명자에게 발송
|
||||
$nextSigner = $contract->signers()
|
||||
->where('status', '!=', 'signed')
|
||||
// 순차 서명: 첫 번째 서명자에게 발송
|
||||
$firstSigner = $contract->signers()
|
||||
->orderBy('sign_order')
|
||||
->first();
|
||||
if ($nextSigner) {
|
||||
$nextSigner->update(['status' => 'notified']);
|
||||
Mail::to($nextSigner->email)->send(new EsignRequestMail($contract, $nextSigner));
|
||||
if ($firstSigner) {
|
||||
$firstSigner->update(['status' => 'notified']);
|
||||
Mail::to($firstSigner->email)->send(new EsignRequestMail($contract, $firstSigner));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user