21-11-2025

This commit is contained in:
Kevin Adametz 2025-11-21 18:21:23 +01:00
parent fa2ebd457d
commit 07959c0ba2
113 changed files with 4730 additions and 898 deletions

View file

@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('partners', function (Blueprint $table) {
$table->id();
$table->string('company_name');
$table->string('slug')->unique();
// Partner-Typ (gemäß Wissensbasis)
$table->string('type'); // 'Retailer', 'Manufacturer', 'Estate-Agent'
// Hub-Zugehörigkeit (kann NULL sein für "globale" Hersteller)
$table->foreignId('hub_id')->nullable()->constrained()->onDelete('set null');
$table->text('description')->nullable();
$table->string('logo_url')->nullable();
$table->boolean('is_active')->default(false);
// Spezifische Felder für 'Retailer' (Händler)
$table->integer('delivery_radius_km')->nullable();
$table->integer('assembly_radius_km')->nullable();
// Flexible Provisions-Engine (pro Partner)
// Speichert den Wert in Cents, um Rundungsfehler zu vermeiden
$table->integer('provision_fixed_amount')->nullable();
// Speichert als 10.5 für 10.5%
$table->decimal('provision_rate_percentage', 5, 2)->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('partners');
}
};