<?php

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

class CreateEmployeesTable extends Migration
{
    public function up()
    {
        Schema::create('employees', function (Blueprint $table) {
            $table->id();
            $table->string('emp_id')->unique();          // EMP-001
            $table->string('name');
            $table->string('role');
            $table->string('department');                // Sales, Marketing, Support, Technical, Management
            $table->string('phone');
            $table->string('email')->nullable();
            $table->enum('status', ['Active', 'Inactive'])->default('Active');
            $table->date('join_date')->nullable();
            $table->integer('target')->default(20);      // leads/month target
            $table->string('avatar_color')->default('#1a73e8');
            $table->text('notes')->nullable();
            $table->timestamps();
        });
    }

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