119 lines
4.6 KiB
PHP
119 lines
4.6 KiB
PHP
<?php
|
|
|
|
namespace App\Installer;
|
|
|
|
use App\Enumerations\CostUnitType;
|
|
use App\Enumerations\CronTaskType;
|
|
use App\Enumerations\EatingHabit;
|
|
use App\Enumerations\FirstAidPermission;
|
|
use App\Enumerations\InvoiceStatus;
|
|
use App\Enumerations\InvoiceType;
|
|
use App\Enumerations\SwimmingPermission;
|
|
use App\Enumerations\UserRole;
|
|
use App\Models\Tenant;
|
|
|
|
class ProductionDataSeeder {
|
|
public function execute() {
|
|
$this->installCronTypes();
|
|
$this->installUserRoles();
|
|
$this->installCostUnitTypes();
|
|
$this->installSwimmingPermissions();
|
|
$this->installEatingHabits();
|
|
$this->installFirstAidPermissions();
|
|
$this->installTenants();
|
|
$this->installInvoiceMetaData();
|
|
|
|
|
|
}
|
|
|
|
private function installUserRoles() {
|
|
UserRole::create(['name' => 'Administrator*in', 'slug' => UserRole::USER_ROLE_ADMIN]);
|
|
UserRole::create(['name' => 'Vorstandsmitglied', 'slug' => UserRole::USER_ROLE_GROUP_LEADER]);
|
|
UserRole::create(['name' => 'Benutzer*in', 'slug' => UserRole::USER_ROLE_USER]);
|
|
}
|
|
|
|
private function installSwimmingPermissions() {
|
|
SwimmingPermission::create(['name' => 'Mein Kind darf baden und kann schwimmen', 'slug' => SwimmingPermission::SWIMMING_PERMISSION_ALLOWED]);
|
|
SwimmingPermission::create(['name' => 'Mein Kind darf baden und kann NICHT schwimmen', 'slug' => SwimmingPermission::SWIMMING_PERMISSION_LIMITED]);
|
|
SwimmingPermission::create(['name' => 'Mein Kind darf nicht baden', 'slug' => SwimmingPermission::SWIMMING_PERMISSION_DENIED]);
|
|
}
|
|
|
|
private function installEatingHabits() {
|
|
EatingHabit::create(['name' => 'Vegan', 'slug' => EatingHabit::EATING_HABIT_VEGAN]);
|
|
EatingHabit::create(['name' => 'Vegetarisch', 'slug' => EatingHabit::EATING_HABIT_VEGETARIAN]);
|
|
EatingHabit::create(['name' => 'Omnivor', 'slug' => EatingHabit::EATING_HABIT_OMNIVOR]);
|
|
|
|
}
|
|
private function installFirstAidPermissions() {
|
|
FirstAidPermission::create([
|
|
'name' => 'Zugestimmt',
|
|
'description' => 'Ich STIMME der Anwendung von erweiteren Erste-Hilfe-Maßnahmen an meinem Kind explizit ZU.',
|
|
'slug' => FirstAidPermission::FIRST_AID_PERMISSION_ALLOWED]);
|
|
|
|
FirstAidPermission::create([
|
|
'name' => 'Verweigert',
|
|
'description' => 'Ich LEHNE die Anwendung von erweiteren Erste-Hilfe-Maßnahmen an meinem Kind explizit AB.',
|
|
'slug' => FirstAidPermission::FIRST_AID_PERMISSION_DENIED]);
|
|
}
|
|
|
|
private function installCostUnitTypes() {
|
|
CostUnitType::create(['slug' => CostUnitType::COST_UNIT_TYPE_EVENT, 'name' => 'Veranstaltung']);
|
|
CostUnitType::create(['slug' => CostUnitType::COST_UNIT_TYPE_RUNNING_JOB, 'name' => 'Laufende Tätigkeit']);
|
|
|
|
}
|
|
|
|
private function installTenants() {
|
|
Tenant::create([
|
|
'slug' => 'lv',
|
|
'name' => 'Landesunmittelbare Mitglieder',
|
|
'url' => 'mareike.local',
|
|
'account_name' => 'Bund der Pfadfinder*innen Landesverband Sachsen e.V.',
|
|
'account_iban' => 'DE12345678901234567890',
|
|
'account_bic' => 'GENODEF1S10',
|
|
'email' => 'test@example.com',
|
|
'city' => 'Lommatzsch',
|
|
'postcode' => '01623',
|
|
'is_active_local_group' => true,
|
|
'has_active_instance' => true,
|
|
]);
|
|
}
|
|
|
|
private function installInvoiceMetaData() {
|
|
InvoiceType::create([
|
|
'slug' => InvoiceType::INVOICE_TYPE_TRAVELLING,
|
|
'name' => 'Reisekosten'
|
|
]);
|
|
|
|
InvoiceType::create([
|
|
'slug' => InvoiceType::INVOICE_TYPE_PROGRAM,
|
|
'name' => 'Programmkosten'
|
|
]);
|
|
|
|
InvoiceType::create([
|
|
'slug' => InvoiceType::INVOICE_TYPE_ACCOMMODATION,
|
|
'name' => 'Unterkunftskosten'
|
|
]);
|
|
|
|
InvoiceType::create([
|
|
'slug' => InvoiceType::INVOICE_TYPE_CATERING,
|
|
'name' => 'Verpflegungskosten',
|
|
]);
|
|
|
|
InvoiceType::create([
|
|
'slug' => InvoiceType::INVOICE_TYPE_OTHER,
|
|
'name' => 'Sonstige Kosten'
|
|
]);
|
|
|
|
InvoiceStatus::create(['slug' => InvoiceStatus::INVOICE_STATUS_NEW]);
|
|
InvoiceStatus::create(['slug' => InvoiceStatus::INVOICE_STATUS_APPROVED]);
|
|
InvoiceStatus::create(['slug' => InvoiceStatus::INVOICE_STATUS_EXPORTED]);
|
|
InvoiceStatus::create(['slug' => InvoiceStatus::INVOICE_STATUS_DENIED]);
|
|
InvoiceStatus::create(['slug' => InvoiceStatus::INVOICE_STATUS_DELETED]);
|
|
}
|
|
|
|
private function installCronTypes() {
|
|
CronTaskType::creata(['slug' => CronTaskType::CRON_TASK_TYPE_REALTIME]);
|
|
CronTaskType::creata(['slug' => CronTaskType::CRON_TASK_TYPE_DAILY]);
|
|
}
|
|
}
|