- field_variable, metadata, variables 컬럼 마이그레이션 추가 - EsignContract 모델에 metadata (JSON cast) 추가 - EsignSignField 모델에 field_variable 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
71 lines
1.6 KiB
PHP
71 lines
1.6 KiB
PHP
<?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_variable',
|
|
'font_size',
|
|
'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',
|
|
'font_size' => 'integer',
|
|
'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');
|
|
}
|
|
}
|