Neues Modul Interne Stellenausschreibungen (0.28.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m18s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m1s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m33s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m8s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m42s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m37s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m43s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m38s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-27 10:16:48 +00:00
parent b322b97f32
commit 993d49c99c
146 changed files with 1981 additions and 305 deletions

View file

@ -0,0 +1,40 @@
<?php
namespace Inhaus\Plugins\Stellen;
use App\Models\User;
use App\Notifications\PortalNotification;
use Illuminate\Support\Facades\Notification;
use Inhaus\Plugins\Stellen\Models\JobPosting;
/**
* Neue Stellen einmalig ankündigen (Glocke und Push an alle aktiven Personen).
* Geplante Stellen werden angekündigt, sobald sie erscheinen.
*/
class Announcer
{
public function announceIfDue(JobPosting $posting): void
{
if ($posting->announced_at !== null || ! $posting->isOpen()) {
return;
}
$posting->forceFill(['announced_at' => now()])->save();
$notification = new PortalNotification(
'Neue interne Stelle: '.$posting->title,
collect([$posting->department, $posting->location, $posting->summary()])->filter()->implode(' · '),
route('jobs.show', $posting, false),
'briefcase',
);
User::query()->active()->whereKeyNot($posting->created_by ?? 0)->chunkById(500, fn ($users) => Notification::send($users, $notification));
}
public function announceDue(): int
{
$due = JobPosting::query()->open()->whereNull('announced_at')->get();
$due->each(fn (JobPosting $posting) => $this->announceIfDue($posting));
return $due->count();
}
}