Files
fewo-stommer/resources/views/livewire/booking-request.blade.php
LarsandClaude Opus 5.5 ccac78a6c9 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>
2026-11-03 13:07:18 +01:00

241 lines
18 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.
<div>
@if ($booking)
<div class="rounded border border-emerald-200 bg-emerald-50 p-8" role="status">
<h2 class="text-2xl font-semibold text-emerald-900">Vielen Dank, {{ $booking->guest->first_name }}!</h2>
<p class="mt-3 text-emerald-900">
Ihre Anfrage <strong>{{ $booking->reference }}</strong> ist eingegangen. Wir haben den Zeitraum
<strong>{{ $booking->arrival->format('d.m.Y') }} – {{ $booking->departure->format('d.m.Y') }}</strong>
@if ($booking->isHoldActive())bis <strong>{{ $booking->hold_expires_at->format('d.m.Y, H:i') }} Uhr</strong> für Sie vorgemerkt.@elseif ($booking->status === \App\Enums\BookingStatus::OfferSent)bereits geprüft – unser Angebot ist unterwegs zu Ihnen.@elseif ($booking->information_version > 0)geprüft – unsere unverbindliche Auskunft ist unterwegs zu Ihnen. Reserviert ist der Zeitraum damit noch nicht.@else– eine Reservierung ist damit noch nicht verbunden.@endif
</p>
<p class="mt-2 text-emerald-900">Eine Bestätigung mit allen Details haben wir an {{ $booking->guest->email }} gesendet.</p>
</div>
@else
<div class="grid gap-8 lg:grid-cols-5">
{{-- Calendar --}}
<section class="lg:col-span-3" aria-labelledby="calendar-heading">
<div class="rounded border border-line bg-surface p-5">
<div class="flex items-center justify-between">
<h2 id="calendar-heading" class="text-lg font-semibold text-ink">Belegung</h2>
<div class="flex gap-2">
<button type="button" wire:click="previousMonth" class="rounded-lg border border-line px-3 py-1.5 text-sm hover:bg-accent/10" aria-label="Vorheriger Monat">‹</button>
<button type="button" wire:click="nextMonth" class="rounded-lg border border-line px-3 py-1.5 text-sm hover:bg-accent/10" aria-label="Nächster Monat">›</button>
</div>
</div>
<div class="mt-4 grid gap-6 sm:grid-cols-2">
@foreach ($this->calendar as $month)
<div wire:key="month-{{ $month['label'] }}">
<h3 class="mb-2 text-center text-sm font-semibold text-ink">{{ $month['label'] }}</h3>
<table class="w-full table-fixed text-center text-sm">
<thead>
<tr class="text-xs text-muted">
@foreach (['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'] as $weekday)
<th scope="col" class="pb-1 font-medium">{{ $weekday }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($month['weeks'] as $week)
<tr>
@foreach (array_pad($week, 7, null) as $day)
<td class="p-0.5">
@if ($day)
<button type="button"
wire:click="selectDate('{{ $day['date'] }}')"
@disabled($day['past'])
aria-pressed="{{ $day['selected'] ? 'true' : 'false' }}"
aria-label="{{ \Carbon\CarbonImmutable::parse($day['date'])->translatedFormat('l, d. F Y') }}{{ $day['free'] ? '' : ' (Nacht belegt)' }}"
@class([
'aspect-square w-full rounded-lg text-sm transition',
'cursor-not-allowed text-muted/40' => $day['past'],
'bg-accent font-semibold text-accent-ink' => $day['selected'],
'bg-accent/15 text-ink' => $day['inRange'] && ! $day['selected'],
'bg-rose-100 text-rose-800 line-through decoration-rose-300' => ! $day['free'] && ! $day['past'] && ! $day['selected'],
'hover:bg-accent/10' => $day['free'] && ! $day['past'] && ! $day['selected'] && ! $day['inRange'],
])>
{{ $day['day'] }}
</button>
@endif
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
</div>
@endforeach
</div>
<div class="mt-4 flex flex-wrap gap-4 text-xs text-muted">
<span class="flex items-center gap-1.5"><span class="inline-block size-3 rounded bg-surface ring-1 ring-line"></span> frei</span>
<span class="flex items-center gap-1.5"><span class="inline-block size-3 rounded bg-rose-100"></span> Nacht belegt (Abreise möglich)</span>
<span class="flex items-center gap-1.5"><span class="inline-block size-3 rounded bg-accent"></span> Ihre Auswahl</span>
</div>
</div>
<div class="mt-4 grid gap-4 sm:grid-cols-3">
<label class="block text-sm">
<span class="font-medium text-ink">Anreise</span>
<input type="date" wire:model.live="arrival" min="{{ today()->toDateString() }}" class="mt-1 w-full rounded-lg border-line">
</label>
<label class="block text-sm">
<span class="font-medium text-ink">Abreise</span>
<input type="date" wire:model.live="departure" min="{{ $arrival ?? today()->toDateString() }}" class="mt-1 w-full rounded-lg border-line">
</label>
<label class="block text-sm">
<span class="font-medium text-ink">Personen</span>
<select wire:model.live="guests" class="mt-1 w-full rounded-lg border-line">
@for ($count = 1; $count <= $this->property->max_guests; $count++)
<option value="{{ $count }}">{{ $count }}</option>
@endfor
</select>
</label>
</div>
@error('arrival') <p class="mt-2 text-sm text-rose-700" role="alert">{{ $message }}</p> @enderror
@error('departure') <p class="mt-2 text-sm text-rose-700" role="alert">{{ $message }}</p> @enderror
{{-- Price next to the calendar it depends on; the form fills the other column (no half-empty page). --}}
<div class="mt-6 rounded border border-line bg-surface p-5" aria-live="polite">
<h2 id="price-heading" class="text-lg font-semibold text-ink">Ihr Preis</h2>
@php($pricing = $this->pricing)
@if ($pricing['error'])
<p class="mt-3 rounded-lg bg-amber-50 p-3 text-sm text-amber-900">{{ $pricing['error'] }}</p>
@elseif ($pricing['quote'])
@php($quote = $pricing['quote'])
<p class="mt-1 text-sm text-muted">
{{ $quote->arrival->format('d.m.Y') }} – {{ $quote->departure->format('d.m.Y') }} · {{ $quote->nights() }} Nächte · {{ $quote->guests }} {{ $quote->guests === 1 ? 'Person' : 'Personen' }}
<button type="button" wire:click="clearDates" class="ml-1 underline">ändern</button>
</p>
<dl class="mt-4 space-y-1.5 text-sm">
@foreach ($quote->lines as $line)
<div @class(['flex justify-between gap-4', 'text-emerald-700 font-medium' => $line->amount < 0])>
<dt>{{ $line->label }}</dt>
<dd class="tabular-nums">{{ \App\Support\Money::format($line->amount) }}</dd>
</div>
@endforeach
<div class="flex justify-between gap-4 border-t border-line pt-2 text-base font-semibold text-ink">
<dt>Gesamtpreis</dt>
<dd class="tabular-nums">{{ \App\Support\Money::format($quote->total()) }}</dd>
</div>
</dl>
<p class="mt-2 text-xs text-muted">
Anzahlung {{ \App\Support\Money::format($quote->deposit()) }}, Rest bis {{ $quote->balanceDueOn->format('d.m.Y') }}. Kurtaxe wird vor Ort berechnet.
</p>
@if ($quote->promoCodeApplied === false)
<p class="mt-2 text-sm text-amber-800">Der Aktionscode ist für diesen Zeitraum nicht gültig.</p>
@endif
@else
<p class="mt-3 text-sm text-muted">Bitte wählen Sie im Kalender Anreise und Abreise.</p>
@endif
@if ($this->availableExtras->isNotEmpty())
<fieldset class="mt-5 border-t border-line pt-4">
<legend class="text-sm font-medium text-ink">Zusatzleistungen</legend>
<div class="mt-2 space-y-2">
@foreach ($this->availableExtras as $extra)
<label class="flex items-center justify-between gap-3 text-sm" wire:key="extra-{{ $extra->id }}">
<span>
{{ $extra->name }} <span class="text-muted">({{ \App\Support\Money::format($extra->price) }})</span>
@if ($extra->description)<br><span class="text-xs text-muted">{{ $extra->description }}</span>@endif
</span>
<select wire:model.live="extras.{{ $extra->id }}" class="w-20 rounded-lg border-line text-sm">
@for ($quantity = 0; $quantity <= $this->property->max_guests; $quantity++)
<option value="{{ $quantity }}">{{ $quantity }}</option>
@endfor
</select>
</label>
@endforeach
</div>
</fieldset>
@endif
<label class="mt-4 block text-sm">
<span class="font-medium text-ink">Aktionscode</span>
<input type="text" wire:model.live.debounce.600ms="promoCode" autocomplete="off" class="mt-1 w-full rounded-lg border-line">
</label>
</div>
</section>
{{-- Request form --}}
<section class="lg:sticky lg:top-6 lg:col-span-2 lg:self-start" aria-labelledby="request-heading">
<form wire:submit="submit" class="rounded border border-line bg-surface p-5" novalidate>
<h2 id="request-heading" class="text-lg font-semibold text-ink">Unverbindlich anfragen</h2>
<div class="mt-4 grid gap-4 sm:grid-cols-2">
@foreach ([
['firstName', 'Vorname', 'text', 'given-name', true],
['lastName', 'Nachname', 'text', 'family-name', true],
['email', 'E-Mail', 'email', 'email', true],
['phone', 'Telefon', 'tel', 'tel', false],
['street', 'Straße & Hausnr.', 'text', 'street-address', $this->requiresAddress],
['postalCode', 'PLZ', 'text', 'postal-code', $this->requiresAddress],
['city', 'Ort', 'text', 'address-level2', $this->requiresAddress],
] as [$field, $label, $type, $autocomplete, $required])
<label class="block text-sm" wire:key="field-{{ $field }}">
<span class="font-medium text-ink">{{ $label }}@if ($required)<span class="text-rose-600" aria-hidden="true"> *</span>@endif</span>
<input type="{{ $type }}" wire:model="{{ $field }}" autocomplete="{{ $autocomplete }}" @required($required)
@error($field) aria-invalid="true" aria-describedby="{{ $field }}-error" @enderror
class="mt-1 w-full rounded-lg border-line">
@error($field) <span id="{{ $field }}-error" class="mt-1 block text-xs text-rose-700">{{ $message }}</span> @enderror
</label>
@endforeach
<label class="block text-sm" wire:key="field-country">
<span class="font-medium text-ink">Land @if ($this->requiresAddress)<span class="text-rose-600" aria-hidden="true">*</span>@endif</span>
<select wire:model="country" autocomplete="country" @error('country') aria-invalid="true" aria-describedby="country-error" @enderror class="mt-1 w-full rounded-lg border-line">
@foreach (\App\Support\Countries::options() as $code => $name)
<option value="{{ $code }}">{{ $name }}</option>
@endforeach
</select>
@error('country') <span id="country-error" class="mt-1 block text-xs text-rose-700">{{ $message }}</span> @enderror
</label>
</div>
<label class="mt-4 block text-sm">
<span class="font-medium text-ink">Wie sind Sie auf uns aufmerksam geworden?</span>
<select wire:model="referralSource" class="mt-1 w-full rounded-lg border-line">
<option value="">Bitte wählen (optional)</option>
@foreach (\App\Enums\ReferralSource::cases() as $source)
<option value="{{ $source->value }}">{{ $source->getLabel() }}</option>
@endforeach
</select>
</label>
<label class="mt-4 block text-sm">
<span class="font-medium text-ink">Nachricht</span>
<textarea wire:model="message" rows="3" class="mt-1 w-full rounded-lg border-line"></textarea>
</label>
<div class="hidden" aria-hidden="true">
<label>Website <input type="text" wire:model="website" tabindex="-1" autocomplete="off"></label>
</div>
<label class="mt-4 flex items-start gap-2 text-sm">
<input type="checkbox" wire:model="privacyAccepted" class="mt-0.5 rounded border-line">
<span>Ich bin einverstanden, dass meine Angaben zur Bearbeitung der Anfrage gespeichert werden (siehe <a href="{{ route('page', 'datenschutz') }}" target="_blank" rel="noopener" class="underline hover:text-accent">Datenschutzerklärung<span class="sr-only"> (öffnet in neuem Tab)</span></a>).<span class="text-rose-600" aria-hidden="true"> *</span></span>
</label>
@error('privacyAccepted') <p class="mt-1 text-xs text-rose-700">{{ $message }}</p> @enderror
<label class="mt-3 flex items-start gap-2 text-sm text-muted">
<input type="checkbox" wire:model="marketingOptIn" class="mt-0.5 rounded border-line">
<span>Ja, informieren Sie mich gelegentlich per E-Mail über freie Termine und Angebote (optional, jederzeit abbestellbar).</span>
</label>
<button type="submit"
@disabled(! $pricing['quote'])
wire:loading.attr="disabled"
class="mt-5 w-full rounded-xl bg-accent px-4 py-3 font-semibold text-accent-ink transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50">
<span wire:loading.remove wire:target="submit">Unverbindlich anfragen</span>
<span wire:loading wire:target="submit">Wird gesendet …</span>
</button>
@if ($this->reservesDates)
<p class="mt-2 text-center text-xs text-muted">Kostenlos und unverbindlich. Wir halten den Termin für Sie frei und senden Ihnen ein Angebot per E-Mail – verbindlich wird die Buchung erst, wenn Sie es annehmen.</p>
@else
<p class="mt-2 text-center text-xs text-muted">Kostenlos und unverbindlich. Sie erhalten eine Auskunft zu Preis und Verfügbarkeit per E-Mail und können daraus die Buchung anfragen – verbindlich wird sie erst mit unserer Bestätigung.</p>
@endif
</form>
</section>
</div>
@endif
</div>