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:
LarsandClaude Opus 5.5 committed 2026-11-03 13:07:18 +01:00
1 parent 799869c6a4
commit ccac78a6c9
33 files changed
+1041 -47

No files matched your search

+8 -8
View File
@@ -108,7 +108,7 @@ public function test_t01_own_request_handled_automatically(): void
$this->releaseTexts();
Settings::tenant()->update(['process_defaults' => ['processing' => 'automatic']]);
$booking = app(CreateReservation::class)->handle($this->property, new StayRequest(CarbonImmutable::parse('2026-11-07'), CarbonImmutable::parse('2026-11-10'), 2), ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org']);
$booking = app(CreateReservation::class)->handle($this->property, new StayRequest(CarbonImmutable::parse('2026-11-07'), CarbonImmutable::parse('2026-11-10'), 2), ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE']);
$this->assertSame([BookingStatus::OfferSent, CaseType::A1], [$booking->status, $booking->case_type]);
Mail::assertSent(OfferMade::class, 1);
@@ -120,7 +120,7 @@ public function test_t01_own_request_handled_automatically(): void
public function test_t02_own_request_released_by_hand_and_accepted_by_the_guest(): void
{
Livewire::test(CreateBooking::class)
->fillForm(['kind' => BookingForm::INQUIRY, 'property_id' => $this->property->id, 'guests' => 2, 'arrival' => '2026-11-07', 'departure' => '2026-11-10', 'first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org', 'send_mails' => false])
->fillForm(['kind' => BookingForm::INQUIRY, 'property_id' => $this->property->id, 'guests' => 2, 'arrival' => '2026-11-07', 'departure' => '2026-11-10', 'first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE', 'send_mails' => false])
->call('create')->assertHasNoFormErrors();
$booking = Booking::query()->sole();
$this->assertSame('Angebot prüfen und senden', WorkList::items()[0]['title']);
@@ -145,13 +145,13 @@ public function test_t03_missing_guest_data_becomes_a_task_and_the_case_continue
$this->releaseTexts();
Settings::tenant()->update(['process_defaults' => ['processing' => 'automatic']]);
Livewire::test(CreateBooking::class)
->fillForm(['kind' => BookingForm::INQUIRY, 'property_id' => $this->property->id, 'guests' => 2, 'arrival' => '2026-11-07', 'departure' => '2026-11-10', 'first_name' => 'Paul', 'last_name' => 'Telefon', 'send_mails' => true])
->fillForm(['kind' => BookingForm::INQUIRY, 'property_id' => $this->property->id, 'guests' => 2, 'arrival' => '2026-11-07', 'departure' => '2026-11-10', 'first_name' => 'Paul', 'last_name' => 'Telefon', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE', 'send_mails' => true])
->call('create')->assertHasNoFormErrors();
$booking = Booking::query()->sole();
$this->assertSame('E-Mail-Adresse des Gastes eintragen', WorkList::items()[0]['title']);
Livewire::test(ViewBooking::class, ['record' => $booking->getRouteKey()])
->callAction(TestAction::make('provideContact')->arguments([]), ['guest' => ['first_name' => 'Paul', 'last_name' => 'Telefon', 'email' => 'paul@example.org'], 'process' => ProvideGuestContact::AUTOMATIC, 'guest_confirmed' => false])
->callAction(TestAction::make('provideContact')->arguments([]), ['guest' => ['first_name' => 'Paul', 'last_name' => 'Telefon', 'email' => 'paul@example.org', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE'], 'process' => ProvideGuestContact::AUTOMATIC, 'guest_confirmed' => false])
->assertNotified('Kontaktdaten gespeichert, Angebot gesendet');
$this->assertSame(BookingStatus::OfferSent, $booking->fresh()->status);
@@ -258,7 +258,7 @@ public function test_t08_cancellation_takes_the_right_way(): void
->assertNotified('Buchung storniert');
$this->assertSame(BookingStatus::Cancelled, $portal->fresh()->status);
$request = app(CreateReservation::class)->handle($this->property, new StayRequest(CarbonImmutable::parse('2026-11-28'), CarbonImmutable::parse('2026-12-01'), 2), ['first_name' => 'Ina', 'last_name' => 'Anfrage', 'email' => 'ina@example.org'], sendMails: false);
$request = app(CreateReservation::class)->handle($this->property, new StayRequest(CarbonImmutable::parse('2026-11-28'), CarbonImmutable::parse('2026-12-01'), 2), ['first_name' => 'Ina', 'last_name' => 'Anfrage', 'email' => 'ina@example.org', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE'], sendMails: false);
Livewire::test(ViewBooking::class, ['record' => $request->getRouteKey()])
->callAction('end', ['reason' => 'Hund nicht erlaubt', 'notify' => false])
->assertNotified('Vorgang beendet');
@@ -385,7 +385,7 @@ public function test_t12_settings_hierarchy_is_applied_and_visible(): void
$this->assertSame([ProcessingMode::Automatic, 'tenant'], [$portalBooking->processing(), $portalBooking->source(ProcessSetting::Processing)], 'the booking intake inherits the default');
$this->assertSame(CaseType::A4, $portalBooking->caseType);
$case = app(CreateReservation::class)->handle($this->property->fresh(), new StayRequest(CarbonImmutable::parse('2026-11-07'), CarbonImmutable::parse('2026-11-10'), 2), ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org'], sendMails: false, originChannel: $fewo);
$case = app(CreateReservation::class)->handle($this->property->fresh(), new StayRequest(CarbonImmutable::parse('2026-11-07'), CarbonImmutable::parse('2026-11-10'), 2), ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE'], sendMails: false, originChannel: $fewo);
$this->assertSame(ProcessingMode::Manual, $case->processingMode());
Livewire::test(ViewBooking::class, ['record' => $case->getRouteKey()])->callAction('automation', ['mode' => ProcessingMode::Automatic->value]);
$this->assertSame(ProcessingMode::Automatic, $case->fresh()->processingMode(), 'the case decision wins');
@@ -412,7 +412,7 @@ public function test_t13_test_operation_redirects_every_outgoing_message(): void
Settings::tenant()->update(['operating_mode' => Settings::MODE_TEST, 'test_recipient' => 'test@example.com']);
app(TenantContext::class)->set(Settings::tenant()->fresh());
$booking = app(CreateReservation::class)->handle($this->property, new StayRequest(CarbonImmutable::parse('2026-11-07'), CarbonImmutable::parse('2026-11-10'), 2), ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@gast.example']);
$booking = app(CreateReservation::class)->handle($this->property, new StayRequest(CarbonImmutable::parse('2026-11-07'), CarbonImmutable::parse('2026-11-10'), 2), ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@gast.example', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE']);
Livewire::test(ViewBooking::class, ['record' => $booking->getRouteKey()])->callAction(TestAction::make('sendOffer')->arguments([]));
$booking->refresh();
$this->post(URL::temporarySignedRoute('offers.accept', $booking->hold_expires_at, ['booking' => $booking, 'v' => $booking->offer_version]), ['terms' => '1']);
@@ -483,7 +483,7 @@ public function test_existing_manual_blocks_become_cases_without_changing_the_po
private function confirmedOwnBooking(): Booking
{
$booking = app(CreateReservation::class)->handle($this->property, new StayRequest(CarbonImmutable::parse('2026-11-07'), CarbonImmutable::parse('2026-11-10'), 2), ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org'], sendMails: false);
$booking = app(CreateReservation::class)->handle($this->property, new StayRequest(CarbonImmutable::parse('2026-11-07'), CarbonImmutable::parse('2026-11-10'), 2), ['first_name' => 'Gesa', 'last_name' => 'Gast', 'email' => 'gesa@example.org', 'street' => 'Strandweg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE'], sendMails: false);
Livewire::test(ViewBooking::class, ['record' => $booking->getRouteKey()])->callAction('confirm', ['notify' => false]);
return $booking->fresh();