Portalbuchungen und -anfragen aus Kalender und Mail werden ueber PortalIntake zum Vorgang (nur bei sicherer Erkennung), Dubletten ueber Buchungsnummer, gleiches Portal mit gleichen Naechten und Spiegelung; Unsicheres wird geklaert. Portalstorno und -aenderung als Aufgabe am Vorgang ohne stille Stornierung. Schalter je Kanal (Aus als Standard, Beobachten, Anlegen, Anlegen + weiter), Eingangsprotokoll, Bestandsuebernahme mit Vorschau/Bericht/Ruecknahme, Sperrnachweis in drei Stufen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
63 lines
2.7 KiB
PHP
63 lines
2.7 KiB
PHP
<?php
|
||
|
||
use Illuminate\Database\Migrations\Migration;
|
||
use Illuminate\Database\Schema\Blueprint;
|
||
use Illuminate\Support\Facades\Schema;
|
||
|
||
/**
|
||
* Package 4 of UMSETZUNGSPLAN_v0.10 (one intake for all channels): every channel says whether recognised portal
|
||
* bookings become cases by themselves – off (default for every existing and new channel), observe, or create –, what
|
||
* the intake recognised is recorded, and portal tasks record how far a block on the portal is proven. Purely additive.
|
||
*/
|
||
return new class extends Migration
|
||
{
|
||
public function up(): void
|
||
{
|
||
Schema::table('channels', function (Blueprint $table): void {
|
||
$table->string('case_intake', 12)->default('off');
|
||
});
|
||
|
||
Schema::create('intake_observations', function (Blueprint $table): void {
|
||
$table->id();
|
||
$table->foreignId('tenant_id')->nullable()->constrained()->cascadeOnDelete();
|
||
$table->foreignId('channel_id')->constrained()->cascadeOnDelete();
|
||
$table->foreignId('blocked_period_id')->nullable()->constrained()->nullOnDelete();
|
||
$table->foreignId('portal_email_id')->nullable()->constrained()->nullOnDelete();
|
||
$table->foreignId('booking_id')->nullable()->constrained()->nullOnDelete();
|
||
$table->string('fingerprint', 64);
|
||
$table->string('source', 12);
|
||
$table->string('mode', 12);
|
||
$table->string('outcome', 20);
|
||
$table->boolean('applied')->default(false);
|
||
$table->string('case_type', 4)->nullable();
|
||
$table->date('starts_on')->nullable();
|
||
$table->date('ends_on')->nullable();
|
||
$table->string('reference', 100)->nullable();
|
||
$table->json('reasons')->nullable();
|
||
$table->json('missing')->nullable();
|
||
$table->timestamp('occurred_at');
|
||
$table->timestamps();
|
||
$table->unique(['tenant_id', 'fingerprint']);
|
||
$table->index(['channel_id', 'occurred_at']);
|
||
});
|
||
|
||
Schema::table('channel_tasks', function (Blueprint $table): void {
|
||
$table->string('proof', 12)->nullable();
|
||
$table->text('proof_note')->nullable();
|
||
$table->timestamp('proof_at')->nullable();
|
||
$table->string('proof_by')->nullable();
|
||
});
|
||
}
|
||
|
||
public function down(): void
|
||
{
|
||
Schema::table('channel_tasks', function (Blueprint $table): void {
|
||
$table->dropColumn(['proof', 'proof_note', 'proof_at', 'proof_by']);
|
||
});
|
||
Schema::dropIfExists('intake_observations');
|
||
Schema::table('channels', function (Blueprint $table): void {
|
||
$table->dropColumn('case_intake');
|
||
});
|
||
}
|
||
};
|