feat:E-Sign 전자계약 서명 솔루션 백엔드 구현
- 마이그레이션 4개 (esign_contracts, esign_signers, esign_sign_fields, esign_audit_logs) - 모델 4개 (EsignContract, EsignSigner, EsignSignField, EsignAuditLog) - 서비스 4개 (EsignContractService, EsignSignService, EsignPdfService, EsignAuditService) - 컨트롤러 2개 (EsignContractController, EsignSignController) - FormRequest 4개 (ContractStore, FieldConfigure, SignSubmit, SignReject) - Mail 1개 (EsignRequestMail + 이메일 템플릿) - API 라우트 (인증 계약 관리 + 토큰 기반 서명 프로세스) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
67
app/Models/ESign/EsignSignField.php
Normal file
67
app/Models/ESign/EsignSignField.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ESign;
|
||||
|
||||
use App\Traits\BelongsToTenant;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class EsignSignField extends Model
|
||||
{
|
||||
use BelongsToTenant;
|
||||
|
||||
protected $table = 'esign_sign_fields';
|
||||
|
||||
// 필드 유형 상수
|
||||
public const TYPE_SIGNATURE = 'signature';
|
||||
public const TYPE_STAMP = 'stamp';
|
||||
public const TYPE_TEXT = 'text';
|
||||
public const TYPE_DATE = 'date';
|
||||
public const TYPE_CHECKBOX = 'checkbox';
|
||||
|
||||
public const FIELD_TYPES = [
|
||||
self::TYPE_SIGNATURE,
|
||||
self::TYPE_STAMP,
|
||||
self::TYPE_TEXT,
|
||||
self::TYPE_DATE,
|
||||
self::TYPE_CHECKBOX,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'tenant_id',
|
||||
'contract_id',
|
||||
'signer_id',
|
||||
'page_number',
|
||||
'position_x',
|
||||
'position_y',
|
||||
'width',
|
||||
'height',
|
||||
'field_type',
|
||||
'field_label',
|
||||
'field_value',
|
||||
'is_required',
|
||||
'sort_order',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'page_number' => 'integer',
|
||||
'position_x' => 'decimal:2',
|
||||
'position_y' => 'decimal:2',
|
||||
'width' => 'decimal:2',
|
||||
'height' => 'decimal:2',
|
||||
'is_required' => 'boolean',
|
||||
'sort_order' => 'integer',
|
||||
];
|
||||
|
||||
// === Relations ===
|
||||
|
||||
public function contract(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EsignContract::class, 'contract_id');
|
||||
}
|
||||
|
||||
public function signer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EsignSigner::class, 'signer_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user