feat(validation): add editing versioning revalidation and aligned reports

This commit is contained in:
Schubert Ferenc 2026-07-11 10:26:18 +02:00
parent f73a24df13
commit 302e542fda
28 changed files with 2691 additions and 406 deletions

View file

@ -1,26 +1,25 @@
"use client";
import { useQuery } from "@tanstack/react-query";
import { Building2, Gauge, MapPin, Stethoscope, UserRound } from "lucide-react";
import { AlertTriangle, CheckCircle2, ClipboardList, Clock, FilePenLine } from "lucide-react";
import Link from "next/link";
import { useAuth } from "@/components/auth";
import { apiGet } from "@/lib/api";
type DashboardData = {
customers: number;
locations: number;
contacts: number;
devices: number;
equipment: number;
validations: number;
validation_drafts: number;
validation_ready: number;
validation_in_review: number;
validation_approved: number;
validation_overdue: number;
};
const cards = [
{ label: "Kunden", key: "customers", href: "/customers", icon: Building2 },
{ label: "Standorte", key: "locations", href: "/locations", icon: MapPin },
{ label: "Ansprechpartner", key: "contacts", href: "/contacts", icon: UserRound },
{ label: "Geraete", key: "devices", href: "/devices", icon: Stethoscope },
{ label: "Pruefmittel", key: "equipment", href: "/equipment", icon: Gauge }
{ label: "Entwuerfe", key: "validation_drafts", href: "/validations?status=ENTWURF", icon: FilePenLine },
{ label: "Bereit zur Pruefung", key: "validation_ready", href: "/validations?status=BEREIT_ZUR_PRUEFUNG", icon: ClipboardList },
{ label: "In Pruefung", key: "validation_in_review", href: "/validations?status=IN_PRUEFUNG", icon: Clock },
{ label: "Freigegeben", key: "validation_approved", href: "/validations?status=FREIGEGEBEN", icon: CheckCircle2 },
{ label: "Ueberfaellige Revalidierungen", key: "validation_overdue", href: "/validations?overdue_only=true", icon: AlertTriangle }
] as const;
export default function DashboardPage() {
@ -35,7 +34,7 @@ export default function DashboardPage() {
<div className="space-y-8">
<header>
<h1 className="text-3xl font-semibold text-text">Dashboard</h1>
<p className="mt-2 text-text-light">Aktuelle Stammdaten aus PostgreSQL.</p>
<p className="mt-2 text-text-light">Validierungsworkflow und faellige Revalidierungen.</p>
</header>
<section className="grid gap-4 sm:grid-cols-2 xl:grid-cols-5">
{cards.map((item) => {
@ -52,8 +51,8 @@ export default function DashboardPage() {
})}
</section>
<section className="rounded-lg border border-border bg-surface p-6 shadow-soft">
<h2 className="text-xl font-semibold">Stammdaten</h2>
<p className="mt-2 text-sm leading-6 text-text-light">Kunden, Standorte, Ansprechpartner, Geraete und Pruefmittel koennen produktiv angelegt, bearbeitet, gesucht und geloescht werden.</p>
<h2 className="text-xl font-semibold">Zuletzt bearbeitete Validierungen</h2>
<p className="mt-2 text-sm leading-6 text-text-light">Die Validierungsverwaltung bietet Suche, Filter, Sortierung, Vorschau, Export und Workflow-Aktionen.</p>
</section>
</div>
);