Vorgangskern und geführte Vorgangsbearbeitung (Pakete 1 und 2, Prozessarchitektur v0.10)
- 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>
This commit is contained in:
1 parent
9005c12164
commit
3a728c3255
78 files changed
+4296
-1180
No files matched your search
@@ -7,11 +7,13 @@
|
||||
use App\Enums\ChannelEchoBehavior;
|
||||
use App\Enums\ChannelExportMode;
|
||||
use App\Enums\ChannelStatus;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\ProcessSetting;
|
||||
use App\Filament\Forms\ProcessSettingFields;
|
||||
use App\Models\Channel;
|
||||
use App\Models\ContractAnnex;
|
||||
use App\Models\ContractTemplate;
|
||||
use App\Models\Property;
|
||||
use App\Support\CurrentProperty;
|
||||
use App\Support\Settings;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
@@ -51,34 +53,9 @@ public static function configure(Schema $schema, bool $selectProperty = false):
|
||||
->required()
|
||||
->maxLength(100),
|
||||
Select::make('status')->label('Kanalstatus')->options(ChannelStatus::class)->default(ChannelStatus::Setup)->required(),
|
||||
Select::make('booking_model')->label('Buchungsmodell')->options(ChannelBookingModel::class)->default(ChannelBookingModel::Mixed)->required()
|
||||
Select::make('booking_model')->label('Was kommt über dieses Portal?')->options(ChannelBookingModel::class)->default(ChannelBookingModel::Mixed)->required()
|
||||
->helperText('„Portalbuchung“ und „Gemischt“ gelten als Sofortbuchung: automatische Angebote für diese Wohnung warten, bis das Portal unseren Kalender abgerufen hat. „Vermittlung / Anfrage“: keine Sofortbuchung.'),
|
||||
Section::make('Standardprozess für Buchungen über dieses Portal')
|
||||
->description('Hier legen Sie fest, was bei einer Buchung über dieses Portal gilt – getrennt nach Buchungstyp. Die Vertragsvorlage bringt Vertragstext, Stornoregel und Vertragsanlagen mit (Menü Einrichtung › Vertragsvorlagen). Der Ablauf selbst (Kontaktdaten, Vertrag, Zahlung, Anreise) steht in der Akte jeder Buchung.')
|
||||
->columns(2)
|
||||
->columnSpanFull()
|
||||
->schema([
|
||||
Select::make('contract_template_id')
|
||||
->label('Anfrage über dieses Portal: Vertragsvorlage')
|
||||
->options(fn (): array => ContractTemplate::query()->orderBy('name')->orderBy('version')->get()->mapWithKeys(fn (ContractTemplate $template): array => [$template->id => $template->label()])->all())
|
||||
->placeholder('Standard der Wohnung')
|
||||
->live()
|
||||
->helperText(fn (Get $get): string => self::templateSummary($get('contract_template_id'), 'Wir antworten persönlich, Angebot und Vertrag kommen von uns. ')),
|
||||
Select::make('contract_template_reservation_id')
|
||||
->label('Buchung beim Portal verbindlich: Vertragsvorlage')
|
||||
->options(fn (): array => ContractTemplate::query()->orderBy('name')->orderBy('version')->get()->mapWithKeys(fn (ContractTemplate $template): array => [$template->id => $template->label()])->all())
|
||||
->placeholder('wie bei Anfragen')
|
||||
->live()
|
||||
->helperText(fn (Get $get): string => self::templateSummary($get('contract_template_reservation_id') ?? $get('contract_template_id'), 'Das Portal hat die Buchung schon verbindlich gemacht, wir senden den Vertrag. ')),
|
||||
Toggle::make('payment_tasks_inquiry')
|
||||
->label('Anfrage über dieses Portal: Zahlungsaufgaben anlegen')
|
||||
->helperText('Fällige Anzahlungen/Restzahlungen erscheinen als Aufgabe (Mails an Gäste gehen nie automatisch).')
|
||||
->default(true),
|
||||
Toggle::make('payment_tasks_reservation')
|
||||
->label('Buchung beim Portal verbindlich: Zahlungsaufgaben anlegen')
|
||||
->helperText('Aus, wenn das Portal das Geld einzieht und mahnt (z. B. FeWo-direkt Online-Buchung).')
|
||||
->default(false),
|
||||
]),
|
||||
...self::processSections(),
|
||||
Select::make('connector')
|
||||
->label('Kalenderanbindung')
|
||||
->helperText('Diese Verbindung gleicht Belegungszeiträume über iCal ab. Weitere Portalfunktionen benötigen eine eigene Anbindung.')
|
||||
@@ -128,15 +105,35 @@ public static function configure(Schema $schema, bool $selectProperty = false):
|
||||
/**
|
||||
* What a contract template brings along, shown under the template choice.
|
||||
*/
|
||||
private static function templateSummary(mixed $templateId, string $intro): string
|
||||
/**
|
||||
* Deviations of this portal from the landlord's defaults, separately for requests and for bookings that are already
|
||||
* binding when they arrive. Empty fields follow the defaults (System › So arbeite ich).
|
||||
*
|
||||
* @return list<Section>
|
||||
*/
|
||||
private static function processSections(): array
|
||||
{
|
||||
$template = filled($templateId) ? ContractTemplate::query()->with('cancellationPolicy')->find($templateId) : null;
|
||||
if ($template === null) {
|
||||
return $intro.'Ohne Auswahl gilt die Vorlage der Wohnung bzw. die Texte der Webseite.';
|
||||
}
|
||||
$defaults = (array) (Settings::tenant()?->process_defaults ?? []);
|
||||
$inherited = function (ProcessSetting $setting) use ($defaults): string {
|
||||
$value = $setting->normalize($defaults[$setting->value] ?? null) ?? $setting->default();
|
||||
|
||||
$annexes = ContractAnnex::query()->whereIn('id', (array) ($template->annex_ids ?? []))->orderBy('name')->pluck('name')->implode(', ');
|
||||
return $setting === ProcessSetting::ContractTemplate ? 'Vorlage der Wohnung' : $setting->describe($value);
|
||||
};
|
||||
$settingsFor = fn (IntakeKind $intake): array => array_values(array_filter(ProcessSetting::cases(), fn (ProcessSetting $setting): bool => in_array($intake, $setting->channelIntakes(), true)));
|
||||
|
||||
return $intro.'Die Vorlage bringt mit: Stornoregel '.($template->cancellationPolicy?->name ?? '– keine –').' · Anlagen: '.($annexes ?: 'keine').'.';
|
||||
return [
|
||||
Section::make('Anfragen über dieses Portal')
|
||||
->description('Nur ausfüllen, was bei diesem Portal anders ist als in Ihren Standardeinstellungen.')
|
||||
->columns(2)
|
||||
->columnSpanFull()
|
||||
->collapsible()
|
||||
->schema(ProcessSettingFields::make('process_overrides.inquiry.', $settingsFor(IntakeKind::Inquiry), $inherited)),
|
||||
Section::make('Feste Buchungen über dieses Portal')
|
||||
->description('Buchungen, die beim Portal schon verbindlich sind. Die Vertragsvorlage bringt Vertragstext, Stornoregel und Anlagen mit.')
|
||||
->columns(2)
|
||||
->columnSpanFull()
|
||||
->collapsible()
|
||||
->schema(ProcessSettingFields::make('process_overrides.booking.', $settingsFor(IntakeKind::Booking), $inherited)),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user