- Buchung ist der einheitliche Vorgang: Eingangsart, Vorgangsart A1–A6, eingefrorenes Abwicklungsprofil, gespeicherter Verlauf (booking_events); Gast, Personen und Beträge dürfen unbekannt sein, Platzhalter-Gäste werden migriert und nicht mehr angelegt - Einstellungen in Ebenen: Vermieterstandard (So arbeite ich), Abweichung der Wohnung (Experte), Abweichung je Portal und Eingangsart; ersetzt booking_model als Steuergröße - Ein Weg für extern verbindliche Buchungen (TakeOverExternalBooking) statt RecordPortalBooking und "Akte anlegen"; Portalpreis als belegte Gesamtposition - Startseite "Zu erledigen", neue Vorgangsseite mit nächstem Schritt, Automatik-Schalter, "Beenden" mit Storno statt Statusumschaltung; Status von Hand nur im Expertenmodus - Migration übernimmt bisheriges Verhalten unverändert (abweichende Wohnungswerte bleiben als Abweichung), Bericht: php artisan process:settings-report Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
2.3 KiB
PHP
79 lines
2.3 KiB
PHP
<?php
|
||
|
||
namespace App\Enums;
|
||
|
||
use App\Filament\Pages\Dashboard;
|
||
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\Guests\GuestResource;
|
||
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: the start page with everything to do, calendar, cases, guests, blocked periods
|
||
* and prices. Tasks, portal tasks and the mailbox are part of the start page's work list.
|
||
*
|
||
* @var list<class-string>
|
||
*/
|
||
public const SIMPLE_NAVIGATION = [
|
||
Dashboard::class,
|
||
OccupancyCalendar::class,
|
||
BookingResource::class,
|
||
GuestResource::class,
|
||
BlockedPeriodResource::class,
|
||
PricesAndOffers::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: Start mit allem, was zu tun ist, Kalender, Vorgänge, Gäste, Sperrzeiten, Preise',
|
||
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;
|
||
}
|
||
}
|