Phase 1: Wohnungen, Saisons & Preisberechnung
- 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>
This commit is contained in:
1 parent
bf4c1c0838
commit
2e9a391b37
35 files changed
+1766
-12
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<?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.");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user