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,81 @@
<?php
namespace Inhaus\Plugins\Stellen;
use App\Models\User;
use Inhaus\Plugins\Stellen\Models\JobApplication;
use Inhaus\Plugins\Stellen\Models\JobPosting;
/**
* Daten der Stellen für das Portal.
*/
class Presenter
{
/**
* @return array<string, mixed>
*/
public static function card(JobPosting $posting): array
{
return [
'id' => $posting->id,
'title' => $posting->title,
'department' => $posting->department,
'location' => $posting->location,
'employment' => $posting->employment,
'employment_label' => JobPosting::EMPLOYMENT[$posting->employment] ?? null,
'summary' => $posting->summary(),
'deadline' => $posting->deadline?->toDateString(),
'published_at' => $posting->published_at?->toIso8601String(),
'status' => $posting->status(),
'url' => route('jobs.show', $posting),
];
}
/**
* @return array<string, mixed>
*/
public static function detail(JobPosting $posting, User $viewer): array
{
$contact = $posting->contact?->is_active ? $posting->contact : null;
return [
...self::card($posting),
'hours' => $posting->hours,
'contract' => $posting->contract,
'contract_label' => JobPosting::CONTRACT[$posting->contract] ?? null,
'contract_note' => $posting->contract_note,
'pay_grade' => $posting->pay_grade,
'start' => $posting->start,
'description' => $posting->description,
'pdf' => $posting->pdf_path ? ['name' => $posting->pdf_name, 'url' => route('jobs.pdf', $posting)] : null,
'apply_mode' => $posting->apply_mode,
'apply_url' => $posting->apply_mode === 'link' ? $posting->apply_url : null,
'contact' => $contact ? [
'id' => $contact->id, 'name' => $contact->name, 'initials' => $contact->initials, 'job_title' => $contact->job_title,
'email' => $contact->email, 'phone' => $contact->phone, 'avatar_url' => $contact->avatarUrl(96),
] : null,
];
}
/**
* @return array<string, mixed>
*/
public static function application(JobApplication $application, bool $withPerson = false): array
{
return [
'id' => $application->id,
'status' => $application->status,
'status_label' => JobApplication::STATUSES[$application->status] ?? $application->status,
'message' => $application->message,
'file' => $application->file_path ? ['name' => $application->file_name, 'url' => route('jobs.applications.file', $application)] : null,
'created_at' => $application->created_at?->toIso8601String(),
'updated_at' => $application->updated_at?->toIso8601String(),
'note' => $withPerson ? $application->note : null,
'person' => $withPerson && $application->user ? [
'id' => $application->user->id, 'name' => $application->user->name, 'initials' => $application->user->initials,
'job_title' => $application->user->job_title, 'department' => $application->user->department,
'email' => $application->user->email, 'avatar_url' => $application->user->avatarUrl(96),
] : null,
];
}
}