Files
fewo-stommer/app/Process/Modules/Money/InternalPayment.php
T
LarsandClaude Sonnet 5.5 8442d0a3d8 V2.1: Kanalfähigkeiten, Ausführungsvarianten, Dokumentenentkopplung, Portalbestätigung
Modellwahl über Kanalfähigkeiten mit erklärten Einschränkungen, Abgleich alter Werte,
Ausführungsvarianten je Modul, getrennte Vertrags-/Buchungsinformation, Warten auf
die Portalbestätigung mit Eskalation und Wiederaufnahme (Fälle C und D getestet).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 07:54:11 +01:00

51 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Process\Modules\Money;
use App\Enums\ActivityState;
use App\Enums\Execution;
use App\Process\Activity;
use App\Process\CaseContext;
use App\Process\Modules\Module;
use App\Process\Modules\ModuleDefinition;
use App\Support\Money;
/**
* A6: payment of an internal occasion with a price (e.g. linen, visitor's tax) – recorded, never reminded.
*/
final class InternalPayment extends Module
{
public static function key(): string
{
return 'payments.internal';
}
public static function definition(): ModuleDefinition
{
return new ModuleDefinition(
label: 'Zahlung (ohne Erinnerungen)',
purpose: 'Hält fest, was bei einer Eigenbelegung oder privaten Überlassung bezahlt wurde – ohne Erinnerungen.',
phase: 'P03',
executions: [Execution::Manual],
condition: 'bei einer Eigenbelegung mit Preis',
effects: ['case_write'],
toggle: ModuleDefinition::TOGGLE_CONDITIONAL,
performers: ['landlord'],
events: ['payment'],
);
}
public function applies(CaseContext $case): bool
{
return $case->booking->total !== null && $case->booking->total > 0;
}
public function activities(CaseContext $case): array
{
$booking = $case->booking;
$paid = $booking->paidAmount();
return [new Activity('payment', 'Zahlung (ohne Erinnerungen)', $case->later($paid >= $booking->total ? ActivityState::Done : ActivityState::Later), Money::format($paid).' von '.Money::format($booking->total).' bezahlt')];
}
}