<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('client_contract', function (Blueprint $table)
        {
            $table->id();
            $table->foreignId('deal_id')->references('id')->on('deals')->onDelete('cascade');
            $table->enum('status', ['NEW', 'DECLINE', 'TREATY', 'SUCCESS', 'RESERVATION'])->default('NEW');
            $table->string('comment')->nullable();
            $table->double('price')->nullable();
            $table->double('reward')->nullable();
            $table->float('square')->nullable();
            $table->integer('floor')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('client_contract');
    }
};
