feat:E-Sign 템플릿 변수 시스템 추가 (마이그레이션+모델)
- field_variable, metadata, variables 컬럼 마이그레이션 추가 - EsignContract 모델에 metadata (JSON cast) 추가 - EsignSignField 모델에 field_variable 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,7 @@ class EsignContract extends Model
|
||||
'signed_file_path',
|
||||
'signed_file_hash',
|
||||
'status',
|
||||
'metadata',
|
||||
'expires_at',
|
||||
'completed_at',
|
||||
'created_by',
|
||||
@@ -66,6 +67,7 @@ class EsignContract extends Model
|
||||
|
||||
protected $casts = [
|
||||
'original_file_size' => 'integer',
|
||||
'metadata' => 'array',
|
||||
'expires_at' => 'datetime',
|
||||
'completed_at' => 'datetime',
|
||||
];
|
||||
|
||||
@@ -38,6 +38,7 @@ class EsignSignField extends Model
|
||||
'height',
|
||||
'field_type',
|
||||
'field_label',
|
||||
'field_variable',
|
||||
'font_size',
|
||||
'field_value',
|
||||
'is_required',
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// 템플릿에 변수 정의 JSON 추가
|
||||
Schema::table('esign_field_templates', function (Blueprint $table) {
|
||||
$table->json('variables')->nullable()->after('signer_count');
|
||||
});
|
||||
|
||||
// 템플릿 필드에 변수 참조 추가
|
||||
Schema::table('esign_field_template_items', function (Blueprint $table) {
|
||||
$table->string('field_variable', 50)->nullable()->after('field_label');
|
||||
});
|
||||
|
||||
// 계약에 메타데이터 JSON 추가
|
||||
Schema::table('esign_contracts', function (Blueprint $table) {
|
||||
$table->json('metadata')->nullable()->after('status');
|
||||
});
|
||||
|
||||
// 계약 필드에 변수 참조 추가
|
||||
Schema::table('esign_sign_fields', function (Blueprint $table) {
|
||||
$table->string('field_variable', 50)->nullable()->after('field_label');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('esign_sign_fields', function (Blueprint $table) {
|
||||
$table->dropColumn('field_variable');
|
||||
});
|
||||
|
||||
Schema::table('esign_contracts', function (Blueprint $table) {
|
||||
$table->dropColumn('metadata');
|
||||
});
|
||||
|
||||
Schema::table('esign_field_template_items', function (Blueprint $table) {
|
||||
$table->dropColumn('field_variable');
|
||||
});
|
||||
|
||||
Schema::table('esign_field_templates', function (Blueprint $table) {
|
||||
$table->dropColumn('variables');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user