feat: add mobile monitors as a bookable resource type

This commit is contained in:
fromme committed 2026-09-17 17:55:58 +02:00
1 parent 606bc0c897
commit 376251b6d6
4 files changed
+12 -4

No files matched your search

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="20" height="14" x="2" y="3" rx="2"/><path d="M8 21h8m-4-4v4"/></g></svg>

After

Width:  |  Height:  |  Size: 246 B

+1 -1
View File
@@ -11,7 +11,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
/** /**
* A bookable thing: a desk or a parking spot. * A bookable thing: a desk, a parking spot or a portable device.
*/ */
#[ORM\Entity(repositoryClass: ResourceRepository::class)] #[ORM\Entity(repositoryClass: ResourceRepository::class)]
#[ORM\UniqueConstraint(name: 'uniq_resource_label', columns: ['type', 'label'])] #[ORM\UniqueConstraint(name: 'uniq_resource_label', columns: ['type', 'label'])]
+9 -2
View File
@@ -9,7 +9,7 @@ namespace App\Enum;
* *
* **This enum is the extension point.** The dashboard builds one tile per case, the board route * **This enum is the extension point.** The dashboard builds one tile per case, the board route
* accepts one backing value per case, and the floor plan and the admin screen render every kind * accepts one backing value per case, and the floor plan and the admin screen render every kind
* the same way. Adding a third bookable kind is therefore: a case here. * the same way. Adding another bookable kind is therefore: a case here.
* Nothing else needs editing — in particular no template lists the kinds by hand. * Nothing else needs editing — in particular no template lists the kinds by hand.
* *
* The backing value is both what is persisted in `resource.type` and what appears in a URL, so * The backing value is both what is persisted in `resource.type` and what appears in a URL, so
@@ -20,12 +20,14 @@ enum ResourceType: string
{ {
case DESK = 'desk'; case DESK = 'desk';
case PARKING = 'parking'; case PARKING = 'parking';
case MONITOR = 'monitor';
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::DESK => 'Schreibtisch', self::DESK => 'Schreibtisch',
self::PARKING => 'Parkplatz', self::PARKING => 'Parkplatz',
self::MONITOR => 'Mobiler Monitor',
}; };
} }
@@ -34,6 +36,7 @@ enum ResourceType: string
return match ($this) { return match ($this) {
self::DESK => 'Schreibtische', self::DESK => 'Schreibtische',
self::PARKING => 'Parkplätze', self::PARKING => 'Parkplätze',
self::MONITOR => 'Mobile Monitore',
}; };
} }
@@ -42,17 +45,20 @@ enum ResourceType: string
return match ($this) { return match ($this) {
self::DESK => 'Einen Platz im Büro reservieren.', self::DESK => 'Einen Platz im Büro reservieren.',
self::PARKING => 'Einen Stellplatz reservieren.', self::PARKING => 'Einen Stellplatz reservieren.',
self::MONITOR => 'Einen mobilen Monitor ausleihen.',
}; };
} }
/** /**
* What a ResourceGroup of this kind is called: an office has rooms, a car park has areas. * What a ResourceGroup of this kind is called: an office has rooms, a car park has areas,
* a portable device a place it is kept.
*/ */
public function groupLabel(): string public function groupLabel(): string
{ {
return match ($this) { return match ($this) {
self::DESK => 'Raum', self::DESK => 'Raum',
self::PARKING => 'Bereich', self::PARKING => 'Bereich',
self::MONITOR => 'Standort',
}; };
} }
@@ -61,6 +67,7 @@ enum ResourceType: string
return match ($this) { return match ($this) {
self::DESK => 'lucide:armchair', self::DESK => 'lucide:armchair',
self::PARKING => 'lucide:car', self::PARKING => 'lucide:car',
self::MONITOR => 'lucide:monitor',
}; };
} }
} }
+1 -1
View File
@@ -11,7 +11,7 @@
Login E&P Hub Login E&P Hub
</h1> </h1>
<p class="subline pb-8"> <p class="subline pb-8">
Schreibtische und Parkplätze buchen. Schreibtische, Parkplätze und Monitore buchen.
</p> </p>
<a class="button button--primary w-full" href="{{ path('app_auth_init') }}"> <a class="button button--primary w-full" href="{{ path('app_auth_init') }}">