- IMAP-Abruf jede Minute (webklex/php-imap, ohne PHP-imap-Erweiterung) oder signierter Push von n8n - Parser für Buchungs-, Storno- und Anfrage-Mails (de/en), Buchungsnummer, An-/Abreise - Erkannte Buchungen werden sofort gesperrt und an handgepflegte Portale weitergegeben; Kalender-Abgleich übernimmt bzw. ersetzt Mail-Sperren - Unklare Mails: Prüf-Mail + Admin-Liste Portal-E-Mails mit Aktion Sperre anlegen - Überwachung des Postfachs in Monitor und /health/sync Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
1.5 KiB
PHP
58 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\PortalEmails;
|
|
|
|
use App\Enums\PortalEmailStatus;
|
|
use App\Filament\Resources\PortalEmails\Pages\ListPortalEmails;
|
|
use App\Filament\Resources\PortalEmails\Tables\PortalEmailsTable;
|
|
use App\Models\PortalEmail;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use UnitEnum;
|
|
|
|
class PortalEmailResource extends Resource
|
|
{
|
|
protected static ?string $model = PortalEmail::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedEnvelopeOpen;
|
|
|
|
protected static string|UnitEnum|null $navigationGroup = 'Vermietung';
|
|
|
|
protected static ?string $modelLabel = 'Portal-E-Mail';
|
|
|
|
protected static ?string $pluralModelLabel = 'Portal-E-Mails';
|
|
|
|
protected static ?int $navigationSort = 5;
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return PortalEmailsTable::configure($table);
|
|
}
|
|
|
|
public static function canCreate(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
$review = PortalEmail::query()->where('status', PortalEmailStatus::NeedsReview)->count();
|
|
|
|
return $review > 0 ? (string) $review : null;
|
|
}
|
|
|
|
public static function getNavigationBadgeColor(): string
|
|
{
|
|
return 'danger';
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListPortalEmails::route('/'),
|
|
];
|
|
}
|
|
}
|