Files
online-energieausweis/surreal/VerbrauchsausweisWohnen.sql
Moritz Utcke 92817b6b8e Schema
2025-04-21 15:05:48 -03:00

68 lines
4.8 KiB
SQL

DEFINE TABLE VerbrauchsausweisWohnen SCHEMAFULL;
DEFINE FIELD ausstellgrund ON VerbrauchsausweisWohnen TYPE "Neubau" | "Vermietung" | "Verkauf" | "Modernisierung" | "Sonstiges" DEFAULT "Sonstiges";
DEFINE FIELD registriernummer ON VerbrauchsausweisWohnen TYPE option<string>;
DEFINE FIELD zusaetzliche_heizquelle ON VerbrauchsausweisWohnen TYPE option<bool>;
DEFINE FIELD einheit_1 ON VerbrauchsausweisWohnen TYPE option<string>;
DEFINE FIELD einheit_2 ON VerbrauchsausweisWohnen TYPE option<string>;
DEFINE FIELD brennstoff_1 ON VerbrauchsausweisWohnen TYPE option<string>;
DEFINE FIELD brennstoff_2 ON VerbrauchsausweisWohnen TYPE option<string>;
DEFINE FIELD energieeffizienzklasse ON VerbrauchsausweisWohnen TYPE option<string>;
DEFINE FIELD ausstellungsdatum ON VerbrauchsausweisWohnen TYPE datetime;
DEFINE FIELD boxpruefung ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD startdatum ON VerbrauchsausweisWohnen TYPE datetime;
DEFINE FIELD verbrauch_1 ON VerbrauchsausweisWohnen TYPE option<int>;
DEFINE FIELD verbrauch_2 ON VerbrauchsausweisWohnen TYPE option<int>;
DEFINE FIELD verbrauch_3 ON VerbrauchsausweisWohnen TYPE option<int>;
DEFINE FIELD verbrauch_4 ON VerbrauchsausweisWohnen TYPE option<int>;
DEFINE FIELD verbrauch_5 ON VerbrauchsausweisWohnen TYPE option<int>;
DEFINE FIELD verbrauch_6 ON VerbrauchsausweisWohnen TYPE option<int>;
DEFINE FIELD warmwasser_enthalten ON VerbrauchsausweisWohnen TYPE option<bool>;
DEFINE FIELD warmwasser_anteil_bekannt ON VerbrauchsausweisWohnen TYPE option<bool>;
DEFINE FIELD faktorKeller ON VerbrauchsausweisWohnen TYPE option<float>;
DEFINE FIELD alternative_heizung ON VerbrauchsausweisWohnen TYPE option<bool>;
DEFINE FIELD alternative_warmwasser ON VerbrauchsausweisWohnen TYPE option<bool>;
DEFINE FIELD alternative_lueftung ON VerbrauchsausweisWohnen TYPE option<bool>;
DEFINE FIELD alternative_kuehlung ON VerbrauchsausweisWohnen TYPE option<bool>;
DEFINE FIELD anteil_warmwasser_1 ON VerbrauchsausweisWohnen TYPE option<float>;
DEFINE FIELD anteil_warmwasser_2 ON VerbrauchsausweisWohnen TYPE option<float>;
DEFINE FIELD ausgestellt ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD storniert ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD bestellt ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD zurueckgestellt ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD prueftext ON VerbrauchsausweisWohnen TYPE option<string>;
DEFINE FIELD beschreibung ON VerbrauchsausweisWohnen TYPE option<string>;
DEFINE FIELD kontrolldatei_angefragt ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD ausweistyp ON VerbrauchsausweisWohnen TYPE "Standard" | "StandardXL" | "Beratung" | "BeratungXL" | "Offline" | "OfflineXL" DEFAULT "Standard";
DEFINE FIELD ausweisart ON VerbrauchsausweisWohnen TYPE "VerbrauchsausweisWohnen" | "VerbrauchsausweisGewerbe" | "BedarfsausweisWohnen" | "BedarfsausweisGewerbe" | "GEGNachweisWohnen" | "GEGNachweisGewerbe" DEFAULT "VerbrauchsausweisWohnen";
DEFINE FIELD created_at ON VerbrauchsausweisWohnen TYPE datetime DEFAULT time::now();
DEFINE FIELD updated_at ON VerbrauchsausweisWohnen TYPE datetime VALUE time::now();
-- Prüfpunkte
DEFINE FIELD pruefpunkt_heizungsalter ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_verbrauch_niedrig ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_verbrauch_hoch ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_verbrauch_null ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_verbrauch_abweichung ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_wohnflaeche_einheiten ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_strom_null ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_strom_abweichung ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_plz ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_heizungsanlage ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_anteil_warmwasser ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_wohnflaeche ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_geometrie ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD pruefpunkt_fenster ON VerbrauchsausweisWohnen TYPE option<bool> DEFAULT false;
DEFINE FIELD benutzer ON VerbrauchsausweisWohnen TYPE option<record<Benutzer>>;
DEFINE FIELD rechnung ON VerbrauchsausweisWohnen TYPE option<record<Rechnung>>;
DEFINE FIELD aufnahme ON VerbrauchsausweisWohnen TYPE record<Aufnahme>;