<?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::table('users', function (Blueprint $table) {
            $table->enum('role', ['admin', 'manager', 'therapist', 'receptionist'])->default('therapist')->after('email');
            $table->string('specialization')->nullable()->after('role');
            $table->decimal('hourly_rate', 10, 2)->nullable()->after('specialization');
            $table->decimal('session_rate', 10, 2)->nullable()->after('hourly_rate');
            $table->integer('target_sessions_per_day')->nullable()->after('session_rate');
            $table->integer('target_sessions_per_month')->nullable()->after('target_sessions_per_day');
            $table->json('working_schedule')->nullable()->after('target_sessions_per_month');
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn(['role', 'specialization', 'hourly_rate', 'session_rate', 'target_sessions_per_day', 'target_sessions_per_month', 'working_schedule']);
        });
    }
};
