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:
1 parent
2e9a391b37
commit
08b6582fa1
79 files changed
+6213
-76
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Pricing;
|
||||
|
||||
use App\Enums\QuoteLineType;
|
||||
use Carbon\CarbonImmutable;
|
||||
|
||||
/**
|
||||
@@ -19,8 +20,20 @@ public function __construct(
|
||||
public array $lines,
|
||||
public int $depositPercent,
|
||||
public CarbonImmutable $balanceDueOn,
|
||||
public ?bool $promoCodeApplied = null,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Total of all special offer discounts as a positive amount.
|
||||
*/
|
||||
public function discount(): int
|
||||
{
|
||||
return -array_sum(array_map(
|
||||
fn (QuoteLine $line): int => $line->type === QuoteLineType::Discount ? $line->amount : 0,
|
||||
$this->lines,
|
||||
));
|
||||
}
|
||||
|
||||
public function nights(): int
|
||||
{
|
||||
return (int) $this->arrival->diffInDays($this->departure);
|
||||
@@ -53,7 +66,7 @@ public function balance(): int
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{arrival: string, departure: string, nights: int, guests: int, lines: list<array<string, mixed>>, total: int, deposit: int, balance: int, balance_due_on: string}
|
||||
* @return array{arrival: string, departure: string, nights: int, guests: int, lines: list<array<string, mixed>>, total: int, deposit: int, balance: int, balance_due_on: string, discount: int}
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
@@ -67,6 +80,7 @@ public function toArray(): array
|
||||
'deposit' => $this->deposit(),
|
||||
'balance' => $this->balance(),
|
||||
'balance_due_on' => $this->balanceDueOn->toDateString(),
|
||||
'discount' => $this->discount(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user