Dokumentenzusammenstellung und Vorlagensteuerung (Paket 3, Prozessarchitektur v0.10)
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:
LarsandClaude Opus 5.5 committed 2026-11-01 19:44:52 +01:00
1 parent 64248c09fa
commit cf11c8a474
45 files changed
+2385 -144

No files matched your search

+7 -3
View File
@@ -8,6 +8,7 @@
use App\Documents\OfferTerms;
use App\Enums\BookingStatus;
use App\Mail\BookingConfirmed;
use App\Mail\BookingDocumentation;
use App\Models\Booking;
use App\Models\Channel;
use App\Models\ContractTemplate;
@@ -81,7 +82,8 @@ public function test_offer_with_a_document_template_freezes_body_and_property_fa
public function test_template_without_a_body_keeps_the_text_blocks(): void
{
$template = $this->template('Bausteine', null, null, null);
$template->update(['texts' => ['terms' => '<p>NUR BAUSTEIN</p>']]);
$template->fill(['texts' => ['terms' => '<p>NUR BAUSTEIN</p>']])->applyStatements(released: true, portalTerms: false, actor: 'Test');
$template->save();
$offer = $this->offer(['contract_template_id' => $template->id]);
@@ -106,7 +108,9 @@ public function test_portal_reservation_uses_the_reservation_template_and_a_conf
$this->assertSame('FeWo-direkt', $booking->offer_terms['template']['name']);
$this->assertStringContainsString('PORTAL-VERTRAG', OfferTerms::document($booking)['body']);
Storage::disk('local')->assertExists($booking->contract_path);
Mail::assertSent(BookingConfirmed::class, fn (BookingConfirmed $mail): bool => ! str_contains($mail->render(), 'überweisen'));
// Binding on the portal: booking documentation without payment instructions (payments run via the portal).
Mail::assertSent(BookingDocumentation::class, fn (BookingDocumentation $mail): bool => ! str_contains($mail->render(), 'überweisen') && str_contains($mail->render(), 'Die Zahlung läuft über'));
Mail::assertNotSent(BookingConfirmed::class);
$inquiryPortal = Channel::factory()->for($this->property)->create(['booking_model' => 'inquiry', 'process_overrides' => ['inquiry' => ['contract_template_id' => $inquiry->id], 'booking' => ['contract_template_id' => $reservation->id]]]);
$this->assertSame($inquiry->id, OfferTerms::templateFor($this->booking(['import_channel_id' => $inquiryPortal->id, 'source' => 'portal', 'arrival' => '2026-12-01', 'departure' => '2026-12-03']))->id);
@@ -129,7 +133,7 @@ public function test_installer_creates_the_fewo_direkt_template_once_and_sets_pr
private function template(string $name, ?string $body, ?string $annexTitle, ?string $annexBody): ContractTemplate
{
return ContractTemplate::query()->create(['name' => $name, 'version' => 1, 'body' => $body, 'annex_title' => $annexTitle, 'annex_body' => $annexBody]);
return ContractTemplate::query()->create(['released_at' => now(), 'name' => $name, 'version' => 1, 'body' => $body, 'annex_title' => $annexTitle, 'annex_body' => $annexBody]);
}
/**