Bugfixes & Model for participants

This commit is contained in:
2026-02-17 21:58:55 +01:00
parent fcf41c5d13
commit b1c333648a
14 changed files with 334 additions and 56 deletions

View File

@@ -23,13 +23,13 @@ return new class extends Migration {
Schema::create('invoices', function (Blueprint $table) {
$table->id();
$table->string('tenant');
$table->foreignId('cost_unit_id')->constrained('cost_units', 'id')->cascadeOnDelete()->cascadeOnUpdate();
$table->foreignId('cost_unit_id')->constrained('cost_units', 'id')->restrictOnDelete()->cascadeOnUpdate();
$table->foreignId('user_id')->nullable()->constrained('users', 'id')->restrictOnDelete()->cascadeOnUpdate();
$table->string('invoice_number');
$table->string('status');
$table->string('type');
$table->string('type_other')->nullable();
$table->boolean('donation')->default(false);
$table->foreignId('user_id')->nullable()->constrained('users', 'id')->cascadeOnDelete()->cascadeOnUpdate();
$table->string('contact_name');
$table->string('contact_email')->nullable();
$table->string('contact_phone')->nullable();
@@ -43,16 +43,16 @@ return new class extends Migration {
$table->boolean('passengers')->nullable();
$table->boolean('transportation')->nullable();
$table->string('document_filename')->nullable();
$table->foreignId('approved_by')->nullable()->constrained('users', 'id')->cascadeOnDelete()->cascadeOnUpdate();
$table->foreignId('approved_by')->nullable()->constrained('users', 'id')->restrictOnDelete()->cascadeOnUpdate();
$table->dateTime('approved_at')->nullable();
$table->boolean('upload_required')->default(false);
$table->foreignId('denied_by')->nullable()->constrained('users', 'id')->cascadeOnDelete()->cascadeOnUpdate();
$table->foreignId('denied_by')->nullable()->constrained('users', 'id')->restrictOnDelete()->cascadeOnUpdate();
$table->dateTime('denied_at')->nullable();
$table->string('denied_reason')->nullable();
$table->foreign('tenant')->references('slug')->on('tenants')->cascadeOnDelete()->cascadeOnUpdate();
$table->foreign('type')->references('slug')->on('invoice_types')->cascadeOnDelete()->cascadeOnUpdate();
$table->foreign('status')->references('slug')->on('invoice_status')->cascadeOnDelete()->cascadeOnUpdate();
$table->foreign('tenant')->references('slug')->on('tenants')->restrictOnDelete()->cascadeOnUpdate();
$table->foreign('type')->references('slug')->on('invoice_types')->restrictOnDelete()->cascadeOnUpdate();
$table->foreign('status')->references('slug')->on('invoice_status')->restrictOnDelete()->cascadeOnUpdate();
$table->timestamps();
});