Files
laravel-backend/database/seeds/ChecklistSeeder.php
Joris Slagter df155bb13d
Some checks failed
continuous-integration/drone/push Build is failing
Initial Laravel API import
- Complete GGZ Ecademy Laravel backend application
- RESTful API for learning products, members, filters
- Authentication and authorization system
- Database migrations and seeders
- Custom CRUD generator commands
- Email notification system
- Integration with frontend applications
2025-12-02 17:40:21 +01:00

160 lines
5.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use App\Services\ChecklistCategoryService;
use App\Services\ChecklistService;
use Illuminate\Support\Arr;
use Illuminate\Database\Seeder;
class ChecklistSeeder extends Seeder
{
private $checklistCategoryService;
public function __construct(
ChecklistCategoryService $checklistCategoryService,
ChecklistService $checklistService
) {
$this->checklistCategoryService = $checklistCategoryService;
$this->checklistService = $checklistService;
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$checklists = [
[
'title' => 'Akkoord',
'items' => [
'Inhoudelijk',
'Technisch',
'Totaal'
]
],
[
'title' => 'Oplevering ontwikkelomgeving',
'items' => [
'Statusletter aanpassen',
'Publiceren',
'Extern ID aanpassen',
'PE Online ID ingevuld',
]
],
[
'title' => 'Voor oplevering',
'items' => [
'Releasenote op support plaatsen',
'Toetsvragen beveiligen',
'Toetsvragen in productinfo op support plaatsen',
'Productinfo (incl blauwdruk) op support plaatsen ',
'Info voor catalogusproduct maken (tegeltekst n evt. toelichting)',
'Implementatie-info op support plaatsen',
'Akkoordmelding leverancier + versturen opleverdocument',
]
],
[
'title' => 'Beschikbaar stellen leden ontwikkelomgeving',
'items' => [
'Beschikbaar stellen in subomgeving van alle leden type A, B of C',
'Beschikbaar stellen in subomgeving van alle leden type E',
'Uitvoering maken en beschikbaar stellen in inkijkexemplaar',
'Uitvoering en catalogusproduct maken en beschikbaar stellen in leeromgeving voor derden',
'Beschikbaar stellen in subomgeving van leden type D en docentenomgeving',
]
],
[
'title' => 'Productcatalogus en -monitor',
'items' => [
'Productinfo plaatsen in productcatalogus',
'Verplaatsen uit In ontwikkeling',
'Controleren of de juiste informatie is doorgevoerd in de productadministratie/ op support',
'Evt. forumberichten onder Leerproducten in ontwikkeling verplaatsen',
]
],
[
'title' => 'Communicatie',
'items' => [
'CLP nieuwsflits naar beheerders van subomgevingen en medewerkers GGZ Ecademy',
'E-mail naar functioneel beheer scholen met -indien van toepassing- LTI gegevens',
'Bericht voor infomail',
'Bericht op site evt. SM',
'Bericht in nieuwsbrief',
]
],
[
'title' => 'Blauwdruk en trailer',
'items' => [
'Aangepaste blauwdruk ontvangen',
'Vragenlijst/ Voice-over trailer goedgekeurd',
'Trailer ontvangen van leverancier',
'Trailer plaatsen op mediasite',
'Trailer plaatsen in product-catalogus van website',
'Trailer plaatsen in catalogus van inkijkexemplaar in aNS',
'Trailer in product-informatie op support',
]
],
[
'title' => 'Bestandsbeheer',
'items' => [
'Opleverdocument leverancier checken',
'Ontvangen bronbestanden op de juiste plek neerzetten ',
'Catalogus- en banner afbeelding',
'SP-mappen opschonen',
'Oude, niet gepubliceerde templates archiveren (uitvoeringen einddatum instellen)',
]
],
[
'title' => 'Accreditatie',
'items' => [
'Accreditatieinfo aanvragen + op een rij zetten',
'Accreditatie-overzicht updaten',
'Accreditatie-overzicht op support zetten',
'Info over accreditatie toevoegen aan product-catalogus',
]
],
[
'title' => 'Na afloop',
'items' => [
'Terugkoppelen bevindingen naar melder',
'Afhandelen bevindingen/ tickets in FD',
'Evaluatie inplannen',
]
],
];
foreach ($checklists as $checklist) {
// Create category
$category = $this->checklistCategoryService->save(Arr::except($checklist, ['items']));
// Create checklist items to attach to that category
if (isset($checklist['items'])) {
foreach ($checklist['items'] as $item) {
$data = [];
if (is_string($item)) {
$data = [
'title' => $item,
'checklist_category_id' => $category->id
];
} elseif (Arr::isAssoc($item)) {
foreach ($item as $key => $value) {
$data[$key] = $value;
}
$data['checklist_category_id'] = $category->id;
}
$new_checklist = $this->checklistService->save($data);
}
}
}
}
}