feat(ticket): add refund transaction model

This commit is contained in:
2026-09-14 11:57:06 -03:00
parent a62e989bb4
commit adec5d1725
4 changed files with 116 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?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
{
Schema::create('ticket_refunds', function (Blueprint $table): void {
$table->id();
$table->foreignId('ticket_id')->unique()->constrained('tickets')->cascadeOnDelete();
$table->foreignId('purchase_item_id')->constrained('compra_items')->restrictOnDelete();
$table->foreignId('created_by_user_id')->nullable()->constrained('users')->nullOnDelete();
$table->string('type', 16);
$table->decimal('amount', 10, 2);
$table->timestamps();
$table->index(['purchase_item_id', 'type']);
});
}
public function down(): void
{
Schema::dropIfExists('ticket_refunds');
}
};