Pakete 7 und 9 abgeschlossen: Wirksamkeit, Browserbefunde, Gesamtabnahme

- Wirksame Einstellungen: Antwort auf Anfragen, Aufenthalt je Wohnung,
  Dokument und beide Abschlüsse je Vorgang
- Schritte vor dem Aufenthalt entfallen nach der Abreise; direkt bestaetigte
  Vorgaenge zeigen keine Auskunft; "Als Naechstes" ohne fremden Detailtext
- Automatische Wunschbestaetigung nur mit freigegebenen Vertragstexten
- Taeglicher Lauf bewertet auch bereits abgeschlossene Vorgaenge kaufmaennisch
- Dokumente: UMSETZUNGSERGEBNIS_P7_P9, END_TO_END_ABNAHME (T01-T25),
  KONFIGURATION_UND_WIRKSAMKEIT, GESAMTABNAHME_v0.10, STATUS; Screenshots

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-02 08:51:24 +01:00
1 parent 40d20cb7d1
commit 234e642e4d
22 files changed
+517 -96

No files matched your search

+5 -1
View File
@@ -105,7 +105,11 @@ public function handle(Booking $booking): array
return [];
}
private function contractTextsReleased(): bool
/**
* Whether the landlord's own contract terms, cancellation terms and bank account are in place (always true while
* mails only go to the test recipient).
*/
public function contractTextsReleased(): bool
{
if (! Settings::isLive()) {
return true;
+7
View File
@@ -52,6 +52,13 @@ public function due(): int
$closed++;
}
// Cases closed before package 9 (or whose money became clear without a payment) get their commercial closing too.
$unsettled = Booking::query()->whereIn('status', [BookingStatus::Completed, BookingStatus::Cancelled])->whereNull('settled_at')
->whereDate('departure', '>', CarbonImmutable::today()->subYear())->with(['payments', 'importChannel', 'originChannel'])->get();
foreach ($unsettled as $booking) {
CaseLog::context(fn () => CaseClosure::refresh($booking), actor: CaseLog::SYSTEM.' (automatisch)');
}
return $closed;
}
+3
View File
@@ -198,6 +198,9 @@ public function findings(Booking $booking, array $stale = []): array
}
$findings = [...$findings, ...app(CaseAutomation::class)->documentBlockers($booking)];
if (! app(AutoOffer::class)->contractTextsReleased()) {
$findings[] = 'Mietbedingungen, Stornobedingungen oder Bankverbindung sind noch nicht vom Betreiber freigegeben (leer oder Mustertext).';
}
// What the confirmation with the contract would need to be confirmed by the landlord (unreleased texts, gaps).
foreach (app(DocumentComposer::class)->compose($booking, DocumentKind::Confirmation)->toConfirm() as $point) {
+32
View File
@@ -12,6 +12,7 @@
use App\Models\Property;
use App\Process\ProcessProfile;
use App\Process\ProcessSettings;
use App\Support\Money;
use BackedEnum;
use Filament\Pages\Page;
use Filament\Support\Icons\Heroicon;
@@ -102,6 +103,37 @@ public static function where(ProcessSetting $setting): string
: 'System › So arbeite ich; Abweichung: Wohnung (Experte), Portal je Anfrage/feste Buchung'.($setting->channelIntakes() === [] ? ' (kein Portal)' : '');
}
/**
* What a request on this way is answered with (package 7): a binding offer that reserves, or an information.
*/
public static function answer(ProcessProfile $profile): string
{
return match ($profile->intake) {
IntakeKind::Inquiry => $profile->preReservation() ? 'Angebot mit Annahmelink, Zeitraum reserviert' : 'Unverbindliche Auskunft, „Buchung anfragen“, erneute Prüfung',
IntakeKind::Booking => 'keine – beim Portal bereits verbindlich',
IntakeKind::Internal => 'keine – eigene Belegung',
};
}
/**
* The stay settings of a property in one line (package 9).
*/
public static function stay(Property $property): string
{
$tasks = array_map(fn (array $task): string => $task['title'].' ('.match ($task['when']) {
'after_departure' => 'am Abreisetag',
'on_arrival' => 'am Anreisetag',
default => $task['days'].' Tag(e) vor Anreise',
}.($task['responsible'] ? ', '.$task['responsible'] : '').')', $property->stayTaskDefinitions());
return implode(' · ', [
'Anreisezeit erfragen: '.($property->asks_arrival_time ? 'ja' : 'nein'),
'Aufgaben je Aufenthalt: '.($tasks === [] ? 'keine eingestellt' : implode(', ', $tasks)),
'gebuchte Leistungen werden zu Aufgaben',
'Kurabgabe (A6): '.($property->tourist_tax_rate ? Money::format((int) $property->tourist_tax_rate).' je Person und Nacht' : 'kein Satz – keine Berechnung'),
]);
}
/**
* Recent cases to check.
*
@@ -151,7 +151,7 @@ private static function nextStep(Booking $booking): HtmlString
default => 'Nichts zu tun.',
};
$color = $next?->state === ActivityState::Problem ? '#dc2626' : ($next !== null ? '#b45309' : '#15803d');
$detail = $next?->detail ?? $waiting?->detail;
$detail = $next !== null ? $next->detail : $waiting?->detail;
$mode = $automatic
? 'Dieser Vorgang läuft automatisch weiter, sobald alle Angaben da sind.'.(($blockers = self::blockers($booking)) !== [] ? ' Es fehlt: '.e(implode(' ', $blockers)) : '')
: 'Sie geben jeden Schritt selbst frei. Der Knopf oben rechts führt zum nächsten Schritt.';
@@ -149,6 +149,7 @@ public static function configure(Schema $schema): Schema
Section::make('Aufenthalt vorbereiten und abschließen')
->description('Was bei jedem Aufenthalt in dieser Wohnung zu tun ist. Jede Zeile wird rechtzeitig zur Aufgabe am Vorgang – keine Personalplanung. Gebuchte Leistungen (z. B. Wäschepaket) kommen automatisch dazu.')
->collapsed()
->columnSpanFull()
->schema([
Toggle::make('asks_arrival_time')
->label('Anreisezeit erfragen')
@@ -159,15 +160,15 @@ public static function configure(Schema $schema): Schema
->defaultItems(0)
->columns(4)
->schema([
TextInput::make('title')->label('Was?')->placeholder('z. B. Endreinigung')->required()->maxLength(120)->columnSpan(2),
TextInput::make('title')->label('Was?')->placeholder('z. B. Endreinigung')->required()->maxLength(120),
Select::make('when')->label('Wann?')->required()->default('before_arrival')->live()->options([
'before_arrival' => 'vor der Anreise',
'on_arrival' => 'am Anreisetag',
'after_departure' => 'am Abreisetag',
]),
TextInput::make('days')->label('Tage vorher')->integer()->minValue(0)->maxValue(14)->default(1)->visible(fn (Get $get): bool => $get('when') === 'before_arrival'),
TextInput::make('responsible')->label('Wer? (optional)')->placeholder('z. B. Reinigung Müller')->maxLength(120)->columnSpan(2),
CheckboxList::make('applies_to')->label('Bei')->required()->default(['rental'])->columns(4)->columnSpan(2)->options([
TextInput::make('responsible')->label('Wer? (optional)')->placeholder('z. B. Reinigung Müller')->maxLength(120),
CheckboxList::make('applies_to')->label('Bei')->required()->default(['rental'])->columns(4)->columnSpanFull()->options([
'rental' => 'Gästebuchungen',
'private' => 'Familie/Freunde',
'own' => 'eigener Nutzung',
+7 -3
View File
@@ -50,7 +50,8 @@ public static function for(Booking $booking): array
$today = CarbonImmutable::today();
// After the end of a case (or of its stay) what was not done before is no longer to do; open money and other
// follow-ups are tasks and the commercial closing of their own (package 9).
$over = $closed || $booking->status === BookingStatus::Completed;
// A stay whose departure has passed counts as over for the steps before it, too.
$over = $closed || $booking->status === BookingStatus::Completed || ($binding && $booking->departure->isBefore($today));
$later = fn (ActivityState $state): ActivityState => $over && ! in_array($state, [ActivityState::Done, ActivityState::External], true) ? ActivityState::NotApplicable : $state;
$activities = [];
@@ -77,13 +78,15 @@ public static function for(Booking $booking): array
// Package 7: a request without a hold is answered with an information "unter Vorbehalt"; the guest asks for the booking.
$informed = $booking->information_version > 0 || $binding;
$activities[] = new Activity('information', $booking->processingMode() === ProcessingMode::Automatic ? 'Unverbindliche Auskunft senden (automatisch)' : 'Unverbindliche Auskunft prüfen und senden', $later(match (true) {
$informed => ActivityState::Done,
$booking->information_version > 0 => ActivityState::Done,
$binding => ActivityState::NotApplicable,
$booking->status === BookingStatus::Reserved && filled($booking->guest?->email) => ActivityState::Open,
default => ActivityState::Later,
}), $booking->information_version > 0 ? 'Version '.$booking->information_version.' vom '.$booking->information_sent_at?->format('d.m.Y').' · ohne Reservierung' : 'der Zeitraum wird nicht reserviert', $informed ? null : 'sendInformation');
$activities[] = new Activity('wish', 'Gast fragt die Buchung an', $later(match (true) {
$binding || $booking->wish_at !== null => ActivityState::Done,
$booking->wish_at !== null => ActivityState::Done,
$binding => ActivityState::NotApplicable,
$booking->information_version > 0 && $booking->information_valid_until?->isFuture() => ActivityState::Waiting,
default => ActivityState::Later,
}), match (true) {
@@ -98,6 +101,7 @@ public static function for(Booking $booking): array
}), match (true) {
$booking->accepted_at !== null && ($booking->acceptance['via'] ?? null) === 'booking_wish' => 'bestätigt am '.$booking->confirmed_at?->format('d.m.Y').' ('.($booking->acceptance['confirmed_by'] ?? '').')',
$booking->wish_at !== null && $booking->status === BookingStatus::Reserved => 'siehe Aufgabe „Buchungswunsch bestätigen?“',
$binding => 'direkt verbindlich bestätigt (ohne Buchungswunsch)',
default => $booking->processingMode() === ProcessingMode::Automatic ? 'automatisch, wenn alles passt' : 'durch Sie',
});
} elseif ($inquiry) {