feat: [esign] 전자서명 고도화 - 필기 검증 템플릿·검증 결과 마이그레이션 및 모델 추가
This commit is contained in:
54
app/Models/ESign/EsignVerificationTemplate.php
Normal file
54
app/Models/ESign/EsignVerificationTemplate.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user