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>
137 lines
3.8 KiB
PHP
137 lines
3.8 KiB
PHP
<?php
|
||
|
||
namespace App\Process\Templates;
|
||
|
||
use App\Enums\Responsibility;
|
||
|
||
/**
|
||
* A centrally defined, versioned function template (docs/Prozessarchitektur/SCHABLONEN.md): a business combination of
|
||
* already existing modules for one slot of a process model. A template is no second process engine – it only names
|
||
* the modules the plan gets at its slot, what it needs, what it provides, who answers for the result and which
|
||
* portal capability it presupposes. The modules stay individually configurable (MODUL_KONFIGURATIONSMATRIX).
|
||
*/
|
||
abstract class FunctionTemplate
|
||
{
|
||
abstract public static function key(): string;
|
||
|
||
abstract public static function version(): int;
|
||
|
||
abstract public static function area(): TemplateArea;
|
||
|
||
abstract public static function label(): string;
|
||
|
||
/** The business purpose in plain words. */
|
||
abstract public static function purpose(): string;
|
||
|
||
/**
|
||
* The modules this template puts at its slot, in order.
|
||
*
|
||
* @return list<string>
|
||
*/
|
||
abstract public static function modules(): array;
|
||
|
||
/** 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
|
||
* confirmed capabilities decide; an unknown one is a hint, never taken as proven).
|
||
*
|
||
* @return array<string, bool>
|
||
*/
|
||
public static function capabilityRequirements(): array
|
||
{
|
||
return [];
|
||
}
|
||
|
||
/**
|
||
* Results of the process this template needs (provided by the base process or another template).
|
||
*
|
||
* @return list<string>
|
||
*/
|
||
public static function requires(): array
|
||
{
|
||
return [];
|
||
}
|
||
|
||
/**
|
||
* Results this template provides. The result of its area is always among them.
|
||
*
|
||
* @return list<string>
|
||
*/
|
||
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.
|
||
*
|
||
* @return array<string, string>
|
||
*/
|
||
public static function incompatibleWith(): array
|
||
{
|
||
return [];
|
||
}
|
||
|
||
/**
|
||
* What the template stands for along the business dimensions of its area (shown in the configurator):
|
||
* dimension label => statement.
|
||
*
|
||
* @return array<string, string>
|
||
*/
|
||
public static function dimensions(): array
|
||
{
|
||
return [];
|
||
}
|
||
|
||
/**
|
||
* Capabilities that are not built yet; they appear as extensions, never as promises.
|
||
*
|
||
* @return list<string>
|
||
*/
|
||
public static function extensions(): array
|
||
{
|
||
return [];
|
||
}
|
||
|
||
/**
|
||
* The settings the template fixes for the cases that follow it (setting key => value).
|
||
*
|
||
* @return array<string, string>
|
||
*/
|
||
public static function fixes(): array
|
||
{
|
||
return [static::area()->setting()->value => static::responsibility()->value];
|
||
}
|
||
|
||
public static function reference(): string
|
||
{
|
||
return static::key().'@'.static::version();
|
||
}
|
||
}
|