Files
sam-manage/app/Models/ESign/EsignHandwritingVerification.php

63 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace App\Models\ESign;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class EsignHandwritingVerification extends Model
{
protected $table = 'esign_handwriting_verifications';
protected $fillable = [
'tenant_id',
'contract_id',
'signer_id',
'step_order',
'prompt_text',
'recognized_text',
'similarity_score',
'is_passed',
'handwriting_image',
'hwr_engine',
'hwr_confidence',
'hwr_raw_response',
'attempt_number',
'verified_at',
'ip_address',
'user_agent',
'options',
];
protected $casts = [
'step_order' => 'integer',
'similarity_score' => 'decimal:2',
'is_passed' => 'boolean',
'hwr_confidence' => 'decimal:2',
'hwr_raw_response' => 'array',
'attempt_number' => 'integer',
'verified_at' => 'datetime',
'options' => 'array',
];
public function contract(): BelongsTo
{
return $this->belongsTo(EsignContract::class, 'contract_id');
}
public function signer(): BelongsTo
{
return $this->belongsTo(EsignSigner::class, 'signer_id');
}
public function scopeForTenant($query, $tenantId)
{
return $query->where('tenant_id', $tenantId);
}
public function scopePassed($query)
{
return $query->where('is_passed', true);
}
}