Creating Participation refunds
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Gründe für die Erstattung eines Teilnahmebeitrags -- DB-gestützt wie die Befreiungsgründe der
|
||||
* Umsatzsteuer, damit Label und der auf dem Beleg erscheinende Text zentral pflegbar sind.
|
||||
*
|
||||
* App-weit und ohne `tenant`-Spalte: die Gründe sind Stammdaten, mandantenspezifisch ist nur der
|
||||
* einzelne Erstattungsvorgang.
|
||||
*/
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('refund_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('refund_reasons')->insert([
|
||||
[
|
||||
'slug' => 'sickness',
|
||||
'name' => 'Krankheitsbedingte Absage',
|
||||
'document_text' => 'Die Teilnahme konnte krankheitsbedingt nicht angetreten werden.',
|
||||
'requires_note' => false,
|
||||
'sort_order' => 10,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
[
|
||||
'slug' => 'event_cancelled',
|
||||
'name' => 'Ausfall der Veranstaltung',
|
||||
'document_text' => 'Die Veranstaltung wurde abgesagt und konnte nicht stattfinden.',
|
||||
'requires_note' => false,
|
||||
'sort_order' => 20,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
[
|
||||
// Der Text entsteht erst aus dem Freitext der Aktionsleitung -- deshalb hier leer.
|
||||
'slug' => 'other',
|
||||
'name' => 'Sonstiger Grund',
|
||||
'document_text' => null,
|
||||
'requires_note' => true,
|
||||
'sort_order' => 30,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('refund_reasons');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user