73 lines
2.7 KiB
PHP
73 lines
2.7 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
/**
|
|
* Gründe, aus denen ein Teil des gezahlten Beitrags beim Verband bleibt.
|
|
*
|
|
* Wird nicht der volle Beitrag erstattet, ist der Rest eine Einnahme, die begründet sein muss -- in der
|
|
* Buchhaltung ist ein einbehaltener Betrag ohne Grund nicht haltbar. Aufgebaut wie
|
|
* {@see \App\Enumerations\RefundReason}: app-weite Stammdaten, `slug` als Schlüssel.
|
|
*/
|
|
return new class extends Migration {
|
|
public function up(): void
|
|
{
|
|
Schema::create('retention_reasons', function (Blueprint $table) {
|
|
$table->string('slug')->primary();
|
|
$table->string('name');
|
|
$table->text('document_text')->nullable();
|
|
$table->boolean('requires_note')->default(false);
|
|
$table->integer('sort_order')->default(0);
|
|
$table->timestamps();
|
|
});
|
|
|
|
DB::table('retention_reasons')->insert([
|
|
[
|
|
'slug' => 'cancellation_fee',
|
|
'name' => 'Stornogebühr laut Ausschreibung',
|
|
'document_text' => 'Einbehalten wurde die in der Ausschreibung genannte Stornogebühr.',
|
|
'requires_note' => false,
|
|
'sort_order' => 10,
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
],
|
|
[
|
|
'slug' => 'incurred_costs',
|
|
'name' => 'Bereits entstandene Kosten',
|
|
'document_text' => 'Einbehalten wurden Kosten, die zum Zeitpunkt der Abmeldung bereits entstanden waren.',
|
|
'requires_note' => false,
|
|
'sort_order' => 20,
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
],
|
|
[
|
|
'slug' => 'material',
|
|
'name' => 'Bereits beschafftes Material',
|
|
'document_text' => 'Einbehalten wurden Kosten für Material, das bereits beschafft wurde.',
|
|
'requires_note' => false,
|
|
'sort_order' => 30,
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
],
|
|
[
|
|
// Der Text entsteht erst aus dem Freitext der Aktionsleitung -- deshalb hier leer.
|
|
'slug' => 'custom',
|
|
'name' => 'Sonstiger Grund',
|
|
'document_text' => null,
|
|
'requires_note' => true,
|
|
'sort_order' => 40,
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
],
|
|
]);
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('retention_reasons');
|
|
}
|
|
};
|