Phase 1: Wohnungen, Saisons & Preisberechnung
- 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>
This commit is contained in:
1 parent
bf4c1c0838
commit
2e9a391b37
35 files changed
+1766
-12
No files matched your search
@@ -0,0 +1,31 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Property;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Property>
|
||||
*/
|
||||
class PropertyFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$name = 'Ferienwohnung '.fake()->unique()->lastName();
|
||||
|
||||
return [
|
||||
'name' => $name,
|
||||
'slug' => str($name)->slug()->toString(),
|
||||
'address' => fake()->streetAddress().', 18225 Kühlungsborn',
|
||||
'size_sqm' => fake()->numberBetween(35, 90),
|
||||
'max_guests' => 4,
|
||||
'included_guests' => 2,
|
||||
'extra_guest_fee_per_night' => 750,
|
||||
'cleaning_fee' => 10800,
|
||||
'deposit_percent' => 35,
|
||||
'balance_due_days_before_arrival' => 28,
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user