Files
fewo-stommer/database/factories/FloorPlanFactory.php
LarsandClaude Opus 5.5 f7cbc66451
Deploy / test (push) Failing after 2s
Deploy / deploy (push) Skipped
Section "Grundriss (interaktiv)": floor plan with rooms, admin editor, Seebad view
- Table floor_plans (tenant_id, one per apartment, picture = website photo, rooms as JSON with
  corners in percent of the picture), model FloorPlan with BelongsToTenant, Property::floorPlan()
- Admin › Webseite › Grundriss: room list with name, description, photos, equipment (from the
  equipment list), accessibility hint, visibility, and an area editor (click the corners on the picture)
- Section floor_plan: base view without JavaScript (areas jump to the room list), Seebad view with
  room buttons, highlighted area and a cartouche per room (theme.js initFloorPlans)
- Tests: tenant inheritance, point parsing, website output, admin create incl. validation; the
  render test for all themes now includes the floor plan
- Docs: THEMES §5, ZUSAMMENARBEIT §6, STATUS §6 (incl. note for tenancy phase 5)
- styles/grundriss: revised rendering, WebP renditions, room areas of the Stommer flat in percent

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:26:02 +02:00

33 lines
1.1 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\FloorPlan;
use App\Models\Photo;
use App\Models\Property;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends Factory<FloorPlan>
*/
class FloorPlanFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'property_id' => Property::factory(),
'photo_id' => Photo::factory(),
'rooms' => [
['id' => (string) Str::uuid(), 'name' => 'Wohnbereich', 'description' => 'Helles Wohnzimmer mit Ledersofa.', 'hint' => null, 'points' => '10,20 50,20 50,65 10,65', 'photo_ids' => [], 'amenity_ids' => [], 'is_visible' => true],
['id' => (string) Str::uuid(), 'name' => 'Bad', 'description' => 'Bad mit Glasdusche.', 'hint' => 'Flache Dusche mit kleiner Kante.', 'points' => '50,40 66,40 66,65 50,65', 'photo_ids' => [], 'amenity_ids' => [], 'is_visible' => true],
],
];
}
}