Dokumentenzusammenstellung und Vorlagensteuerung (Paket 3, Prozessarchitektur v0.10)
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m59s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m59s
Eine Zusammenstellung vor jedem Dokument (Angebot, Bestaetigung, Buchungsunterlagen extern), Dokumentart je Vorgangsart, Freigaben fuer Vorlagen und Dokumentarten, Schutz vor unvereinbarten Bedingungen bei Portalbuchungen (E-004), kein doppelter Versand, Absicherung Hold 0 bis Paket 7, A6-Aufenthaltsbestaetigung vorbereitet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
64248c09fa
commit
cf11c8a474
45 files changed
+2385
-144
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Process;
|
||||
|
||||
use App\Actions\SendBookingDocuments;
|
||||
use App\Enums\ActivityState;
|
||||
use App\Enums\BookingStatus;
|
||||
use App\Enums\BookingTaskStatus;
|
||||
@@ -88,13 +89,24 @@ public static function for(Booking $booking): array
|
||||
default => ActivityState::Open,
|
||||
};
|
||||
$missing = $binding && $state === ActivityState::Open ? app(CaseAutomation::class)->documentBlockers($booking) : [];
|
||||
$activities[] = new Activity('documents', $inquiry ? 'Buchungsbestätigung mit Vertrag senden' : 'Buchungsunterlagen an den Gast senden', $later($missing !== [] ? ActivityState::Waiting : $state),
|
||||
// What the landlord still has to confirm (unreleased texts, terms not shown to be agreed on the portal).
|
||||
$toConfirm = $binding && $state === ActivityState::Open && $missing === [] ? app(SendBookingDocuments::class)->compose($booking)->toConfirm() : [];
|
||||
$activities[] = new Activity('documents', match (true) {
|
||||
$state !== ActivityState::Open => $inquiry ? 'Buchungsbestätigung mit Vertrag senden' : 'Buchungsunterlagen an den Gast senden',
|
||||
$inquiry => 'Buchungsbestätigung mit Vertrag prüfen und senden',
|
||||
default => 'Buchungsunterlagen prüfen und senden',
|
||||
}, $later($missing !== [] ? ActivityState::Waiting : $state),
|
||||
match (true) {
|
||||
$booking->confirmation_sent_at !== null => 'gesendet am '.$booking->confirmation_sent_at->format('d.m.Y'),
|
||||
$state === ActivityState::Problem => 'Versand fehlgeschlagen',
|
||||
$missing !== [] => 'wartet: '.implode(' ', $missing),
|
||||
$toConfirm !== [] => 'vor dem Versand zu prüfen: '.implode(' ', $toConfirm),
|
||||
default => null,
|
||||
}, $binding && $missing === [] && $booking->confirmation_sent_at === null ? 'resendConfirmation' : null);
|
||||
}, match (true) {
|
||||
$state === ActivityState::Problem => 'resendConfirmation',
|
||||
$binding && $missing === [] && $booking->confirmation_sent_at === null => 'sendDocuments',
|
||||
default => null,
|
||||
});
|
||||
}
|
||||
|
||||
foreach (self::channelTasks($booking) as $task) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Process;
|
||||
|
||||
use App\Actions\AutoOffer;
|
||||
use App\Actions\ConfirmBooking;
|
||||
use App\Actions\SendBookingDocuments;
|
||||
use App\Enums\BookingStatus;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\ProcessingMode;
|
||||
@@ -13,14 +13,15 @@
|
||||
|
||||
/**
|
||||
* Carries a case on by itself as far as its data allows – only when the case is handled automatically. What it may do
|
||||
* is what the landlord would do next anyway: send the offer of a request, or send the documents of a booking that is
|
||||
* binding on a portal once the guest's e-mail address and the price are known. Whatever stops it is returned in plain
|
||||
* is what the landlord would do next anyway: send the offer of a request, or send the documents of a binding booking
|
||||
* once their composition is complete and needs no confirmation (template released and, for portal bookings, confirmed
|
||||
* as the portal's terms). Whatever stops it is returned in plain
|
||||
* words; the case then shows it as a task. Never touches a case whose profile was taken over from the old data (the
|
||||
* automation did not exist for those cases before).
|
||||
*/
|
||||
class CaseAutomation
|
||||
{
|
||||
public function __construct(private AutoOffer $autoOffer, private ConfirmBooking $confirm) {}
|
||||
public function __construct(private AutoOffer $autoOffer, private SendBookingDocuments $documents) {}
|
||||
|
||||
/**
|
||||
* @return list<string> what keeps the case from going on automatically (empty: nothing to do or done)
|
||||
@@ -52,12 +53,7 @@ private function step(Booking $booking): array
|
||||
}
|
||||
|
||||
if ($booking->isBinding() && $booking->confirmation_sent_at === null && $booking->process()->documents() === Responsibility::Landlord && $booking->process()->origin !== 'migration') {
|
||||
$missing = $this->documentBlockers($booking);
|
||||
if ($missing !== []) {
|
||||
return $missing;
|
||||
}
|
||||
|
||||
return $this->confirm->deliver($booking) ? [] : ['Die Unterlagen konnten nicht versendet werden (siehe Postfach).'];
|
||||
return $this->documents->automatically($booking);
|
||||
}
|
||||
|
||||
return [];
|
||||
|
||||
Reference in new issue
Block a user