<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
    public function up(): void
    {
        DB::table('settings')->insert([
            'key' => 'CONSUMABLES_LOW_STOCK_THRESHOLD',
            'environment' => '',
            'type' => 'int',
            'value' => '10',
            'module' => 'CONSUMABLES',
            'description' => 'Stock level at or below which a consumable is flagged as low stock',
            'created_at' => now(),
            'updated_at' => now(),
        ]);
    }

    public function down(): void
    {
        DB::table('settings')->where('key', 'CONSUMABLES_LOW_STOCK_THRESHOLD')->delete();
    }
};
