Files
fewo-stommer/app/Pricing/StayRequest.php
T
Lars StommerandClaude Opus 5.5 08b6582fa1 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>
2026-10-22 09:43:12 +02:00

35 lines
785 B
PHP

<?php
namespace App\Pricing;
use Carbon\CarbonImmutable;
/**
* What a guest asks for: dates, number of guests, optional extras and a promo code.
*/
final readonly class StayRequest
{
public CarbonImmutable $arrival;
public CarbonImmutable $departure;
/**
* @param array<int, int> $extras quantity per extra id
*/
public function __construct(
CarbonImmutable $arrival,
CarbonImmutable $departure,
public int $guests,
public array $extras = [],
public ?string $promoCode = null,
) {
$this->arrival = $arrival->startOfDay();
$this->departure = $departure->startOfDay();
}
public function nights(): int
{
return (int) $this->arrival->diffInDays($this->departure);
}
}