feat: add mobile monitors as a bookable resource type
This commit is contained in:
1 parent
606bc0c897
commit
376251b6d6
4 files changed
+12
-4
No files matched your search
@@ -11,7 +11,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
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\UniqueConstraint(name: 'uniq_resource_label', columns: ['type', 'label'])]
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace App\Enum;
|
||||
*
|
||||
* **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
|
||||
* 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.
|
||||
*
|
||||
* 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 PARKING = 'parking';
|
||||
case MONITOR = 'monitor';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::DESK => 'Schreibtisch',
|
||||
self::PARKING => 'Parkplatz',
|
||||
self::MONITOR => 'Mobiler Monitor',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -34,6 +36,7 @@ enum ResourceType: string
|
||||
return match ($this) {
|
||||
self::DESK => 'Schreibtische',
|
||||
self::PARKING => 'Parkplätze',
|
||||
self::MONITOR => 'Mobile Monitore',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -42,17 +45,20 @@ enum ResourceType: string
|
||||
return match ($this) {
|
||||
self::DESK => 'Einen Platz im Büro 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
|
||||
{
|
||||
return match ($this) {
|
||||
self::DESK => 'Raum',
|
||||
self::PARKING => 'Bereich',
|
||||
self::MONITOR => 'Standort',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -61,6 +67,7 @@ enum ResourceType: string
|
||||
return match ($this) {
|
||||
self::DESK => 'lucide:armchair',
|
||||
self::PARKING => 'lucide:car',
|
||||
self::MONITOR => 'lucide:monitor',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user