feat: [esign] 전자서명 고도화 - 필기 검증 템플릿·검증 결과 마이그레이션 및 모델 추가

This commit is contained in:
김보곤
2026-03-22 22:26:23 +09:00
parent 404b61c426
commit d5bb98e953
4 changed files with 199 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
namespace App\Models\ESign;
use Illuminate\Database\Eloquent\Model;
class EsignVerificationTemplate extends Model
{
protected $table = 'esign_verification_templates';
protected $fillable = [
'tenant_id',
'name',
'category',
'steps',
'pass_threshold',
'max_attempts',
'is_active',
'created_by',
'options',
];
protected $casts = [
'steps' => 'array',
'pass_threshold' => 'decimal:2',
'max_attempts' => 'integer',
'is_active' => 'boolean',
'options' => 'array',
];
public function scopeForTenant($query, $tenantId)
{
return $query->where('tenant_id', $tenantId);
}
public function scopeActive($query)
{
return $query->where('is_active', true);
}
public function getOption(string $key, mixed $default = null): mixed
{
$options = $this->options ?? [];
return $options[$key] ?? $default;
}
public function setOption(string $key, mixed $value): void
{
$options = $this->options ?? [];
$options[$key] = $value;
$this->options = $options;
}
}