Neues Modul: Qualitätsmanagement
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m46s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m51s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m2s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m55s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 4m15s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 4m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m46s
CI / Build-Artefakte aktuell (pull_request) Successful in 52s

- Kategorien mit farbigen Ordnerkacheln; Farbe und Symbol je Ordner
  (Auswahl oder eigener Upload, SVG bereinigt), an Unterordner vererbt
- Ordnerseite: Einführungstext, Ansprechpartner (Profilfelder wählbar),
  Unterordner, Liste mit Dokument, Version, Stand, Größe, Aktion
- Einträge: Datei (Lesefassung + bearbeitbare Vorlage), Link,
  Online-Formular; neue Fassungen archivieren die bisherigen
- PDF-Betrachter im Portal (pdf.js)
- Eigene Volltextsuche (PDF, Word, Excel, PowerPoint, OpenDocument)
  mit Textausschnitt; optionale Texterkennung per Tesseract
- Rollen-Ausschluss für das ganze Modul, Pflegerecht qm.manage,
  Zielgruppen je Kategorie
- Vorbereitet: Wiedervorlage, Verantwortliche, Lesebestätigungen
- Abhängigkeit smalot/pdfparser

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 15:50:23 +00:00
parent f78cc96be7
commit b3a057e27c
218 changed files with 13478 additions and 358 deletions

View file

@ -0,0 +1,111 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('qm_categories', function (Blueprint $table) {
$table->id();
$table->string('name', 120);
$table->unsignedInteger('sort')->default(0);
$table->timestamps();
});
Schema::create('qm_folders', function (Blueprint $table) {
$table->id();
$table->foreignId('category_id')->nullable()->constrained('qm_categories')->nullOnDelete();
$table->foreignId('parent_id')->nullable()->constrained('qm_folders')->restrictOnDelete();
$table->string('name', 120);
$table->string('color', 20)->nullable(); // null = vom übergeordneten Ordner erben
$table->string('icon', 60)->nullable(); // Symbol aus der Auswahl (wie im Menü)
$table->string('icon_path')->nullable(); // oder eigenes, hochgeladenes Symbol
$table->boolean('icon_mono')->default(true); // eigenes Symbol einfarbig darstellen
$table->text('intro')->nullable();
$table->unsignedInteger('sort')->default(0);
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->index(['parent_id', 'sort']);
});
Schema::create('qm_folder_contacts', function (Blueprint $table) {
$table->foreignId('folder_id')->constrained('qm_folders')->cascadeOnDelete();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->unsignedInteger('sort')->default(0);
$table->primary(['folder_id', 'user_id']);
});
Schema::create('qm_entries', function (Blueprint $table) {
$table->id();
$table->foreignId('folder_id')->constrained('qm_folders')->restrictOnDelete();
$table->string('type', 10); // file | link | form
$table->string('title');
$table->string('description', 1000)->nullable();
$table->string('version', 30)->nullable();
$table->date('valid_from')->nullable(); // „Stand“
$table->string('url', 1000)->nullable();
$table->unsignedBigInteger('form_id')->nullable();
$table->unsignedInteger('sort')->default(0);
// Vorgesehen für später: Wiedervorlage, Verantwortliche, Lesebestätigung
$table->date('review_due_at')->nullable();
$table->foreignId('responsible_id')->nullable()->constrained('users')->nullOnDelete();
$table->boolean('requires_acknowledgement')->default(false);
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->index(['folder_id', 'sort']);
});
Schema::create('qm_files', function (Blueprint $table) {
$table->id();
$table->foreignId('entry_id')->constrained('qm_entries')->cascadeOnDelete();
$table->string('kind', 10); // reading = Lesefassung, editable = bearbeitbare Vorlage
$table->string('version', 30)->nullable();
$table->date('valid_from')->nullable();
$table->string('name');
$table->string('path');
$table->string('mime', 150)->nullable();
$table->unsignedBigInteger('size')->default(0);
$table->longText('text')->nullable();
$table->string('text_status', 20)->default('pending'); // pending | ok | empty | needs_ocr | ocr | failed | unsupported
$table->timestamp('archived_at')->nullable();
$table->foreignId('uploaded_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('created_at')->nullable();
$table->index(['entry_id', 'archived_at']);
$table->index('text_status');
});
// Volltextindex für die Suche im Inhalt (MySQL und MariaDB, InnoDB)
if (in_array(DB::getDriverName(), ['mysql', 'mariadb'], true)) {
DB::statement('ALTER TABLE qm_files ADD FULLTEXT qm_files_text_fulltext (text)');
}
// Vorgesehen für später: Lesebestätigungen
Schema::create('qm_acknowledgements', function (Blueprint $table) {
$table->foreignId('entry_id')->constrained('qm_entries')->cascadeOnDelete();
$table->foreignId('file_id')->nullable()->constrained('qm_files')->nullOnDelete();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->timestamp('acknowledged_at');
$table->primary(['entry_id', 'user_id']);
});
}
public function down(): void
{
Schema::dropIfExists('qm_acknowledgements');
Schema::dropIfExists('qm_files');
Schema::dropIfExists('qm_entries');
Schema::dropIfExists('qm_folder_contacts');
Schema::dropIfExists('qm_folders');
Schema::dropIfExists('qm_categories');
}
};