<?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('unlock_orders', function (Blueprint $table) {
            $table->id();
            $table->foreignId('shop_user_id')->constrained('shop_users')->cascadeOnDelete();
            $table->string('customer_name');
            $table->string('phone_number');
            $table->string('device_model');
            $table->string('imei_number');
            $table->enum('service_type', ['frp', 'icloud', 'network', 'mdm']);
            $table->text('note')->nullable();
            $table->enum('status', ['pending', 'in_progress', 'done'])->default('pending');
            $table->decimal('service_price', 8, 2)->default(0);
            $table->date('date');
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('unlock_orders');
    }
};
