v1.14: Steuermodul - umlegbare und nicht umlegbare Kosten nach Haus und Wohnung

This commit is contained in:
2026-10-04 12:18:26 +02:00
parent 39eb247456
commit b57e9276f8
10 changed files with 606 additions and 4 deletions
+14
View File
@@ -139,6 +139,20 @@ CREATE TABLE IF NOT EXISTS buildings (
wohneinheiten INT NOT NULL, -- Anzahl Wohneinheiten (Soll)
quadratmeter NUMERIC(9,1) NOT NULL -- Gesamtwohnfläche in m²
);
CREATE TABLE IF NOT EXISTS costs (
id TEXT PRIMARY KEY,
building TEXT NOT NULL REFERENCES buildings(name), -- Haus
unit_id TEXT REFERENCES units(id), -- NULL = hausweite Position
jahr INT NOT NULL,
kostenart TEXT NOT NULL,
betrag NUMERIC(10,2) NOT NULL,
umlegbar BOOLEAN NOT NULL DEFAULT TRUE, -- umlegbar / nicht umlegbar
notiz TEXT NOT NULL DEFAULT '',
erfasst_am TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_costs_building ON costs(building);
CREATE INDEX IF NOT EXISTS idx_costs_unit ON costs(unit_id);
`
async function init() {