<?php

use App\Enums\OrderStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
    public function up(): void
    {
        DB::table('tbl_order_statuses')->updateOrInsert(
            ['code' => OrderStatus::ListoParaUber->value],
            [
                'name' => OrderStatus::ListoParaUber->label(),
                'is_active' => true,
                'created_at' => now(),
                'updated_at' => now(),
            ]
        );
    }

    public function down(): void
    {
        DB::table('tbl_order_statuses')
            ->where('code', OrderStatus::ListoParaUber->value)
            ->delete();
    }
};