Vorgang: fehlende Angaben selbst eintragen als nächster Schritt
Deploy FeWo mit PipelineManager / deploy (push) Successful in 5m4s

- Wartet der Vorgang auf die Antwort des Gastes, ist „Fehlende Angaben
  selbst eintragen“ der große Schalter (vorher leer, Dialog nur unter
  „Weitere Möglichkeiten“). Die Eingabe läuft über den Fakteneingang
  (Herkunft „von Ihnen eingetragen“); die Rückfrage endet, sobald alles
  da ist, im Automatikmodus geht das Angebot hinaus.
- Dialog verständlicher benannt: „Gast eintragen“ / „Fehlende Angaben
  selbst eintragen“ / „Gastdaten bearbeiten“.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-03 17:31:51 +01:00
1 parent 154b8a434c
commit f4a435c71a
2 files changed
+30 -3

No files matched your search

@@ -153,7 +153,9 @@ protected function getHeaderActions(): array
$this->setStatusAction(),
])->keyBy(fn (Action $action): string => $action->getName());
$next = CaseActivities::next($this->record)?->action;
// While the case waits for the guest's missing details, entering them oneself (call, other mail) is the step at hand.
$next = CaseActivities::next($this->record)?->action
?? collect(CaseActivities::for($this->record))->first(fn ($activity): bool => $activity->key === 'contact' && $activity->action !== null)?->action;
$primary = $next !== null && $actions->has($next) ? $actions->pull($next)->color('primary')->size('lg')->icon(Heroicon::OutlinedArrowRightCircle) : null;
$expert = $actions->only(self::EXPERT)->values()->all();
$more = $actions->except(self::EXPERT)->values()->all();
@@ -293,11 +295,15 @@ private function templateFields(): array
private function provideContactAction(): Action
{
return Action::make('provideContact')
->label(fn (): string => $this->record->guest === null ? 'Gast eintragen' : 'Kontaktdaten eintragen')
->label(fn (): string => match (true) {
$this->record->guest === null => 'Gast eintragen',
RequestCaseData::needs($this->record) !== null => 'Fehlende Angaben selbst eintragen',
default => 'Gastdaten bearbeiten',
})
->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(fn (): string => 'Aus Portalnachricht, E-Mail oder Telefonat. Nur eintragen, was bekannt ist.'.$this->openFactConflicts())
->modalDescription(fn (): string => 'Aus Telefonat, E-Mail, Portalnachricht oder Gespräch. Nur eintragen, was bekannt ist; Ihre Eingabe gilt und wird mit Herkunft „von Ihnen eingetragen“ festgehalten. Eine laufende Rückfrage endet, sobald alles da ist.'.$this->openFactConflicts())
->modalWidth('3xl')
->fillForm(fn (): array => [
'guest' => $this->record->guest?->only(['first_name', 'last_name', 'email', 'phone', 'street', 'postal_code', 'city', 'country']) ?? [],
+21
View File
@@ -4,11 +4,13 @@
use App\Actions\ContributeCaseFacts;
use App\Actions\CreateReservation;
use App\Actions\ProvideGuestContact;
use App\Actions\RequestCaseData;
use App\Actions\TakeOverExternalBooking;
use App\Enums\BookingStatus;
use App\Enums\BookingTaskKind;
use App\Enums\FactSource;
use App\Filament\Resources\Bookings\Pages\ViewBooking;
use App\Mail\DataRequested;
use App\Mail\ReservationReceived;
use App\Models\Booking;
@@ -17,6 +19,7 @@
use App\Models\Channel;
use App\Models\DataRequest;
use App\Models\Property;
use App\Models\User;
use App\Pricing\StayRequest;
use App\Process\CaseActivities;
use App\Support\Content;
@@ -24,11 +27,13 @@
use Carbon\CarbonImmutable;
use Database\Seeders\PropertySeeder;
use Database\Seeders\SiteSeeder;
use Filament\Actions\Testing\TestAction;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\URL;
use Livewire\Livewire;
use Tests\TestCase;
/**
@@ -101,6 +106,22 @@ public function test_the_offer_waits_for_the_answer_even_when_the_steps_are_rele
$this->assertSame(BookingStatus::Reserved, $booking->fresh()->status, 'manual processing: nothing sent by itself');
}
public function test_the_landlord_enters_the_missing_details_himself_while_the_guest_is_asked(): void
{
$this->actingAs(User::factory()->create());
Settings::tenant()->update(['process_defaults' => ['processing' => 'automatic', 'data_request_mode' => 'automatic']]);
$booking = $this->request();
$page = Livewire::test(ViewBooking::class, ['record' => $booking->getRouteKey()]);
$primary = $page->instance()->getCachedHeaderActions()[0];
$this->assertSame(['provideContact', 'Fehlende Angaben selbst eintragen'], [$primary->getName(), $primary->getLabel()]);
$page->callAction(TestAction::make('provideContact')->arguments([]), ['guest' => ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE'], 'process' => ProvideGuestContact::AUTOMATIC, 'guest_confirmed' => false]);
$this->assertSame(DataRequest::COMPLETED, $booking->dataRequests()->first()->status);
$this->assertSame(BookingStatus::OfferSent, $booking->fresh()->status);
}
public function test_manual_mode_leaves_the_question_to_the_landlord(): void
{
Settings::tenant()->update(['process_defaults' => ['data_request_mode' => 'manual']]);