Projektseite, Aufgaben-Kategorien und Terminplan wie MS Project (0.3.0)
- Projekt-Detailseite mit Kacheln und Reitern, Baustellenadresse und Notiz (Migration 005) - Aufgaben mit Projekt, Kunde und Kategorie; Kategorien im Auswahlmenü bearbeiten - Terminplan: Bearbeitung direkt in der Tabelle, Spalten ausblendbar Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
@@ -200,7 +200,9 @@ export async function baueApp(o: Optionen): Promise<FastifyInstance> {
|
||||
const woche = { tage: e.arbeitstage };
|
||||
const [tp, aufgaben, liqui] = await Promise.all([
|
||||
terminplan(pool, woche),
|
||||
pool.query(`select a.*, p.nummer as projekt_nummer from aufgabe a left join projekt p on p.id = a.projekt_id
|
||||
pool.query(`select a.*, p.nummer as projekt_nummer, p.bezeichnung as projekt_name, k.name as kontakt_name, g.name as kategorie
|
||||
from aufgabe a left join projekt p on p.id = a.projekt_id left join kontakt k on k.id = a.kontakt_id
|
||||
left join aufgabe_kategorie g on g.id = a.kategorie_id
|
||||
where a.erledigt_am is null order by a.faellig_am nulls last, a.angelegt_am`),
|
||||
berechneLiquiditaet({ ansicht: "woche", start: heute, anzahl: 4 }),
|
||||
]);
|
||||
|
||||
20
src/server/migrations/005_projektseite_kategorien.sql
Normal file
20
src/server/migrations/005_projektseite_kategorien.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- G4: Aufgaben-Kategorien, frei bearbeitbar (Henning, 20.10.2026)
|
||||
create table aufgabe_kategorie (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
name text not null unique check (trim(name) <> ''),
|
||||
reihenfolge integer not null default 0,
|
||||
angelegt_am timestamptz not null default now(),
|
||||
geaendert_am timestamptz not null default now(),
|
||||
geaendert_von text not null default 'system'
|
||||
);
|
||||
create trigger aufgabe_kategorie_protokoll before insert or update or delete on aufgabe_kategorie
|
||||
for each row execute function stempel_und_protokoll();
|
||||
|
||||
alter table aufgabe add column kategorie_id uuid references aufgabe_kategorie (id) on delete set null;
|
||||
|
||||
-- P2: Baustellenadresse und Notiz für die Projektseite
|
||||
alter table projekt
|
||||
add column baustelle_strasse text,
|
||||
add column baustelle_plz text,
|
||||
add column baustelle_ort text,
|
||||
add column notiz text;
|
||||
@@ -50,6 +50,10 @@ export const TABELLEN: Tabelle[] = [
|
||||
personen: z.number().positive().nullable().optional(),
|
||||
soll_stunden: z.number().min(0).nullable().optional(),
|
||||
soll_tage: z.number().min(0).nullable().optional(),
|
||||
baustelle_strasse: optText,
|
||||
baustelle_plz: optText,
|
||||
baustelle_ort: optText,
|
||||
notiz: optText,
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -153,6 +157,15 @@ export const TABELLEN: Tabelle[] = [
|
||||
ende: datum.nullable().optional(),
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "aufgabe_kategorie",
|
||||
pfad: "aufgaben-kategorien",
|
||||
sortierung: "reihenfolge, name",
|
||||
schema: z.object({
|
||||
name: text,
|
||||
reihenfolge: z.number().int().optional(),
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "aufgabe",
|
||||
pfad: "aufgaben",
|
||||
@@ -163,6 +176,7 @@ export const TABELLEN: Tabelle[] = [
|
||||
langfristig: z.boolean().optional(),
|
||||
projekt_id: id.nullable().optional(),
|
||||
kontakt_id: id.nullable().optional(),
|
||||
kategorie_id: id.nullable().optional(),
|
||||
erledigt_am: z.iso.datetime({ offset: true }).nullable().optional(),
|
||||
}),
|
||||
},
|
||||
|
||||
@@ -14,7 +14,8 @@ interface Eingabe {
|
||||
heute: Datum;
|
||||
woche: Arbeitswoche;
|
||||
tp: Awaited<ReturnType<typeof terminplan>>;
|
||||
aufgaben: { id: string; text: string; faellig_am: Datum | null; langfristig: boolean; erledigt_am: string | null; projekt_nummer: string | null }[];
|
||||
aufgaben: { id: string; text: string; faellig_am: Datum | null; langfristig: boolean; erledigt_am: string | null; projekt_nummer: string | null;
|
||||
projekt_name: string | null; kontakt_name: string | null; kategorie: string | null }[];
|
||||
liqui: { von: Datum; saldo: number; kontostand: number; einnahmen: number; ausgaben: number }[];
|
||||
mindestreserve: number;
|
||||
/** false, solange Henning den aktuellen Kontostand nicht eingetragen hat */
|
||||
|
||||
Reference in New Issue
Block a user