feat: Initialize core application structure including authentication, role-based dashboards, service task management, and integration workflows.
This commit is contained in:
68
database/seeders/IntegrationTemplateSeeder.php
Normal file
68
database/seeders/IntegrationTemplateSeeder.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\IntegrationTemplate;
|
||||
use App\Models\Service;
|
||||
use App\Models\TemplateServiceItem;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class IntegrationTemplateSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$template = IntegrationTemplate::firstOrCreate([
|
||||
'name' => 'Agent Standard',
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$services = Service::all();
|
||||
|
||||
foreach ($services as $service) {
|
||||
if ($service->name === 'DSI') {
|
||||
$template->serviceItems()->create([
|
||||
'service_id' => $service->id,
|
||||
'label' => 'Création compte AD',
|
||||
'is_mandatory' => true,
|
||||
]);
|
||||
$template->serviceItems()->create([
|
||||
'service_id' => $service->id,
|
||||
'label' => 'Attribution Ordinateur',
|
||||
'is_mandatory' => true,
|
||||
]);
|
||||
$template->serviceItems()->create([
|
||||
'service_id' => $service->id,
|
||||
'label' => 'Création email',
|
||||
'is_mandatory' => true,
|
||||
]);
|
||||
$template->serviceItems()->create([
|
||||
'service_id' => $service->id,
|
||||
'label' => 'Affectation Téléphonie Fixe',
|
||||
'is_mandatory' => false,
|
||||
]);
|
||||
$template->serviceItems()->create([
|
||||
'service_id' => $service->id,
|
||||
'label' => 'Affectation Téléphone mobile',
|
||||
'is_mandatory' => false,
|
||||
]);
|
||||
$template->serviceItems()->create([
|
||||
'service_id' => $service->id,
|
||||
'label' => 'Accès au SIG',
|
||||
'is_mandatory' => false,
|
||||
]);
|
||||
} elseif ($service->name === 'Batiment') {
|
||||
$template->serviceItems()->create([
|
||||
'service_id' => $service->id,
|
||||
'label' => 'Attribution Badge',
|
||||
'is_mandatory' => true,
|
||||
]);
|
||||
} elseif ($service->name === 'ParcAuto') {
|
||||
$template->serviceItems()->create([
|
||||
'service_id' => $service->id,
|
||||
'label' => 'Création compte vehicule',
|
||||
'is_mandatory' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user