Files
fewo-stommer/app/Enums/AdminMode.php
T
LarsandClaude Sonnet 5.5 0c4187edaf
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m34s
Stornoregeln mit automatischer Kostenberechnung, Storno-Verwaltung, Vertragsanlagen
- Stornoregel (Stufen nach Tagen vor Anreise, Mietpreis oder Gesamtpreis, Ersatzmieter-Gebuehr), je Vertragsvorlage,
  beim Angebot eingefroren, als Platzhalter im Vertrag
- Stornierung (Gast-Link oder Verwaltung) berechnet die Kosten, legt einen Stornofall an; Verwaltung Stornierungen
  mit Vorschlag, Festlegung, Saldo, Abrechnung und Erlass; Gast sieht die Kosten vorab auf der Storno-Seite
- Vertragsanlagen als eigene versionierte Dokumente mit Bedingung (immer, Zusatzleistung, Portal, von Hand),
  je Angebot ausgewaehlt und eingefroren; Zusatzleistungen in der Buchung erfassbar
- FeWo-direkt-Installation legt die Stornoregel aus Paragraf 13 an

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 16:32:48 +01:00

91 lines
2.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Enums;
use App\Filament\Pages\OccupancyCalendar;
use App\Filament\Pages\PricesAndOffers;
use App\Filament\Resources\BlockedPeriods\BlockedPeriodResource;
use App\Filament\Resources\Bookings\BookingResource;
use App\Filament\Resources\BookingTasks\BookingTaskResource;
use App\Filament\Resources\Cancellations\CancellationResource;
use App\Filament\Resources\Channels\ChannelResource;
use App\Filament\Resources\ChannelTasks\ChannelTaskResource;
use App\Filament\Resources\Guests\GuestResource;
use App\Filament\Resources\Photos\PhotoResource;
use App\Filament\Resources\PortalOccupations\PortalOccupationResource;
use App\Filament\Resources\Reviews\ReviewResource;
use Filament\Support\Contracts\HasDescription;
use Filament\Support\Contracts\HasLabel;
/**
* How much of the admin a user sees. It only shapes the menu – what a user may do is decided by the role.
*/
enum AdminMode: string implements HasDescription, HasLabel
{
case Simple = 'simple';
case Expert = 'expert';
/**
* Menu entries of the simple mode: day-to-day work with requests, bookings, contracts and the calendar.
*
* @var list<class-string>
*/
public const SIMPLE_NAVIGATION = [
OccupancyCalendar::class,
InboxMessageResource::class,
BookingResource::class,
PortalOccupationResource::class,
BlockedPeriodResource::class,
PricesAndOffers::class,
GuestResource::class,
ChannelTaskResource::class,
BookingTaskResource::class,
CancellationResource::class,
ChannelResource::class,
ReviewResource::class,
PhotoResource::class,
];
public function getLabel(): string
{
return match ($this) {
self::Simple => 'Einfache Ansicht',
self::Expert => 'Expertenansicht',
};
}
public function getDescription(): string
{
return match ($this) {
self::Simple => 'Das Tägliche: Postfach, Anfragen, Buchungen und Verträge, Sperrzeiten, Preise & Angebote, Gäste, Kalenderabgleich (iCal), Portal-Aufgaben, Bewertungen, Fotos',
self::Expert => 'Alle Einstellungen: Preise, Angebote, Kalenderabgleich (iCal), Webseite, System',
};
}
/**
* Whether a resource or page appears in the menu in this mode.
*
* @param class-string $class
*/
public function shows(string $class): bool
{
return $this === self::Expert || in_array($class, self::SIMPLE_NAVIGATION, true);
}
/**
* Label of the user menu entry that switches to this mode.
*/
public function switchLabel(): string
{
return match ($this) {
self::Simple => 'Zur einfachen Ansicht wechseln',
self::Expert => 'Zur Expertenansicht wechseln',
};
}
public function other(): self
{
return $this === self::Simple ? self::Expert : self::Simple;
}
}