U-A/U-B: Prozesskern mit Fachmodulen, versionierten Modellen, eingefrorenem Prozessplan, ProcessRunner (harte/weiche Abhängigkeiten), CasePricing, Loyalty nur im Tester

CaseActivities/CaseAutomation sind Fassaden über ProcessRunner. Verhaltensvergleich v0.11:
11 Abläufe und 198 Konstellationen gleich, beabsichtigte Abweichungen I-004/I-005 (F-001/F-002).
Volle Suite vor U-B: 785/785.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-04 14:49:44 +01:00
1 parent 98df5e9e3b
commit 7e22e12cac
80 files changed
+4628 -445

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
<?php
namespace App\Pricing;
use App\Models\Booking;
use App\Process\CaseContext;
use App\Process\Modules\ContributesToPrice;
use App\Process\ProcessCatalogue;
/**
* The price of a case before it is fixed (extension point BeforePriceFixing, docs/Prozessarchitektur/Architektur/02
* §6.4): PriceCalculator unchanged, plus the lines of the modules of the case's plan that contribute to the price.
* Without contributing modules the result is exactly PriceCalculator's. Never adds anything to a binding case – its
* price is fixed (rule R5). Pure: reads, never writes (also used for previews).
*/
final class CasePricing
{
public function __construct(private PriceCalculator $calculator, private ProcessCatalogue $catalogue) {}
public function quote(Booking $booking, StayRequest $stay): PriceQuote
{
$quote = $this->calculator->calculate($booking->property, $stay);
if ($booking->isBinding() || ! $booking->exists) {
return $quote;
}
$context = CaseContext::of($booking);
foreach ($context->plan->moduleKeys() as $key) {
if (! $this->catalogue->hasModule($key) || ! $context->plan->enabled($key)) {
continue;
}
$module = $this->catalogue->module($key);
if (! $module instanceof ContributesToPrice || ! $module->applies($context)) {
continue;
}
foreach ($module->priceLines($context, $quote) as $line) {
$quote = $quote->withLine($line);
}
}
return $quote;
}
}