<?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('notifications', function (Blueprint $table) {
            $table->id();
            $table->string('for_role');         // 'gudang', 'cs', 'admin'
            $table->integer('for_user_id')->nullable(); // null = semua role
            $table->string('judul');
            $table->string('pesan');
            $table->string('icon')->default('ti-bell');
            $table->string('warna')->default('#E8748A');
            $table->integer('sale_id')->nullable();
            $table->boolean('dibaca')->default(false);
            $table->timestamps();
        });
    }

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