- 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>
32 lines
734 B
PHP
32 lines
734 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\ExtraPricing;
|
|
use App\Models\Extra;
|
|
use App\Models\Property;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Extra>
|
|
*/
|
|
class ExtraFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'property_id' => Property::factory(),
|
|
'name' => fake()->randomElement(['Bettwäsche', 'Handtuchpaket', 'Kinderbett']),
|
|
'price' => fake()->numberBetween(5, 25) * 100,
|
|
'pricing' => ExtraPricing::PerItem,
|
|
'is_active' => true,
|
|
'sort_order' => 0,
|
|
];
|
|
}
|
|
}
|