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:
parent
389d5d1820
commit
e3dc1afd8e
165 changed files with 21914 additions and 3516 deletions
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Modul 6 — Angebote: Ticket A1 / Migration 1 von 7.
|
||||
*
|
||||
* Erstellt die Haupttabelle `offers`. Jeder Datensatz hier ist ein
|
||||
* logisches Angebot (eine Angebotsnummer). Die tatsächlichen Inhalte
|
||||
* (Texte, Positionen, Preise, PDF, Dokumente) liegen versionsweise in
|
||||
* `offer_versions`. Ab dem ersten Versand erzeugt jede Änderung eine
|
||||
* neue Version (Entscheidung 17.1 des Entwicklungsplans).
|
||||
*
|
||||
* VORBEDINGUNG:
|
||||
* - Modul 3 Phase 2 (Tabellen `contacts` + `inquiries`) muss
|
||||
* eingespielt sein. Siehe dev/customer-bookings/umsetzung.md.
|
||||
*
|
||||
* Tabelle `offers.current_version_id` wird als FK erst in der Migration
|
||||
* 2026_04_17_100007 gesetzt (zyklische Abhängigkeit zu `offer_versions`).
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('offers', function (Blueprint $t) {
|
||||
$t->id();
|
||||
$t->string('offer_number', 32)->unique();
|
||||
|
||||
$t->foreignId('contact_id')
|
||||
->constrained('contacts')
|
||||
->restrictOnDelete();
|
||||
|
||||
$t->foreignId('inquiry_id')
|
||||
->nullable()
|
||||
->constrained('inquiries')
|
||||
->nullOnDelete();
|
||||
|
||||
$t->foreignId('booking_id')
|
||||
->nullable()
|
||||
->constrained('booking')
|
||||
->nullOnDelete();
|
||||
|
||||
$t->enum('status', [
|
||||
'draft',
|
||||
'sent',
|
||||
'accepted',
|
||||
'declined',
|
||||
'expired',
|
||||
'withdrawn',
|
||||
])->default('draft');
|
||||
|
||||
// FK wird in 2026_04_17_100007 nachträglich gesetzt
|
||||
$t->unsignedBigInteger('current_version_id')->nullable();
|
||||
|
||||
$t->foreignId('created_by')->constrained('users');
|
||||
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->index(['status', 'contact_id']);
|
||||
$t->index('inquiry_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('offers');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue