Sort of working beta

This commit is contained in:
2025-02-06 17:30:45 +01:00
parent 5f42c707eb
commit 2ef114e154
97 changed files with 3093 additions and 106 deletions

View File

@ -0,0 +1,40 @@
<?php
namespace App\Notification;
use App\Models\Job;
use App\Notification\Stringifiable\StringifiableSimpleText;
abstract class Notification {
protected Job $job;
private NotificationBody $body;
public bool $isError;
public function __construct(int $jobId, NotificationBody $body, bool $isError = false) {
$this->job = Job::find($jobId);
$this->body = $body;
$this->isError = $isError;
}
public function getTitle(): Stringifiable {
return new StringifiableSimpleText($this->job->name);
}
public function getBody(): Stringifiable {
return $this->body;
}
abstract public function getLinkURL(): ?string;
public function getImageURL(): ?string {
$imageProjectPath = $this->getImageProjectPath();
if ($imageProjectPath === null) {
return null;
}
return url($imageProjectPath);
}
abstract public function getImageProjectPath(): ?string;
}