feat(ticket): add refundable terminal states
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?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::table('tickets', function (Blueprint $table): void {
|
||||
$table->dateTime('disabled_at')->nullable()->after('used_at');
|
||||
$table->dateTime('cancelled_at')->nullable()->after('disabled_at');
|
||||
$table->dateTime('refunded_at')->nullable()->after('cancelled_at');
|
||||
});
|
||||
|
||||
Schema::table('compra_items', function (Blueprint $table): void {
|
||||
$table->decimal('refunded_amount', 10, 2)->default(0)->after('total');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('compra_items', function (Blueprint $table): void {
|
||||
$table->dropColumn('refunded_amount');
|
||||
});
|
||||
|
||||
Schema::table('tickets', function (Blueprint $table): void {
|
||||
$table->dropColumn([
|
||||
'disabled_at',
|
||||
'cancelled_at',
|
||||
'refunded_at',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user