- 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>
34 lines
758 B
PHP
34 lines
758 B
PHP
<?php
|
|
|
|
namespace App\Pricing;
|
|
|
|
use App\Enums\QuoteLineType;
|
|
|
|
/**
|
|
* One position of a price quote. Amounts are in euro cents.
|
|
*/
|
|
final readonly class QuoteLine
|
|
{
|
|
public function __construct(
|
|
public QuoteLineType $type,
|
|
public string $label,
|
|
public int $quantity,
|
|
public int $unitPrice,
|
|
public int $amount,
|
|
) {}
|
|
|
|
/**
|
|
* @return array{type: string, label: string, quantity: int, unit_price: int, amount: int}
|
|
*/
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'type' => $this->type->value,
|
|
'label' => $this->label,
|
|
'quantity' => $this->quantity,
|
|
'unit_price' => $this->unitPrice,
|
|
'amount' => $this->amount,
|
|
];
|
|
}
|
|
}
|