Lege das Datenmodell und den Anfrageservice der Kommunikationsverwaltung an
Anliegen, Feldkatalog, Feldgruppen, Anfragevorlagen mit unveränderlichen Fassungen, Anfrage-Einstiege und eingegangene Anfragen. Eine gemeinsame Regelauswertung bedient Besucher, Vorschau und Anfrageservice; Werte nicht mehr relevanter Felder werden verworfen, Anliegen und Auswahlwerte serverseitig geprüft, doppeltes Absenden bleibt eine Anfrage. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e2d64a4a9
commit
2ee1fc9866
30 files changed
+3380
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Communication;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Allgemeine Kommunikationsvorgaben (eine Zeile): Empfänger der internen Benachrichtigung und Aufbewahrungsdauer.
|
||||
* Empfänger werden nur hier gepflegt; Besucher und das CMS können keine Empfänger angeben.
|
||||
*/
|
||||
class CommunicationSettings extends Model
|
||||
{
|
||||
protected $fillable = ['recipients', 'retention_months'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['recipients' => 'array', 'retention_months' => 'integer'];
|
||||
}
|
||||
|
||||
public static function current(): self
|
||||
{
|
||||
return self::query()->first() ?? self::query()->create(['recipients' => []]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function recipientList(): array
|
||||
{
|
||||
return array_values(array_filter(
|
||||
(array) $this->recipients,
|
||||
fn (mixed $address): bool => is_string($address) && filter_var($address, FILTER_VALIDATE_EMAIL) !== false,
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user