Files
fewo-stommer/database/migrations/2026_11_03_090000_create_case_intake.php
LarsandClaude Opus 5.5 ac9d20b812 Ein Eingang fuer alle Kanaele (Paket 4, Prozessarchitektur v0.10)
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>
2026-11-01 20:53:35 +01:00

63 lines
2.7 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;
/**
* 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');
});
}
};