<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('sewas', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->onDelete('cascade');
            $table->foreignId('paket_id')->constrained()->onDelete('cascade');
            $table->datetime('tanggal_mulai');
            $table->datetime('tanggal_selesai');
            $table->string('lokasi');
            $table->text('catatan')->nullable();
            $table->decimal('total_harga', 10, 2);
            $table->enum('status', ['pending', 'confirmed', 'completed', 'cancelled', 'chat_only']);
            $table->timestamps();
        });
    }

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