Doppelbuchungen nur einmal melden und im Postfach der Verwaltung zeigen
Der Kalenderabgleich alle 5 Minuten hat jede fortbestehende Ueberschneidung erneut gemailt. ReportChannelConflicts legt jede Ueberschneidung einmal im neuen Postfach (InboxMessage, Fingerabdruck je Mandant) ab und mailt nur neue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
876a0a20f3
commit
b9225f5fb8
17 files changed
+593
-15
No files matched your search
@@ -9,13 +9,13 @@
|
||||
use App\Enums\PortalEmailStatus;
|
||||
use App\Enums\PortalEmailType;
|
||||
use App\Enums\TenantServiceKey;
|
||||
use App\Mail\ChannelConflict;
|
||||
use App\Mail\PortalMailNotification;
|
||||
use App\Models\BlockedPeriod;
|
||||
use App\Models\Channel;
|
||||
use App\Models\PortalEmail;
|
||||
use App\Support\Settings;
|
||||
use App\Tenancy\TenantFeatures;
|
||||
use Carbon\CarbonInterface;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
@@ -80,7 +80,7 @@ public function handle(PortalMail $mail): ?PortalEmail
|
||||
}
|
||||
|
||||
if ($conflicts !== []) {
|
||||
rescue(fn () => Mail::to(Settings::notificationRecipients())->send(new ChannelConflict($channel, $conflicts)));
|
||||
app(ReportChannelConflicts::class)->handle($channel, $conflicts);
|
||||
}
|
||||
|
||||
return $record;
|
||||
@@ -126,7 +126,7 @@ public function senders(Channel $channel): array
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<string> $conflicts
|
||||
* @param array<string, CarbonInterface> $conflicts description => first night
|
||||
* @return array{PortalEmailStatus, ?BlockedPeriod, ?string}
|
||||
*/
|
||||
private function block(Channel $channel, ParsedPortalMail $parsed, array &$conflicts): array
|
||||
@@ -158,7 +158,7 @@ private function block(Channel $channel, ParsedPortalMail $parsed, array &$confl
|
||||
$block->forceFill(['needs_review' => true, 'review_note' => 'Überlappende Portalrepräsentationen ohne gemeinsame Kennung persönlich prüfen.'])->saveQuietly();
|
||||
}
|
||||
|
||||
$conflicts = $this->conflictDetector->conflictsFor($block);
|
||||
$conflicts = array_fill_keys($this->conflictDetector->conflictsFor($block), $block->starts_on);
|
||||
|
||||
return [PortalEmailStatus::Blocked, $block, null];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user