feat: add UrgencyLevelSeeder with 4 default urgency levels

This commit is contained in:
Ghassan Yusuf 2026-05-24 09:53:01 +03:00
parent f8dc7f6d1c
commit 70db1184c8
2 changed files with 29 additions and 0 deletions

View File

@ -31,5 +31,7 @@ class DatabaseSeeder extends Seeder
foreach ($warehouses as $wh) {
Warehouse::firstOrCreate(['code' => $wh['code']], $wh);
}
$this->call(UrgencyLevelSeeder::class);
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace Database\Seeders;
use App\Models\Settings\UrgencyLevel;
use Illuminate\Database\Seeder;
class UrgencyLevelSeeder extends Seeder
{
public function run(): void
{
if (UrgencyLevel::count() > 0) {
return;
}
$levels = [
['label' => 'Critical', 'emoji' => '🚨', 'color_bg' => '#fee2e2', 'color_text' => '#dc2626', 'subtitle' => 'Today', 'sort_order' => 1, 'show_date_picker' => false],
['label' => 'Urgent', 'emoji' => '⚡', 'color_bg' => '#ffedd5', 'color_text' => '#ea580c', 'subtitle' => '13 days', 'sort_order' => 2, 'show_date_picker' => false],
['label' => 'Normal', 'emoji' => '📋', 'color_bg' => '#fef9c3', 'color_text' => '#ca8a04', 'subtitle' => 'This week', 'sort_order' => 3, 'show_date_picker' => false],
['label' => 'Planned', 'emoji' => '🗓️', 'color_bg' => '#f0fdf4', 'color_text' => '#16a34a', 'subtitle' => 'Pick date', 'sort_order' => 4, 'show_date_picker' => true],
];
foreach ($levels as $level) {
UrgencyLevel::create(array_merge($level, ['is_active' => true]));
}
}
}