Files
fewo-stommer/database/migrations/2026_11_06_110000_create_data_requests.php
LarsandClaude Opus 5.5 e4a3cb7f7b v0.11 U4: Rückfrage, Folgefrage, Erinnerung und Ergänzungslink
- data_requests: ein Beschaffungsvorgang je Vorgang mit Modus
  (automatisch / Freigabe / manuell), getrennten Zählern für Folgefragen
  und Erinnerungen ohne Rücksetzen, Antwortfrist ≠ Reservierungsfrist.
- RequestCaseData: fragt nach, was für das nächste Angebot, die
  Wunschbestätigung oder (bei verbindlichen Buchungen) administrativ fehlt;
  ohne E-Mail keine Rückfrage. Teilantwort → gezielte Folgefrage, Schweigen
  → Erinnerungen, an der Grenze Aufgabe für die Vermieterin. Nie ein Hold.
- Mail DataRequested mit Texten nach tatsächlichem Sperrstatus (M11);
  Dokumentart „Rückfrage“ – im Live-Betrieb ohne Freigabe nur nach Klick.
- Signierter, versionierter Ergänzungslink (/angebot/angaben): Lesen
  schreibt nicht, Absenden über den Fakteneingang, idempotent.
- Vorgang: „Rückfrage an den Gast senden“ / „Rückfrage beenden“;
  Eingangsbestätigung nennt die Klärungsreservierung korrekt.
- Zeitplan: cases:data-requests alle fünf Minuten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:25:48 +01:00

54 lines
2.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Prozessarchitektur v0.11, data request (S1/S4, CH-15–CH-18): one coherent request for missing details of a case –
* first question, targeted follow-up questions and reminders with their own counters that are never reset, the answer
* deadline (which is not a reservation deadline) and the version of the guest's link.
*/
return new class extends Migration
{
public function up(): void
{
Schema::create('data_requests', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->nullable()->constrained()->cascadeOnDelete();
$table->foreignId('booking_id')->constrained()->cascadeOnDelete();
$table->string('status', 20);
$table->string('mode', 20);
$table->string('purpose', 30);
$table->json('fields');
$table->unsignedTinyInteger('followups_sent')->default(0);
$table->unsignedTinyInteger('reminders_sent')->default(0);
$table->unsignedSmallInteger('link_version')->default(1);
$table->string('last_message', 20)->nullable();
$table->dateTime('last_sent_at')->nullable();
$table->dateTime('response_due_at')->nullable();
$table->dateTime('next_reminder_at')->nullable();
$table->dateTime('answered_at')->nullable();
$table->dateTime('closed_at')->nullable();
$table->string('closed_reason')->nullable();
$table->timestamps();
$table->index(['booking_id', 'status']);
$table->index(['status', 'next_reminder_at']);
});
Schema::table('booking_messages', function (Blueprint $table) {
$table->string('message_id')->nullable()->after('subject')->index();
});
}
public function down(): void
{
Schema::table('booking_messages', function (Blueprint $table) {
$table->dropColumn('message_id');
});
Schema::dropIfExists('data_requests');
}
};