Generische iCal-Kanäle mit Bestandsklärung und sicheren Exporten bereitstellen
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m33s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m33s
This commit is contained in:
1 parent
6fe5bbc6e3
commit
783068501c
42 files changed
+2646
-248
No files matched your search
@@ -113,7 +113,7 @@ public function test_overlap_with_an_existing_booking_raises_a_conflict(): void
|
||||
Mail::assertSent(ChannelConflict::class);
|
||||
}
|
||||
|
||||
public function test_calendar_sync_confirms_the_mail_block_without_creating_new_tasks(): void
|
||||
public function test_calendar_without_shared_identity_keeps_the_mail_block_for_review(): void
|
||||
{
|
||||
Channel::factory()->for($this->property)->create(['name' => 'Ostseeklar', 'requires_manual_blocking' => true]);
|
||||
$this->process('Neue Buchung', self::BOOKING_MAIL);
|
||||
@@ -122,19 +122,21 @@ public function test_calendar_sync_confirms_the_mail_block_without_creating_new_
|
||||
$this->fakeFeed("UID:vrbo-123\r\nDTSTART;VALUE=DATE:20261107\r\nDTEND;VALUE=DATE:20261110");
|
||||
(new SyncChannel)->handle($this->fewo);
|
||||
|
||||
$block = $this->fewo->blockedPeriods()->sole();
|
||||
$this->assertSame(['channel', 'vrbo-123'], [$block->source, $block->external_uid]);
|
||||
$this->assertSame(2, $this->fewo->blockedPeriods()->count());
|
||||
$this->assertSame(2, $this->fewo->blockedPeriods()->where('needs_review', true)->count());
|
||||
$this->assertSame($tasksBefore, ChannelTask::count());
|
||||
}
|
||||
|
||||
public function test_calendar_entry_with_other_dates_replaces_the_mail_block(): void
|
||||
public function test_calendar_entry_with_overlapping_dates_does_not_replace_an_unidentified_mail_block(): void
|
||||
{
|
||||
$this->process('Neue Buchung', self::BOOKING_MAIL);
|
||||
|
||||
$this->fakeFeed("UID:vrbo-123\r\nDTSTART;VALUE=DATE:20261107\r\nDTEND;VALUE=DATE:20261111");
|
||||
(new SyncChannel)->handle($this->fewo);
|
||||
|
||||
$this->assertSame(['channel', '2026-11-11'], [$this->fewo->blockedPeriods()->sole()->source, $this->fewo->blockedPeriods()->sole()->ends_on->toDateString()]);
|
||||
$this->assertSame(2, $this->fewo->blockedPeriods()->count());
|
||||
$this->assertSame(1, $this->fewo->blockedPeriods()->where('source', 'email')->count());
|
||||
$this->assertSame('2026-11-11', $this->fewo->blockedPeriods()->where('source', 'channel')->sole()->ends_on->toDateString());
|
||||
}
|
||||
|
||||
public function test_mail_blocks_survive_a_calendar_sync_that_does_not_know_them_yet(): void
|
||||
@@ -206,7 +208,7 @@ private function process(string $subject, string $text, string $messageId = 'msg
|
||||
|
||||
private function fakeFeed(string $event): void
|
||||
{
|
||||
$body = "BEGIN:VCALENDAR\r\n".($event !== '' ? "BEGIN:VEVENT\r\n{$event}\r\nEND:VEVENT\r\n" : '').'END:VCALENDAR';
|
||||
$body = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Synthetic Test//EN\r\n".($event !== '' ? "BEGIN:VEVENT\r\nDTSTAMP:20261022T080000Z\r\n{$event}\r\nEND:VEVENT\r\n" : '').'END:VCALENDAR';
|
||||
Http::fake(['*' => Http::response($body)]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user