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>
34 lines
735 B
PHP
34 lines
735 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\InboxMessageKind;
|
|
use App\Models\InboxMessage;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<InboxMessage>
|
|
*/
|
|
class InboxMessageFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'kind' => InboxMessageKind::ChannelConflict,
|
|
'fingerprint' => fake()->unique()->uuid(),
|
|
'subject' => fake()->sentence(4),
|
|
'body' => fake()->sentence(),
|
|
];
|
|
}
|
|
|
|
public function read(): static
|
|
{
|
|
return $this->state(fn (): array => ['read_at' => now()]);
|
|
}
|
|
}
|