WIP: Sicherheitsnetz vor Phase-1-R\u00fcckbau

Enth\u00e4lt gemischt: Laravel-10-Upgrade + Phase 1 (Contacts-Modul, Duplicats-Commands,
Soft-Delete+Merge-Fields) + Phase 2 Code-Umstellungen (inquiry_id, $table='contacts'/'inquiries')
+ Offers-Modul (Migrationen, Models, offer_id in Booking, offer-Disk in filesystems.php).

Phase 2 + Offers werden im folgenden Commit nach dev/backups/phase2-offers-2026-04-17/
verschoben, damit der Workspace auf Phase-1-only (= Test-System-Stand) reduziert ist
und direkt auf Live deploybar wird.

Tarball-Backup zus\u00e4tzlich unter: ../backups-safety/workspace-pre-phase1-rollback-2026-04-17.tar.gz

Made-with: Cursor
This commit is contained in:
Phase-1-Rollback-Agent 2026-04-17 13:40:31 +00:00
parent 389d5d1820
commit e3dc1afd8e
165 changed files with 21914 additions and 3516 deletions

View file

@ -9,6 +9,7 @@ namespace App\Models;
use Carbon\Carbon;
use App\Services\Util;
use App\Services\Passolution;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Collection;
@ -18,7 +19,7 @@ use Illuminate\Database\Eloquent\Collection;
* @property int $id
* @property Carbon $booking_date
* @property int $customer_id
* @property int $lead_id
* @property int $inquiry_id
* @property bool $new_drafts
* @property int $sf_guard_user_id
* @property int $branch_id
@ -203,13 +204,16 @@ use Illuminate\Database\Eloquent\Collection;
*/
class Booking extends Model
{
use HasFactory;
protected $connection = 'mysql';
protected $table = 'booking';
protected $casts = [
'customer_id' => 'int',
'lead_id' => 'int',
'inquiry_id' => 'int',
'offer_id' => 'int',
'new_drafts' => 'bool',
'sf_guard_user_id' => 'int',
'branch_id' => 'int',
@ -237,25 +241,24 @@ class Booking extends Model
'is_rail_fly' => 'bool',
'comfort' => 'bool',
'airline_ids' => 'array',
'participant_pass' => 'bool'
];
'participant_pass' => 'bool',
'booking_date' => 'datetime',
'start_date' => 'datetime',
'end_date' => 'datetime',
'participant_birthdate' => 'datetime',
'final_payment_date' => 'datetime',
'refund_date' => 'datetime',
'lawyer_date' => 'datetime',
'xx_tkt_date' => 'datetime',
];
protected $dates = [
'booking_date',
'start_date',
'end_date',
'participant_birthdate',
'final_payment_date',
'refund_date',
'lawyer_date',
'xx_tkt_date'
];
protected $fillable = [
'booking_date',
'customer_id',
'lead_id',
'inquiry_id',
'offer_id',
'new_drafts',
'sf_guard_user_id',
'branch_id',
@ -392,9 +395,29 @@ class Booking extends Model
return $this->belongsTo(Customer::class);
}
/**
* Lead/Inquiry der Buchung.
* FK-Spalte `inquiry_id` (vormals `lead_id` Modul 3 Phase 2 Rename).
* Methodenname bleibt `lead()` für Legacy-Kompatibilität; {@see self::inquiry()}
* ist der fachlich korrekte Alias und sollte in neuem Code verwendet werden.
*/
public function lead()
{
return $this->belongsTo(Lead::class);
return $this->belongsTo(Lead::class, 'inquiry_id');
}
public function inquiry()
{
return $this->belongsTo(Lead::class, 'inquiry_id');
}
/**
* Angebot, aus dem diese Buchung entstanden ist (Modul 6, Ticket B8).
* Nullable nicht jede Buchung hat einen Angebots-Vorlauf.
*/
public function offer()
{
return $this->belongsTo(\App\Models\Offer::class);
}
public function sf_guard_user()