diff --git a/bun.lock b/bun.lock index 0daeee61..940d99d4 100644 --- a/bun.lock +++ b/bun.lock @@ -38,6 +38,7 @@ "postcss-nested": "^7.0.2", "radix-svelte-icons": "^1.0.0", "sass": "^1.83.4", + "siema": "^1.5.1", "svelte": "^3.59.2", "svelte-dialogs": "^1.2.2", "svelte-preprocess": "^5.1.4", @@ -59,6 +60,7 @@ "@types/jsonwebtoken": "^9.0.7", "@types/mime-types": "^2.1.4", "@types/nodemailer": "^6.4.17", + "@types/siema": "^1.4.11", "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", @@ -67,7 +69,6 @@ "cypress": "^13.17.0", "cypress-file-upload": "^5.0.8", "cypress-vite": "^1.6.0", - "daisyui": "^4.12.23", "eslint": "~8.15.0", "eslint-config-prettier": "8.1.0", "postcss": "^8.5.1", @@ -566,6 +567,8 @@ "@types/serve-static": ["@types/serve-static@1.15.7", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*", "@types/send": "*" } }, "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw=="], + "@types/siema": ["@types/siema@1.4.11", "", {}, "sha512-bPazsNVnMryrzZx2HiAeDXEpgaO98ToQk0cYJ/7yomLlVNHsn4IYPrLoQ50tQt11FGvkkNoepRyKcTNUhqjj+g=="], + "@types/sinonjs__fake-timers": ["@types/sinonjs__fake-timers@8.1.1", "", {}, "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g=="], "@types/sizzle": ["@types/sizzle@2.3.9", "", {}, "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w=="], @@ -848,8 +851,6 @@ "css-animation": ["css-animation@1.6.1", "", { "dependencies": { "babel-runtime": "6.x", "component-classes": "^1.2.5" } }, "sha512-/48+/BaEaHRY6kNQ2OIPzKf9A6g8WjZYjhiNDNuIVbsm5tXCGIAsHDjB4Xu1C4vXJtUWZo26O68OQkDpNBaPog=="], - "css-selector-tokenizer": ["css-selector-tokenizer@0.8.0", "", { "dependencies": { "cssesc": "^3.0.0", "fastparse": "^1.1.2" } }, "sha512-Jd6Ig3/pe62/qe5SBPTN8h8LeUg/pT4lLgtavPf7updwwHpvFzxvOQBHYj2LZDMjUnBzgvIUSjRcf6oT5HzHFg=="], - "css-styled": ["css-styled@1.0.8", "", { "dependencies": { "@daybrush/utils": "^1.13.0" } }, "sha512-tCpP7kLRI8dI95rCh3Syl7I+v7PP+2JYOzWkl0bUEoSbJM+u8ITbutjlQVf0NC2/g4ULROJPi16sfwDIO8/84g=="], "css-to-mat": ["css-to-mat@1.1.1", "", { "dependencies": { "@daybrush/utils": "^1.13.0", "@scena/matrix": "^1.0.0" } }, "sha512-kvpxFYZb27jRd2vium35G7q5XZ2WJ9rWjDUMNT36M3Hc41qCrLXFM5iEKMGXcrPsKfXEN+8l/riB4QzwwwiEyQ=="], @@ -860,8 +861,6 @@ "csvtojson": ["csvtojson@2.0.10", "", { "dependencies": { "bluebird": "^3.5.1", "lodash": "^4.17.3", "strip-bom": "^2.0.0" }, "bin": { "csvtojson": "./bin/csvtojson" } }, "sha512-lUWFxGKyhraKCW8Qghz6Z0f2l/PqB1W3AO0HKJzGIQ5JRSlR651ekJDiGJbBT4sRNNv5ddnSGVEnsxP9XRCVpQ=="], - "culori": ["culori@3.3.0", "", {}, "sha512-pHJg+jbuFsCjz9iclQBqyL3B2HLCBF71BwVNujUYEvCeQMvV97R59MNK3R2+jgJ3a1fcZgI9B3vYgz8lzr/BFQ=="], - "cypress": ["cypress@13.17.0", "", { "dependencies": { "@cypress/request": "^3.0.6", "@cypress/xvfb": "^1.2.4", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", "blob-util": "^2.0.2", "bluebird": "^3.7.2", "buffer": "^5.7.1", "cachedir": "^2.3.0", "chalk": "^4.1.0", "check-more-types": "^2.24.0", "ci-info": "^4.0.0", "cli-cursor": "^3.1.0", "cli-table3": "~0.6.1", "commander": "^6.2.1", "common-tags": "^1.8.0", "dayjs": "^1.10.4", "debug": "^4.3.4", "enquirer": "^2.3.6", "eventemitter2": "6.4.7", "execa": "4.1.0", "executable": "^4.1.1", "extract-zip": "2.0.1", "figures": "^3.2.0", "fs-extra": "^9.1.0", "getos": "^3.2.1", "is-installed-globally": "~0.4.0", "lazy-ass": "^1.6.0", "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", "minimist": "^1.2.8", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "process": "^0.11.10", "proxy-from-env": "1.0.0", "request-progress": "^3.0.0", "semver": "^7.5.3", "supports-color": "^8.1.1", "tmp": "~0.2.3", "tree-kill": "1.2.2", "untildify": "^4.0.0", "yauzl": "^2.10.0" }, "bin": { "cypress": "bin/cypress" } }, "sha512-5xWkaPurwkIljojFidhw8lFScyxhtiFHl/i/3zov+1Z5CmY4t9tjIdvSXfu82Y3w7wt0uR9KkucbhkVvJZLQSA=="], "cypress-file-upload": ["cypress-file-upload@5.0.8", "", { "peerDependencies": { "cypress": ">3.0.0" } }, "sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g=="], @@ -870,8 +869,6 @@ "d3-dsv": ["d3-dsv@2.0.0", "", { "dependencies": { "commander": "2", "iconv-lite": "0.4", "rw": "1" }, "bin": { "csv2json": "bin/dsv2json", "csv2tsv": "bin/dsv2dsv", "dsv2dsv": "bin/dsv2dsv", "dsv2json": "bin/dsv2json", "json2csv": "bin/json2dsv", "json2dsv": "bin/json2dsv", "json2tsv": "bin/json2dsv", "tsv2csv": "bin/dsv2dsv", "tsv2json": "bin/dsv2json" } }, "sha512-E+Pn8UJYx9mViuIUkoc93gJGGYut6mSDKy2+XaPwccwkRGlR+LO97L2VCCRjQivTwLHkSnAJG7yo00BWY6QM+w=="], - "daisyui": ["daisyui@4.12.23", "", { "dependencies": { "css-selector-tokenizer": "^0.8", "culori": "^3", "picocolors": "^1", "postcss-js": "^4" } }, "sha512-EM38duvxutJ5PD65lO/AFMpcw+9qEy6XAZrTpzp7WyaPeO/l+F/Qiq0ECHHmFNcFXh5aVoALY4MGrrxtCiaQCQ=="], - "dashdash": ["dashdash@1.14.1", "", { "dependencies": { "assert-plus": "^1.0.0" } }, "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g=="], "date-fns": ["date-fns@4.1.0", "", {}, "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg=="], @@ -1046,8 +1043,6 @@ "fast-xml-parser": ["fast-xml-parser@4.5.1", "", { "dependencies": { "strnum": "^1.0.5" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w=="], - "fastparse": ["fastparse@1.1.2", "", {}, "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ=="], - "fastq": ["fastq@1.19.0", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA=="], "fd-slicer": ["fd-slicer@1.1.0", "", { "dependencies": { "pend": "~1.2.0" } }, "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g=="], @@ -1968,6 +1963,8 @@ "side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="], + "siema": ["siema@1.5.1", "", {}, "sha512-BUNFdTSbC9/2gA6r6teBY9B8O/XZOUz8kVyttpsbq4gbHF9PidUDzs6aPtiObhV4KoEuPQdhRvK5hPPi9lgSTg=="], + "signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], "simple-concat": ["simple-concat@1.0.1", "", {}, "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="], diff --git a/package.json b/package.json index e8e4098b..97e73ccf 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "postcss-nested": "^7.0.2", "radix-svelte-icons": "^1.0.0", "sass": "^1.83.4", + "siema": "^1.5.1", "svelte": "^3.59.2", "svelte-dialogs": "^1.2.2", "svelte-preprocess": "^5.1.4", @@ -73,6 +74,7 @@ "@types/jsonwebtoken": "^9.0.7", "@types/mime-types": "^2.1.4", "@types/nodemailer": "^6.4.17", + "@types/siema": "^1.4.11", "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", @@ -81,7 +83,6 @@ "cypress": "^13.17.0", "cypress-file-upload": "^5.0.8", "cypress-vite": "^1.6.0", - "daisyui": "^4.12.23", "eslint": "~8.15.0", "eslint-config-prettier": "8.1.0", "postcss": "^8.5.1", diff --git a/src/astro-typesafe-api-caller.ts b/src/astro-typesafe-api-caller.ts index a49d72c7..b42731cb 100644 --- a/src/astro-typesafe-api-caller.ts +++ b/src/astro-typesafe-api-caller.ts @@ -4,13 +4,13 @@ export const createCaller = createCallerFactory({ "klimafaktoren": await import("../src/pages/api/klimafaktoren.ts"), "postleitzahlen": await import("../src/pages/api/postleitzahlen.ts"), "admin/ausstellen": await import("../src/pages/api/admin/ausstellen.ts"), - "aufnahme/[uid]": await import("../src/pages/api/aufnahme/[uid].ts"), - "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), + "bedarfsausweis-wohnen/[uid]": await import("../src/pages/api/bedarfsausweis-wohnen/[uid].ts"), + "bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"), "auth/access-token": await import("../src/pages/api/auth/access-token.ts"), "auth/forgot-password": await import("../src/pages/api/auth/forgot-password.ts"), "auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"), - "bedarfsausweis-wohnen/[uid]": await import("../src/pages/api/bedarfsausweis-wohnen/[uid].ts"), - "bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"), + "aufnahme/[uid]": await import("../src/pages/api/aufnahme/[uid].ts"), + "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), "bilder/[uid]": await import("../src/pages/api/bilder/[uid].ts"), "geg-nachweis-verbrauchsausweis-wohnen/[uid]": await import("../src/pages/api/geg-nachweis-verbrauchsausweis-wohnen/[uid].ts"), "geg-nachweis-verbrauchsausweis-wohnen": await import("../src/pages/api/geg-nachweis-verbrauchsausweis-wohnen/index.ts"), @@ -19,8 +19,6 @@ export const createCaller = createCallerFactory({ "ticket": await import("../src/pages/api/ticket/index.ts"), "user": await import("../src/pages/api/user/index.ts"), "user/self": await import("../src/pages/api/user/self.ts"), - "verbrauchsausweis-wohnen/[uid]": await import("../src/pages/api/verbrauchsausweis-wohnen/[uid].ts"), - "verbrauchsausweis-wohnen": await import("../src/pages/api/verbrauchsausweis-wohnen/index.ts"), "verbrauchsausweis-gewerbe/[uid]": await import("../src/pages/api/verbrauchsausweis-gewerbe/[uid].ts"), "verbrauchsausweis-gewerbe": await import("../src/pages/api/verbrauchsausweis-gewerbe/index.ts"), "verbrauchsausweis-wohnen/[uid]": await import("../src/pages/api/verbrauchsausweis-wohnen/[uid].ts"), diff --git a/src/components/AnsichtsausweisButton.svelte b/src/components/AnsichtsausweisButton.svelte index bfa7b710..45a86271 100644 --- a/src/components/AnsichtsausweisButton.svelte +++ b/src/components/AnsichtsausweisButton.svelte @@ -2,31 +2,13 @@ import { Buffer } from "buffer"; import { AufnahmeClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisWohnenClient } from "./Ausweis/types.js"; import { Enums } from "@ibcornelsen/database/client"; + import { openWindowWithPost } from "#lib/helpers/window.js"; export let ausweis: VerbrauchsausweisWohnenClient; export let objekt: ObjektClient; export let aufnahme: AufnahmeClient; export let bilder: UploadedGebaeudeBild[]; export let ausweisart: Enums.Ausweisart - - function openWindowWithPost(url: string, data: Record) { - var form = document.createElement("form"); - form.target = "_blank"; - form.method = "POST"; - form.action = url; - form.style.display = "none"; - - for (var key in data) { - var input = document.createElement("input"); - input.type = "hidden"; - input.name = key; - input.value = data[key]; - form.appendChild(input); - } - document.body.appendChild(form); - form.submit(); - document.body.removeChild(form); -} + + {/if} + {#if dots} + + {/if} + + + \ No newline at end of file diff --git a/src/components/Dashboard/DashboardAusweis.svelte b/src/components/Dashboard/DashboardAusweis.svelte index 75f6f376..f172364e 100644 --- a/src/components/Dashboard/DashboardAusweis.svelte +++ b/src/components/Dashboard/DashboardAusweis.svelte @@ -1,10 +1,5 @@ -
- {#if aufnahme.storniert} -
-

Storniert

+
+ {#if ausweis.storniert} +
+

+ Storniert +

{/if} -
+ +
+
- {#if aufnahme.ausweisart == "VerbrauchsausweisWohnen"} -
- Verbrauchsausweis Wohnen -
- {:else if aufnahme.ausweisart == "BedarfsausweisWohnen"} -
- Bedarfsausweis Wohnen -
- {:else if aufnahme.ausweisart == "VerbrauchsausweisGewerbe"} -
- Verbrauchsausweis Gewerbe -
+ {#if ausweisart == Enums.Ausweisart.VerbrauchsausweisWohnen} +
+ Verbrauchsausweis Wohnen +
+ {:else if ausweisart == Enums.Ausweisart.BedarfsausweisWohnen} +
+ Bedarfsausweis Wohnen +
+ {:else if ausweisart == Enums.Ausweisart.VerbrauchsausweisGewerbe} +
+ Verbrauchsausweis Gewerbe +
{/if} - {#if aufnahme.erledigt} -
Ausgestellt
+ {#if ausweis.ausgestellt} +
Ausgestellt
{/if}

{objekt.adresse}

- + - {progress}% + {progress}%
- {#await endEnergieVerbrauchVerbrauchsausweis_2016(ausweis, aufnahme, objekt)} - - {:then calculations} -
-
- Energieverbrauch - {calculations?.endEnergieVerbrauchGesamt}kWh/A + {#await endEnergieVerbrauchVerbrauchsausweis_2016(ausweis, aufnahme, objekt) then calculations} +
+
+ Energieverbrauch + {calculations?.endEnergieVerbrauchGesamt}kWh/A +
+
+ CO2 Ausstoß + {calculations?.co2EmissionenGesamt}Kg/A +
+
+ Erstellungsdatum + {moment(aufnahme.erstellungsdatum).format( + "DD.MM.YYYY" + )} +
+
+ Baujahr + {aufnahme.baujahr_gebaeude[0] || "N/A"} / + {aufnahme.baujahr_heizung[0] || "N/A"} +
+
+ Wohnfläche + {aufnahme.flaeche + ? `${aufnahme.flaeche}m²` + : "N/A"} +
+
+ ID + {ausweis.uid.split("-")[0]} +
-
- CO2 Ausstoß - {calculations?.co2EmissionenGesamt}Kg/A -
-
- Erstellungsdatum - {moment(aufnahme.erstellungsdatum).format( - "DD.MM.YYYY" - )} -
-
- Baujahr - {aufnahme.baujahr_gebaeude[0] || "N/A"} / - {aufnahme.baujahr_heizung[0] || - "N/A"} -
-
- Wohnfläche - {aufnahme.flaeche - ? `${aufnahme.flaeche}m²` - : "N/A"} -
-
- ID - {ausweis.uid.split("-")[0]} -
-
{/await} diff --git a/src/components/Dashboard/DashboardObjekt.svelte b/src/components/Dashboard/DashboardObjekt.svelte new file mode 100644 index 00000000..73640640 --- /dev/null +++ b/src/components/Dashboard/DashboardObjekt.svelte @@ -0,0 +1,27 @@ + + +
+ {#if objektBild} + Gebäude + {/if} + +
+
+

{objekt.adresse}

+ {moment(objekt.erstellungsdatum).format("DD.MM.YYYY")} +
+ +
+ +
+
+
\ No newline at end of file diff --git a/src/components/Dashboard/DashboardSidebar.svelte b/src/components/Dashboard/DashboardSidebar.svelte index 0dbde8c6..88a84742 100644 --- a/src/components/Dashboard/DashboardSidebar.svelte +++ b/src/components/Dashboard/DashboardSidebar.svelte @@ -1,7 +1,7 @@ -
+
-
@@ -119,7 +119,7 @@
@@ -129,7 +129,7 @@
@@ -138,34 +138,15 @@ />
-
+
{benutzer.vorname} {benutzer.name} - {benutzer.email} + {benutzer.email}
- -