refactor:E-Sign 외부 API 호출을 MNG 내부 라우트로 전환
- Finance 패턴과 동일하게 MNG 직접 DB 접근 방식으로 변경
- MNG 모델 4개 추가: EsignContract, EsignSigner, EsignSignField, EsignAuditLog
- EsignApiController 추가: stats, index, show, store, cancel, configureFields, send, download
- 모든 뷰(dashboard, create, detail, fields, send)에서 외부 API URL 제거
- 기존 X-API-Key/Bearer 인증 대신 MNG 세션 인증(CSRF) 사용
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 10:24:09 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models\ESign;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
|
|
|
|
class EsignContract extends Model
|
|
|
|
|
{
|
|
|
|
|
use SoftDeletes;
|
|
|
|
|
|
|
|
|
|
protected $table = 'esign_contracts';
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'tenant_id',
|
|
|
|
|
'contract_code',
|
|
|
|
|
'title',
|
|
|
|
|
'description',
|
|
|
|
|
'sign_order_type',
|
|
|
|
|
'original_file_path',
|
|
|
|
|
'original_file_name',
|
|
|
|
|
'original_file_hash',
|
|
|
|
|
'original_file_size',
|
|
|
|
|
'signed_file_path',
|
|
|
|
|
'signed_file_hash',
|
|
|
|
|
'status',
|
2026-02-14 16:12:41 +09:00
|
|
|
'send_method',
|
|
|
|
|
'sms_fallback',
|
2026-02-13 07:44:45 +09:00
|
|
|
'metadata',
|
refactor:E-Sign 외부 API 호출을 MNG 내부 라우트로 전환
- Finance 패턴과 동일하게 MNG 직접 DB 접근 방식으로 변경
- MNG 모델 4개 추가: EsignContract, EsignSigner, EsignSignField, EsignAuditLog
- EsignApiController 추가: stats, index, show, store, cancel, configureFields, send, download
- 모든 뷰(dashboard, create, detail, fields, send)에서 외부 API URL 제거
- 기존 X-API-Key/Bearer 인증 대신 MNG 세션 인증(CSRF) 사용
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 10:24:09 +09:00
|
|
|
'expires_at',
|
|
|
|
|
'completed_at',
|
|
|
|
|
'created_by',
|
|
|
|
|
'updated_by',
|
|
|
|
|
'deleted_by',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'original_file_size' => 'integer',
|
2026-02-14 16:12:41 +09:00
|
|
|
'sms_fallback' => 'boolean',
|
2026-02-13 07:44:45 +09:00
|
|
|
'metadata' => 'array',
|
refactor:E-Sign 외부 API 호출을 MNG 내부 라우트로 전환
- Finance 패턴과 동일하게 MNG 직접 DB 접근 방식으로 변경
- MNG 모델 4개 추가: EsignContract, EsignSigner, EsignSignField, EsignAuditLog
- EsignApiController 추가: stats, index, show, store, cancel, configureFields, send, download
- 모든 뷰(dashboard, create, detail, fields, send)에서 외부 API URL 제거
- 기존 X-API-Key/Bearer 인증 대신 MNG 세션 인증(CSRF) 사용
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 10:24:09 +09:00
|
|
|
'expires_at' => 'datetime',
|
|
|
|
|
'completed_at' => 'datetime',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function signers(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(EsignSigner::class, 'contract_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function signFields(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(EsignSignField::class, 'contract_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function auditLogs(): HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(EsignAuditLog::class, 'contract_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function scopeForTenant($query, $tenantId)
|
|
|
|
|
{
|
|
|
|
|
return $query->where('tenant_id', $tenantId);
|
|
|
|
|
}
|
|
|
|
|
}
|