Anfrage-Basisprozess inquiry.request mit Schablonen für Antwort und Gastkommunikation

Antwortart (Auskunft/Angebot) und Reservierung sind entkoppelt (neue Einstellung inquiry_answer;
pre_reservation bleibt die Reservierungsstrategie). Anlass-bezogene Absender für Anreise-Information
und Bewertungsbitte; Schablonen liefern Standardwerte unterhalb aller einstellbaren Ebenen.
A1/A2 bleiben Voreinstellungen und Altfassungen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-05 12:40:22 +01:00
1 parent e40f8639b3
commit 221ce8ca81
51 files changed
+773 -73

No files matched your search

+26 -2
View File
@@ -30,8 +30,11 @@ abstract public static function purpose(): string;
*/
abstract public static function modules(): array;
/** Who answers for the result of the area. It becomes the value of the area's responsibility setting. */
abstract public static function responsibility(): Responsibility;
/** Who answers for the result of the area (we, unless the template hands it to the portal). */
public static function responsibility(): Responsibility
{
return Responsibility::Landlord;
}
/**
* The portal capability that must hold for the template to fit: capability key => required value (the channel's
@@ -64,6 +67,27 @@ public static function provides(): array
return [static::area()->result()];
}
/**
* Standard configuration the template suggests (setting key => value). It sits below every level the landlord can set
* – landlord, property, channel – so it never overrides an explicit value, and every module stays configurable.
*
* @return array<string, string|int|bool>
*/
public static function defaults(): array
{
return [];
}
/**
* Modules outside the template's own slot that its defaults or fixes configure (shown with the template).
*
* @return list<string>
*/
public static function configures(): array
{
return [];
}
/**
* Templates (keys) that must not be combined with this one, with the reason.
*
@@ -0,0 +1,61 @@
<?php
namespace App\Process\Templates;
/**
* A request is answered with a non-binding information; the guest can ask for the booking from it, we check again and
* confirm. By definition (DocumentKind::Information) an information reserves nothing, so this template – and only
* this one – fixes the reservation to "no". Everything else (processing mode, deadlines, data request) stays free.
*/
final class InformationAnswer extends FunctionTemplate
{
public static function key(): string
{
return 'inquiry.information';
}
public static function version(): int
{
return 1;
}
public static function area(): TemplateArea
{
return TemplateArea::InquiryAnswer;
}
public static function label(): string
{
return 'Unverbindliche Auskunft';
}
public static function purpose(): string
{
return 'Der Gast erhält Preis und Verfügbarkeit zum Stand der Prüfung, ohne Reservierung und ohne Zusage. Er kann daraus die Buchung anfragen; verbindlich wird sie erst mit unserer Bestätigung nach erneuter Prüfung.';
}
public static function modules(): array
{
return ['offer.information'];
}
public static function requires(): array
{
return ['guest.identified', 'availability.checked'];
}
public static function fixes(): array
{
return ['inquiry_answer' => 'information', 'pre_reservation' => false];
}
public static function dimensions(): array
{
return [
'Verbindlichkeit' => 'Keine; der Vertrag entsteht erst nach dem Buchungswunsch und unserer Bestätigung.',
'Reservierung' => 'Keine (Festlegung der Auskunft, nicht des Prozesses).',
'Ausführung' => 'Automatisch, nach Freigabe oder von Hand (Modul „Unverbindliche Auskunft“).',
'Nachweis' => 'Versendete Auskunft mit Version und Stand der Prüfung.',
];
}
}
+67
View File
@@ -0,0 +1,67 @@
<?php
namespace App\Process\Templates;
/**
* A request is answered with a binding offer (contract draft, signed link) the guest accepts. The reservation strategy
* is not part of the template: it only suggests to reserve at the request (clarification hold, offer hold). Whoever
* prefers to offer without holding the dates at the request sets the reservation to "no" – the offer itself still
* holds the dates for its validity, and availability is checked before it goes out.
*/
final class OfferAnswer extends FunctionTemplate
{
public static function key(): string
{
return 'inquiry.binding_offer';
}
public static function version(): int
{
return 1;
}
public static function area(): TemplateArea
{
return TemplateArea::InquiryAnswer;
}
public static function label(): string
{
return 'Verbindliches Angebot';
}
public static function purpose(): string
{
return 'Der Gast erhält ein verbindliches Angebot mit Vertragsentwurf und nimmt es mit einem Klick an. Danach ist die Buchung verbindlich.';
}
public static function modules(): array
{
return [];
}
public static function requires(): array
{
return ['guest.identified', 'availability.checked'];
}
public static function fixes(): array
{
return ['inquiry_answer' => 'offer'];
}
public static function defaults(): array
{
return ['pre_reservation' => true];
}
public static function dimensions(): array
{
return [
'Verbindlichkeit' => 'Mit der Annahme des Gastes (Annahmeprotokoll).',
'Reservierung' => 'Vorschlag: Zeitraum schon bei der Anfrage reservieren; frei einstellbar. Das Angebot hält den Zeitraum in jedem Fall für seine Gültigkeit.',
'Ausführung' => 'Automatisch, nach Freigabe oder von Hand; Preisänderungen nur als Anpassungszeile.',
'Nachweis' => 'Angebotsversion, Annahme mit Zeitstempel und Prüfsumme.',
];
}
}
+1 -1
View File
@@ -52,7 +52,7 @@ public static function capabilityRequirements(): array
public static function requires(): array
{
return ['binding.portal_total'];
return ['price.known'];
}
public static function provides(): array
@@ -0,0 +1,64 @@
<?php
namespace App\Process\Templates;
/**
* Standard: we write to the guest. It only suggests; each occasion (arrival information, review request) has its own
* sender setting and stays individually configurable – there is no all-or-nothing responsibility for guest messages.
*/
final class OwnGuestCommunication extends FunctionTemplate
{
public static function key(): string
{
return 'guest_comm.own';
}
public static function version(): int
{
return 1;
}
public static function area(): TemplateArea
{
return TemplateArea::GuestCommunication;
}
public static function label(): string
{
return 'Gastkommunikation durch uns';
}
public static function purpose(): string
{
return 'Anreise-Informationen und Bewertungsbitte gehen von uns an den Gast. Einzelne Anlässe lassen sich trotzdem dem Portal zuweisen.';
}
public static function modules(): array
{
return ['arrival.details', 'arrival.info'];
}
public static function configures(): array
{
return ['review.request'];
}
public static function fixes(): array
{
return [];
}
public static function defaults(): array
{
return ['guest_messages' => 'landlord'];
}
public static function dimensions(): array
{
return [
'Anreise-Information' => 'Von uns, N Tage vor Anreise (einstellbar).',
'Bewertungsbitte' => 'Von uns nach dem Aufenthalt.',
'Medium' => 'E-Mail (über das Mail-Tor; weitere Medien sind nicht angebunden).',
];
}
}
+1 -1
View File
@@ -52,7 +52,7 @@ public static function capabilityRequirements(): array
public static function requires(): array
{
return ['binding.portal_total'];
return ['price.known'];
}
public static function provides(): array
@@ -0,0 +1,76 @@
<?php
namespace App\Process\Templates;
use App\Enums\Responsibility;
/**
* Standard: the portal writes to the guest (e.g. FeWo-direkt). Suggests the portal as sender of the arrival information
* and the review request; each occasion can still be taken back by us individually. Needs the portal to write to guests.
*/
final class PortalGuestCommunication extends FunctionTemplate
{
public static function key(): string
{
return 'guest_comm.portal';
}
public static function version(): int
{
return 1;
}
public static function area(): TemplateArea
{
return TemplateArea::GuestCommunication;
}
public static function label(): string
{
return 'Gastkommunikation durch das Portal';
}
public static function purpose(): string
{
return 'Das Portal schreibt dem Gast zu Anreise und Bewertung. Wir halten fest, dass es angekündigt ist – eine Zustellung gilt damit nicht als nachgewiesen. Einzelne Anlässe lassen sich trotzdem von uns übernehmen.';
}
public static function modules(): array
{
return ['arrival.details', 'arrival.info'];
}
public static function configures(): array
{
return ['review.request'];
}
public static function responsibility(): Responsibility
{
return Responsibility::Portal;
}
public static function capabilityRequirements(): array
{
return ['messages_guest' => true];
}
public static function fixes(): array
{
return [];
}
public static function defaults(): array
{
return ['guest_messages' => 'portal', 'arrival_info_sender' => 'portal', 'review_request_sender' => 'portal'];
}
public static function dimensions(): array
{
return [
'Anreise-Information' => 'Durch das Portal (angekündigt, nicht nachgewiesen).',
'Bewertungsbitte' => 'Durch das Portal.',
'Medium' => 'Das des Portals.',
];
}
}
+25
View File
@@ -12,12 +12,16 @@ enum TemplateArea: string
{
case Collection = 'collection';
case ContractDocuments = 'contract_documents';
case InquiryAnswer = 'inquiry_answer';
case GuestCommunication = 'guest_communication';
public function label(): string
{
return match ($this) {
self::Collection => 'Finanzabwicklung (Inkasso)',
self::ContractDocuments => 'Vertragsdokumentation',
self::InquiryAnswer => 'Beantwortung der Anfrage',
self::GuestCommunication => 'Gastkommunikation',
};
}
@@ -26,6 +30,8 @@ public function question(): string
return match ($this) {
self::Collection => 'Wer zieht das Geld des Gastes ein?',
self::ContractDocuments => 'Wer stellt dem Gast die Vertragsunterlagen bereit?',
self::InquiryAnswer => 'Womit antworten wir zuerst auf eine Anfrage?',
self::GuestCommunication => 'Wer schreibt dem Gast zu welchem Anlass? (Standard – jeder Anlass bleibt einzeln einstellbar)',
};
}
@@ -35,6 +41,8 @@ public function result(): string
return match ($this) {
self::Collection => 'money.collection_handled',
self::ContractDocuments => 'contract.documented',
self::InquiryAnswer => 'inquiry.answered',
self::GuestCommunication => 'guest.communication_assigned',
};
}
@@ -44,6 +52,23 @@ public function setting(): ProcessSetting
return match ($this) {
self::Collection => ProcessSetting::Payments,
self::ContractDocuments => ProcessSetting::Documents,
self::InquiryAnswer => ProcessSetting::InquiryAnswer,
self::GuestCommunication => ProcessSetting::GuestMessages,
};
}
/**
* Every setting a template of this area may fix or suggest – nothing else (no hidden coupling to other areas).
*
* @return list<ProcessSetting>
*/
public function settings(): array
{
return match ($this) {
self::Collection, self::ContractDocuments => [$this->setting()],
// An information reserves nothing by definition; for an offer the reservation is only suggested.
self::InquiryAnswer => [ProcessSetting::InquiryAnswer, ProcessSetting::PreReservation],
self::GuestCommunication => [ProcessSetting::GuestMessages, ProcessSetting::ArrivalInfoSender, ProcessSetting::ReviewRequestSender],
};
}
}
@@ -72,6 +72,11 @@ public function problems(ProcessModel $model, array $chosen, string $variant = '
$classes = [];
foreach ($resolved as $area => $reference) {
$class = $this->catalogue->templateClass($reference);
if ($class !== null && isset($model::templateRestrictions()[$class::key()])) {
$problems[] = '„'.$class::label().'“ passt nicht zu „'.$model::label().'“: '.$model::templateRestrictions()[$class::key()];
continue;
}
if ($class === null) {
$problems[] = 'Die Schablone „'.$reference.'“ gibt es nicht.';