diff --git a/app/Models/ESign/EsignContract.php b/app/Models/ESign/EsignContract.php index e519134..a5bcfb3 100644 --- a/app/Models/ESign/EsignContract.php +++ b/app/Models/ESign/EsignContract.php @@ -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', ]; diff --git a/app/Models/ESign/EsignSignField.php b/app/Models/ESign/EsignSignField.php index 8b8139b..0e52ed9 100644 --- a/app/Models/ESign/EsignSignField.php +++ b/app/Models/ESign/EsignSignField.php @@ -38,6 +38,7 @@ class EsignSignField extends Model 'height', 'field_type', 'field_label', + 'field_variable', 'font_size', 'field_value', 'is_required', diff --git a/database/migrations/2026_02_13_080000_add_variable_system_to_esign_tables.php b/database/migrations/2026_02_13_080000_add_variable_system_to_esign_tables.php new file mode 100644 index 0000000..b45df30 --- /dev/null +++ b/database/migrations/2026_02_13_080000_add_variable_system_to_esign_tables.php @@ -0,0 +1,50 @@ +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'); + }); + } +};