Phase 2: Kalender, Anfrage, Vorreservierung & Sonderangebote

- Gäste, Buchungen (Status-Workflow), Sperrzeiten, Sonderangebote
- Vorreservierung mit Haltezeit je Wohnung; abgelaufene Holds geben den Kalender sofort frei, Cron setzt Status und benachrichtigt
- Sonderangebote/Sonderkonditionen: %, € pro Aufenthalt, Sonderpreis/Nacht, Gratis-Nächte; Bedingungen u. a. Saison, Vorlauf, Wochentag, Nächte, Aktionscode; bestes Einzel- vs. kombinierte Angebote
- Öffentliche Seite /buchen: Belegungskalender, Live-Preis, Anfrageformular (Honeypot, Rate-Limit)
- E-Mails: Angebot an Gast, Benachrichtigung Vermieter, Bestätigung, Absage, Ablauf
- Filament: Anfragen & Buchungen (bestätigen, ablehnen, verlängern, stornieren, Telefonbuchung), Gäste, Sperrzeiten, Sonderangebote
- Deutsche Validierungstexte

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lars StommerandClaude Opus 5.5 committed 2026-10-22 09:43:12 +02:00
1 parent 2e9a391b37
commit 08b6582fa1
79 files changed
+6213 -76

No files matched your search

@@ -0,0 +1,211 @@
<div>
@if ($booking)
<div class="rounded-2xl 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>
bis <strong>{{ $booking->hold_expires_at->format('d.m.Y, H:i') }} Uhr</strong> für Sie vorgemerkt.
</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-2xl border border-slate-200 bg-white p-5 shadow-sm">
<div class="flex items-center justify-between">
<h2 id="calendar-heading" class="text-lg font-semibold text-sea-900">Belegung</h2>
<div class="flex gap-2">
<button type="button" wire:click="previousMonth" class="rounded-lg border border-slate-200 px-3 py-1.5 text-sm hover:bg-slate-50" aria-label="Vorheriger Monat">‹</button>
<button type="button" wire:click="nextMonth" class="rounded-lg border border-slate-200 px-3 py-1.5 text-sm hover:bg-slate-50" 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-slate-700">{{ $month['label'] }}</h3>
<table class="w-full table-fixed text-center text-sm">
<thead>
<tr class="text-xs text-slate-400">
@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-slate-300' => $day['past'],
'bg-sea-700 font-semibold text-white' => $day['selected'],
'bg-sea-100 text-sea-900' => $day['inRange'] && ! $day['selected'],
'bg-rose-100 text-rose-800 line-through decoration-rose-300' => ! $day['free'] && ! $day['past'] && ! $day['selected'],
'hover:bg-sea-50' => $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-slate-500">
<span class="flex items-center gap-1.5"><span class="inline-block size-3 rounded bg-white ring-1 ring-slate-300"></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-sea-700"></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-slate-700">Anreise</span>
<input type="date" wire:model.live="arrival" min="{{ today()->toDateString() }}" class="mt-1 w-full rounded-lg border-slate-300">
</label>
<label class="block text-sm">
<span class="font-medium text-slate-700">Abreise</span>
<input type="date" wire:model.live="departure" min="{{ $arrival ?? today()->toDateString() }}" class="mt-1 w-full rounded-lg border-slate-300">
</label>
<label class="block text-sm">
<span class="font-medium text-slate-700">Personen</span>
<select wire:model.live="guests" class="mt-1 w-full rounded-lg border-slate-300">
@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
</section>
{{-- Price and form --}}
<section class="lg:col-span-2" aria-labelledby="price-heading">
<div class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm" aria-live="polite">
<h2 id="price-heading" class="text-lg font-semibold text-sea-900">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-slate-500">
{{ $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-slate-200 pt-2 text-base font-semibold text-sea-900">
<dt>Gesamtpreis</dt>
<dd class="tabular-nums">{{ \App\Support\Money::format($quote->total()) }}</dd>
</div>
</dl>
<p class="mt-2 text-xs text-slate-500">
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-slate-500">Bitte wählen Sie im Kalender Anreise und Abreise.</p>
@endif
@if ($this->availableExtras->isNotEmpty())
<fieldset class="mt-5 border-t border-slate-100 pt-4">
<legend class="text-sm font-medium text-slate-700">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-slate-500">({{ \App\Support\Money::format($extra->price) }})</span>
@if ($extra->description)<br><span class="text-xs text-slate-500">{{ $extra->description }}</span>@endif
</span>
<select wire:model.live="extras.{{ $extra->id }}" class="w-20 rounded-lg border-slate-300 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-slate-700">Aktionscode</span>
<input type="text" wire:model.live.debounce.600ms="promoCode" autocomplete="off" class="mt-1 w-full rounded-lg border-slate-300">
</label>
</div>
<form wire:submit="submit" class="mt-6 rounded-2xl border border-slate-200 bg-white p-5 shadow-sm" novalidate>
<h2 class="text-lg font-semibold text-sea-900">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', false],
['postalCode', 'PLZ', 'text', 'postal-code', false],
['city', 'Ort', 'text', 'address-level2', false],
] as [$field, $label, $type, $autocomplete, $required])
<label class="block text-sm" wire:key="field-{{ $field }}">
<span class="font-medium text-slate-700">{{ $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-slate-300">
@error($field) <span id="{{ $field }}-error" class="mt-1 block text-xs text-rose-700">{{ $message }}</span> @enderror
</label>
@endforeach
</div>
<label class="mt-4 block text-sm">
<span class="font-medium text-slate-700">Nachricht</span>
<textarea wire:model="message" rows="3" class="mt-1 w-full rounded-lg border-slate-300"></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-slate-300">
<span>Ich bin einverstanden, dass meine Angaben zur Bearbeitung der Anfrage gespeichert werden (siehe Datenschutzerklärung).<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
<button type="submit"
@disabled(! $pricing['quote'])
wire:loading.attr="disabled"
class="mt-5 w-full rounded-xl bg-sea-700 px-4 py-3 font-semibold text-white shadow-sm transition hover:bg-sea-800 disabled:cursor-not-allowed disabled:opacity-50">
<span wire:loading.remove wire:target="submit">Termin vormerken &amp; Angebot erhalten</span>
<span wire:loading wire:target="submit">Wird gesendet …</span>
</button>
<p class="mt-2 text-center text-xs text-slate-500">Kostenlos und unverbindlich. Verbindlich wird die Buchung erst mit unserer Bestätigung.</p>
</form>
</section>
</div>
@endif
</div>