Test: Zahlungsanforderungen nur bei eigenem Inkasso, nie doppelt; Doku der operativen Stellen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c46f4a032b
commit
6f14437855
2 files changed
+32
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace Tests\Feature\Process;
|
||||
|
||||
use App\Actions\ConfigureChannelProcess;
|
||||
use App\Actions\SendBookingReminders;
|
||||
use App\Actions\TakeOverExternalBooking;
|
||||
use App\Enums\ActivityState;
|
||||
use App\Enums\CaseType;
|
||||
@@ -10,6 +11,7 @@
|
||||
use App\Enums\ProcessSetting;
|
||||
use App\Enums\Responsibility;
|
||||
use App\Models\Booking;
|
||||
use App\Models\BookingTask;
|
||||
use App\Models\Channel;
|
||||
use App\Models\Property;
|
||||
use App\Process\CaseActivities;
|
||||
@@ -154,6 +156,26 @@ public static function archetypes(): array
|
||||
];
|
||||
}
|
||||
|
||||
#[DataProvider('combinations')]
|
||||
public function test_payment_requests_arise_from_own_collection_only_and_never_twice(string $collection, string $documents): void
|
||||
{
|
||||
$channel = $this->configured(['collection' => $collection, 'contract_documents' => $documents]);
|
||||
$booking = app(TakeOverExternalBooking::class)->handle($this->property, $channel, CarbonImmutable::parse('2027-07-10'), CarbonImmutable::parse('2027-07-17'), [
|
||||
'portal_reference' => 'ZAHL', 'portal_total' => 98000, 'guests' => 2,
|
||||
'guest' => ['first_name' => 'Pia', 'last_name' => 'Portal', 'email' => 'pia@example.org', 'street' => 'Weg 1', 'postal_code' => '18225', 'city' => 'Kühlungsborn', 'country' => 'DE'],
|
||||
]);
|
||||
$this->travelTo(CarbonImmutable::parse('2027-06-25 10:00'));
|
||||
|
||||
app(SendBookingReminders::class)->handle();
|
||||
$first = BookingTask::query()->where('booking_id', $booking->id)->count();
|
||||
app(SendBookingReminders::class)->handle();
|
||||
$second = BookingTask::query()->where('booking_id', $booking->id)->count();
|
||||
|
||||
$this->assertSame($first, $second, 'repeated runs create no second request');
|
||||
$collection === 'collection.own' ? $this->assertGreaterThan(0, $first, 'we collect: payment tasks exist') : $this->assertSame(0, $first, 'the portal collects: no own payment request towards the guest');
|
||||
$this->assertNull($booking->fresh()->confirmation_sent_at, 'a portal event or reminder never creates or changes our contract');
|
||||
}
|
||||
|
||||
public function test_the_archetypes_are_presets_of_the_base_process(): void
|
||||
{
|
||||
$catalogue = app(ProcessCatalogue::class);
|
||||
|
||||
Reference in new issue
Block a user