featur add fahrmeister

This commit is contained in:
Matthias Hochmeister
2026-02-27 21:46:50 +01:00
parent da4a56ba6b
commit dbe4f52871
17 changed files with 426 additions and 152 deletions

View File

@@ -14,6 +14,7 @@ export interface User {
created_at: Date;
updated_at: Date;
preferences?: any; // JSONB
authentik_groups: string[];
}
export interface CreateUserData {
@@ -24,6 +25,7 @@ export interface CreateUserData {
given_name?: string;
family_name?: string;
profile_picture_url?: string;
authentik_groups?: string[];
}
export interface UpdateUserData {

View File

@@ -83,21 +83,25 @@ export type WartungslogArt =
/** Raw database row from the `fahrzeuge` table */
export interface Fahrzeug {
id: string; // UUID
bezeichnung: string; // e.g. "LF 20/16"
kurzname: string | null;
amtliches_kennzeichen: string | null;
fahrgestellnummer: string | null;
baujahr: number | null;
hersteller: string | null;
typ_schluessel: string | null;
besatzung_soll: string | null; // e.g. "1/8"
status: FahrzeugStatus;
status_bemerkung: string | null;
standort: string;
bild_url: string | null;
created_at: Date;
updated_at: Date;
id: string; // UUID
bezeichnung: string; // e.g. "LF 20/16"
kurzname: string | null;
amtliches_kennzeichen: string | null;
fahrgestellnummer: string | null;
baujahr: number | null;
hersteller: string | null;
typ_schluessel: string | null;
besatzung_soll: string | null; // e.g. "1/8"
status: FahrzeugStatus;
status_bemerkung: string | null;
standort: string;
bild_url: string | null;
/** §57a StVO periodic inspection due date (Austrian equivalent of HU/TÜV) */
paragraph57a_faellig_am: Date | null;
/** Next scheduled service / maintenance due date */
naechste_wartung_am: Date | null;
created_at: Date;
updated_at: Date;
}
/** Raw database row from `fahrzeug_pruefungen` */
@@ -153,6 +157,10 @@ export interface FahrzeugWithPruefstatus extends Fahrzeug {
uvv: PruefungStatus;
leiter: PruefungStatus;
};
/** Days until §57a inspection (negative = overdue) */
paragraph57a_tage_bis_faelligkeit: number | null;
/** Days until next service (negative = overdue) */
wartung_tage_bis_faelligkeit: number | null;
/** Minimum tage_bis_faelligkeit across all inspections (negative = any overdue) */
naechste_pruefung_tage: number | null;
/** Full inspection history, ordered by faellig_am DESC */
@@ -168,25 +176,32 @@ export interface FahrzeugWithPruefstatus extends Fahrzeug {
* Includes only the fields needed to render a card plus inspection badges.
*/
export interface FahrzeugListItem {
id: string;
bezeichnung: string;
kurzname: string | null;
amtliches_kennzeichen: string | null;
baujahr: number | null;
hersteller: string | null;
besatzung_soll: string | null;
status: FahrzeugStatus;
status_bemerkung: string | null;
bild_url: string | null;
hu_faellig_am: Date | null;
hu_tage_bis_faelligkeit: number | null;
au_faellig_am: Date | null;
au_tage_bis_faelligkeit: number | null;
uvv_faellig_am: Date | null;
uvv_tage_bis_faelligkeit: number | null;
leiter_faellig_am: Date | null;
id: string;
bezeichnung: string;
kurzname: string | null;
amtliches_kennzeichen: string | null;
baujahr: number | null;
hersteller: string | null;
besatzung_soll: string | null;
status: FahrzeugStatus;
status_bemerkung: string | null;
bild_url: string | null;
/** §57a due date (primary inspection badge) */
paragraph57a_faellig_am: Date | null;
paragraph57a_tage_bis_faelligkeit: number | null;
/** Next service due date */
naechste_wartung_am: Date | null;
wartung_tage_bis_faelligkeit: number | null;
// Legacy pruefungen kept for backwards compat
hu_faellig_am: Date | null;
hu_tage_bis_faelligkeit: number | null;
au_faellig_am: Date | null;
au_tage_bis_faelligkeit: number | null;
uvv_faellig_am: Date | null;
uvv_tage_bis_faelligkeit: number | null;
leiter_faellig_am: Date | null;
leiter_tage_bis_faelligkeit: number | null;
naechste_pruefung_tage: number | null;
naechste_pruefung_tage: number | null;
}
// ── Dashboard KPI ─────────────────────────────────────────────────────────────
@@ -229,21 +244,25 @@ export interface CreateFahrzeugData {
status_bemerkung?: string;
standort?: string;
bild_url?: string;
paragraph57a_faellig_am?: string; // ISO date 'YYYY-MM-DD'
naechste_wartung_am?: string; // ISO date 'YYYY-MM-DD'
}
export interface UpdateFahrzeugData {
bezeichnung?: string;
kurzname?: string | null;
amtliches_kennzeichen?: string | null;
fahrgestellnummer?: string | null;
baujahr?: number | null;
hersteller?: string | null;
typ_schluessel?: string | null;
besatzung_soll?: string | null;
status?: FahrzeugStatus;
status_bemerkung?: string | null;
standort?: string;
bild_url?: string | null;
bezeichnung?: string;
kurzname?: string | null;
amtliches_kennzeichen?: string | null;
fahrgestellnummer?: string | null;
baujahr?: number | null;
hersteller?: string | null;
typ_schluessel?: string | null;
besatzung_soll?: string | null;
status?: FahrzeugStatus;
status_bemerkung?: string | null;
standort?: string;
bild_url?: string | null;
paragraph57a_faellig_am?: string | null; // ISO date 'YYYY-MM-DD'
naechste_wartung_am?: string | null; // ISO date 'YYYY-MM-DD'
}
export interface CreatePruefungData {