QM: Wiedervorlage und Lesebestätigung, Platzhalter für Profilbilder (0.21.0)
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m49s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m54s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m29s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m38s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m40s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m7s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m13s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m24s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-27 07:36:47 +00:00
parent 8701b6d1b8
commit 4d855c8a74
213 changed files with 1729 additions and 515 deletions

View file

@ -2,6 +2,7 @@
namespace Inhaus\Plugins\Qm\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@ -12,7 +13,8 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
* Ein Eintrag in einem QM-Ordner: Datei (mit Lesefassung und optional bearbeitbarer
* Vorlage), Link oder Online-Formular. „Stand“ = valid_from.
*/
#[Fillable(['folder_id', 'type', 'title', 'description', 'version', 'valid_from', 'url', 'form_id', 'sort', 'created_by', 'updated_by'])]
#[Fillable(['folder_id', 'type', 'title', 'description', 'version', 'valid_from', 'url', 'form_id', 'sort', 'created_by', 'updated_by',
'review_due_at', 'review_interval_months', 'responsible_id', 'requires_acknowledgement', 'reviewed_at', 'reviewed_by', 'review_notified_at'])]
class QmEntry extends Model
{
public const FILE = 'file';
@ -29,7 +31,7 @@ class QmEntry extends Model
protected function casts(): array
{
return ['valid_from' => 'date', 'review_due_at' => 'date', 'requires_acknowledgement' => 'boolean'];
return ['valid_from' => 'date', 'review_due_at' => 'date', 'requires_acknowledgement' => 'boolean', 'reviewed_at' => 'datetime', 'review_notified_at' => 'datetime', 'review_interval_months' => 'integer'];
}
/**
@ -40,6 +42,33 @@ class QmEntry extends Model
return $this->belongsTo(QmFolder::class);
}
/**
* @return BelongsTo<User, $this>
*/
public function responsible(): BelongsTo
{
return $this->belongsTo(User::class, 'responsible_id');
}
/**
* @return BelongsTo<User, $this>
*/
public function reviewer(): BelongsTo
{
return $this->belongsTo(User::class, 'reviewed_by');
}
/**
* Aktuelle Fassung, auf die sich eine Lesebestätigung bezieht (Lesefassung, sonst Vorlage).
*/
public function currentFileId(): ?int
{
$file = $this->relationLoaded('readingFile') ? $this->readingFile : $this->readingFile()->first();
$file ??= $this->relationLoaded('editableFile') ? $this->editableFile : $this->editableFile()->first();
return $file?->id;
}
/**
* @return HasMany<QmFile, $this>
*/