- Datenmodell Property/Season/Extra (Beträge in Cent), Seeder mit Preisliste 2026 - PriceCalculator: Saison-Splitting, Mindestaufenthalt, Zusatzperson, Endreinigung, Extras, Anzahlung/Restzahlung - Filament-Verwaltung: Wohnungen, Saisons (Überschneidungsprüfung, Lückenwarnung, Kopie ins Folgejahr, Preisrechner), Zusatzleistungen - Tests für Preisberechnung und Saisonverwaltung Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Pricing;
|
|
|
|
use Carbon\CarbonInterface;
|
|
use RuntimeException;
|
|
|
|
/**
|
|
* A stay that cannot be priced. Messages are shown to guests and administrators.
|
|
*/
|
|
class QuoteException extends RuntimeException
|
|
{
|
|
public static function invalidPeriod(): self
|
|
{
|
|
return new self('Die Abreise muss nach der Anreise liegen.');
|
|
}
|
|
|
|
public static function invalidGuestCount(int $maxGuests): self
|
|
{
|
|
return new self("Die Wohnung bietet Platz für 1 bis {$maxGuests} Personen.");
|
|
}
|
|
|
|
public static function noRateForNight(CarbonInterface $night): self
|
|
{
|
|
return new self("Für den {$night->format('d.m.Y')} sind noch keine Preise hinterlegt.");
|
|
}
|
|
|
|
public static function minimumStay(int $minNights, string $seasonName): self
|
|
{
|
|
return new self("In der Saison „{$seasonName}“ beträgt der Mindestaufenthalt {$minNights} Nächte.");
|
|
}
|
|
|
|
public static function unknownExtra(int $extraId): self
|
|
{
|
|
return new self("Die Zusatzleistung #{$extraId} ist nicht buchbar.");
|
|
}
|
|
}
|