v0.11 U2: Angebots-Gate, gemeinsamer Fakteneingang mit Herkunft
- CaseRequirements: Vor einem eigenen verbindlichen Angebot und vor der verbindlichen Bestätigung eines Buchungswunsches müssen Vor- und Nachname, E-Mail, vollständige Anschrift mit Land, Personenzahl und Zeitraum vorliegen – harter Blocker, auch von Hand (G2a, B3). Die Auskunft unter Vorbehalt bleibt ohne dieses Gate. - ContributeCaseFacts (S5): jede Angabe mit Herkunft und Ergebnis in case_facts; fehlend → übernommen, gleich → bestätigt, abweichend vom Gast → Prüfaufgabe (Kartei bleibt), Vermieterin maßgeblich, Zeitraum und Personen → Änderungswunsch; idempotent; danach einmal CaseAutomation. - ProvideGuestContact und Webformular nutzen den Fakteneingang. - Land als ISO-Code mit „Deutschland“ als änderbarem Formularstandard; guests.country ohne stillen Standardwert (B4). - Testdaten bestehender Tests um Anschriften ergänzt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
799869c6a4
commit
ccac78a6c9
33 files changed
+1041
-47
No files matched your search
@@ -44,6 +44,7 @@
|
||||
use App\Process\CaseActivities;
|
||||
use App\Process\CaseAutomation;
|
||||
use App\Process\CaseLog;
|
||||
use App\Support\Countries;
|
||||
use App\Support\Money;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Filament\Actions\Action;
|
||||
@@ -291,10 +292,10 @@ private function provideContactAction(): Action
|
||||
->icon(Heroicon::OutlinedUserPlus)
|
||||
->visible(fn (): bool => $this->record->internal_kind !== InternalKind::Block && ! in_array($this->record->status, [BookingStatus::Cancelled, BookingStatus::Declined, BookingStatus::Expired], true))
|
||||
->modalHeading('Kontaktdaten des Gastes')
|
||||
->modalDescription('Aus Portalnachricht, E-Mail oder Telefonat. Nur eintragen, was bekannt ist.')
|
||||
->modalDescription(fn (): string => 'Aus Portalnachricht, E-Mail oder Telefonat. Nur eintragen, was bekannt ist.'.$this->openFactConflicts())
|
||||
->modalWidth('3xl')
|
||||
->fillForm(fn (): array => [
|
||||
'guest' => $this->record->guest?->only(['first_name', 'last_name', 'email', 'phone', 'street', 'postal_code', 'city']) ?? [],
|
||||
'guest' => $this->record->guest?->only(['first_name', 'last_name', 'email', 'phone', 'street', 'postal_code', 'city', 'country']) ?? [],
|
||||
'process' => $this->record->processingMode() === ProcessingMode::Automatic ? ProvideGuestContact::AUTOMATIC : ProvideGuestContact::MANUAL,
|
||||
'guest_confirmed' => $this->record->guest_confirmed_at !== null,
|
||||
])
|
||||
@@ -307,6 +308,7 @@ private function provideContactAction(): Action
|
||||
TextInput::make('guest.street')->label('Straße und Hausnummer')->maxLength(150),
|
||||
TextInput::make('guest.postal_code')->label('PLZ')->maxLength(20),
|
||||
TextInput::make('guest.city')->label('Ort')->maxLength(100),
|
||||
Select::make('guest.country')->label('Land')->options(Countries::options())->placeholder('nicht bekannt'),
|
||||
]),
|
||||
Section::make('Wie geht es danach weiter?')->schema([
|
||||
Radio::make('process')->hiddenLabel()->options([
|
||||
@@ -331,6 +333,16 @@ private function provideContactAction(): Action
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Details from the guest's side that differ from the stored ones (v0.11 fact intake), for the contact dialog.
|
||||
*/
|
||||
private function openFactConflicts(): string
|
||||
{
|
||||
$notes = $this->record->tasks()->where('kind', BookingTaskKind::FactConflict)->where('status', BookingTaskStatus::Open)->pluck('note')->all();
|
||||
|
||||
return $notes === [] ? '' : ' Abweichende Angaben des Gastes – bitte den richtigen Wert eintragen: '.implode(' · ', $notes);
|
||||
}
|
||||
|
||||
private function requestContactAction(): Action
|
||||
{
|
||||
return Action::make('requestContact')
|
||||
|
||||
Reference in new issue
Block a user