164 lines
6.5 KiB
PHP
164 lines
6.5 KiB
PHP
<?php
|
|
|
|
namespace App\Installer;
|
|
|
|
use App\Enumerations\CostUnitType;
|
|
use App\Enumerations\CronTaskType;
|
|
use App\Enumerations\EatingHabit;
|
|
use App\Enumerations\EfzStatus;
|
|
use App\Enumerations\FirstAidPermission;
|
|
use App\Enumerations\InvoiceStatus;
|
|
use App\Enumerations\InvoiceType;
|
|
use App\Enumerations\ParticipationFeeType;
|
|
use App\Enumerations\ParticipationType;
|
|
use App\Enumerations\SwimmingPermission;
|
|
use App\Enumerations\UserRole;
|
|
use App\Models\CronTask;
|
|
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();
|
|
$this->installParticipationFeeTypes();
|
|
$this->installParticipationTypes();
|
|
$this->installEfzStatus();
|
|
$this->installCronTasks();
|
|
}
|
|
|
|
private function installEfzStatus() {
|
|
EfzStatus::create(['slug' => EfzStatus::EFZ_STATUS_NOT_CHECKED, 'name' => 'Nicht geprüft']);
|
|
EfzStatus::create(['slug' => EfzStatus::EFZ_STATUS_NOT_REQUIRED, 'name' => 'Nicht erforderlich']);
|
|
EfzStatus::create(['slug' => EfzStatus::EFZ_STATUS_CHECKED_VALID, 'name' => 'Geprüft und gültig']);
|
|
EfzStatus::create(['slug' => EfzStatus::EFZ_STATUS_CHECKED_INVALID, 'name' => 'Geprüft und ungültig']);
|
|
}
|
|
|
|
private function installParticipationTypes() {
|
|
ParticipationType::create([
|
|
'slug' => ParticipationType::PARTICIPATION_TYPE_PARTICIPANT,
|
|
'name' => 'Teilnehmende'
|
|
]);
|
|
|
|
ParticipationType::create([
|
|
'slug' => ParticipationType::PARTICIPATION_TYPE_TEAM,
|
|
'name' => 'Kernteam'
|
|
]);
|
|
|
|
ParticipationType::create([
|
|
'slug' => ParticipationType::PARTICIPATION_TYPE_VOLUNTEER,
|
|
'name' => 'Unterstützende'
|
|
]);
|
|
|
|
ParticipationType::create([
|
|
'slug' => ParticipationType::PARTICIPATION_TYPE_OTHER,
|
|
'name' => 'Sonstige'
|
|
]);
|
|
}
|
|
|
|
private function installParticipationFeeTypes() {
|
|
ParticipationFeeType::create(['slug' => ParticipationFeeType::PARTICIPATION_FEE_TYPE_SOLIDARITY, 'name' => 'Solidaritätsprinzip']);
|
|
ParticipationFeeType::create(['slug' => ParticipationFeeType::PARTICIPATION_FEE_TYPE_FIXED, 'name' => 'Festpreis']);
|
|
}
|
|
|
|
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::create(['slug' => CronTaskType::CRON_TASK_TYPE_REALTIME]);
|
|
CronTaskType::create(['slug' => CronTaskType::CRON_TASK_TYPE_DAILY]);
|
|
}
|
|
|
|
private function installCronTasks() {
|
|
CronTask::create(['name' => 'UploadInvoices', 'execution_type' => CronTaskType::CRON_TASK_TYPE_REALTIME]);
|
|
}
|
|
}
|
|
|