- 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>
33 lines
833 B
PHP
33 lines
833 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Property;
|
|
use App\Models\Season;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Season>
|
|
*/
|
|
class SeasonFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$startsOn = fake()->dateTimeBetween('now', '+1 year');
|
|
|
|
return [
|
|
'property_id' => Property::factory(),
|
|
'name' => fake()->randomElement(['Vorsaison', 'Hauptsaison', 'Nachsaison']),
|
|
'starts_on' => $startsOn->format('Y-m-d'),
|
|
'ends_on' => (clone $startsOn)->modify('+4 weeks')->format('Y-m-d'),
|
|
'nightly_rate' => fake()->numberBetween(50, 120) * 100,
|
|
'min_nights' => 2,
|
|
];
|
|
}
|
|
}
|