'int', 'position' => 'int', 'quantity' => 'int', 'travel_program_id' => 'int', 'fewo_lodging_id' => 'int', 'price_per_unit' => 'decimal:2', 'total_price' => 'decimal:2', 'metadata' => 'array', ]; public function offerVersion(): BelongsTo { return $this->belongsTo(OfferVersion::class, 'offer_version_id'); } /** * Berechnet `total_price` aus `quantity * price_per_unit` — wird vom * OfferService vor dem Speichern aufgerufen, damit UI-Aggregate * und DB-Werte konsistent bleiben. */ public function recomputeTotal(): void { $this->total_price = round($this->quantity * (float) $this->price_per_unit, 2); } }