- 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>
91 lines
2.6 KiB
PHP
91 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Bookings;
|
|
|
|
use App\Enums\BookingStatus;
|
|
use App\Filament\Concerns\FollowsAdminMode;
|
|
use App\Filament\Concerns\SelectsRecordProperty;
|
|
use App\Filament\Resources\Bookings\Pages\CreateBooking;
|
|
use App\Filament\Resources\Bookings\Pages\ListBookings;
|
|
use App\Filament\Resources\Bookings\Pages\ViewBooking;
|
|
use App\Filament\Resources\Bookings\RelationManagers\MessagesRelationManager;
|
|
use App\Filament\Resources\Bookings\RelationManagers\PaymentsRelationManager;
|
|
use App\Filament\Resources\Bookings\RelationManagers\TasksRelationManager;
|
|
use App\Filament\Resources\Bookings\Schemas\BookingForm;
|
|
use App\Filament\Resources\Bookings\Schemas\BookingInfolist;
|
|
use App\Filament\Resources\Bookings\Tables\BookingsTable;
|
|
use App\Models\Booking;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use UnitEnum;
|
|
|
|
class BookingResource extends Resource
|
|
{
|
|
use FollowsAdminMode, SelectsRecordProperty;
|
|
|
|
protected static ?string $model = Booking::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCalendarDays;
|
|
|
|
protected static string|UnitEnum|null $navigationGroup = 'Verwaltung';
|
|
|
|
protected static ?string $modelLabel = 'Vorgang';
|
|
|
|
protected static ?string $pluralModelLabel = 'Vorgänge';
|
|
|
|
protected static ?string $recordTitleAttribute = 'reference';
|
|
|
|
protected static ?int $navigationSort = 1;
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return BookingForm::configure($schema);
|
|
}
|
|
|
|
public static function infolist(Schema $schema): Schema
|
|
{
|
|
return BookingInfolist::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return BookingsTable::configure($table);
|
|
}
|
|
|
|
/**
|
|
* Number of open requests waiting for a decision.
|
|
*/
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
$open = Booking::query()->where('status', BookingStatus::Reserved)->count();
|
|
|
|
return $open > 0 ? (string) $open : null;
|
|
}
|
|
|
|
public static function getNavigationBadgeColor(): string
|
|
{
|
|
return 'warning';
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
PaymentsRelationManager::class,
|
|
TasksRelationManager::class,
|
|
MessagesRelationManager::class,
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListBookings::route('/'),
|
|
'create' => CreateBooking::route('/create'),
|
|
'view' => ViewBooking::route('/{record}'),
|
|
];
|
|
}
|
|
}
|