$appliedPurchaseVouchers */ public function __construct( public readonly ?float $depositAmount = null, public readonly ?string $depositDate = null, public readonly ?float $finalPaymentAmount = null, public readonly ?string $finalPaymentDate = null, public readonly array $appliedPurchaseVouchers = [], ) { } /** * Gets the total discount from purchase vouchers. */ public function getPurchaseVoucherDiscount(): float { $total = 0.0; foreach ($this->appliedPurchaseVouchers as $voucher) { $total += $voucher['betrag']; } return round($total, 2); } }