This commit is contained in:
Moritz Utcke
2025-04-29 11:15:57 -03:00
parent a8be6db8aa
commit 1380dcb43a
12 changed files with 276 additions and 376 deletions

View File

@@ -1,3 +0,0 @@
# Jeden Monat müssen wir die neuen Klimafaktoren vom DWD abholen, der Cronjob läuft immer am 28. für die höchste Wahrscheinlichkeit
# dass die Daten schon da sind, falls der DWD mal später dran ist...
0 12 28 * * bun ./src/cronjobs/update-dwd-klimafaktoren.ts

View File

@@ -1,39 +0,0 @@
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEAzUGXt3GYcT3344iWGGGcgL0zDKhkrieikZ+yqzDpLuEzRwu3epuT
mvmHpT45awHyWr6pgOPpD7MGSDo13BVRAjCapYC23RL87E3ZRaH6aezVtV+tjl6vcCRtQx
4uQWOtGzV8Mi84ErBxt3xKo19ieyVoJnJig9W7oLbf46I0/3Jz31SRQokfoDc7TFHrtVE2
1UZgxNuDfKMhMsBaZcPNP+Rbpcs7s8Bd3Q1PfrbA6bTGGa4DYAR5Hgm+z/FMcu1PSrAA4f
x+YxQrgNC4TNl8T3HSsGnnthNoQMCcl3LcAiy0C1JaWqXWGjYwawnfUdgB2nhb9i5t+yvb
T/UL1+obIhJRx9EaK4CScNraa0ZWmawl/NY6Dumvly8OpeUwMaynsZEFPEZVxdXFUHVRLR
74NGx23sq6qPYZuy5bFhbPJqIXsh2Pl6gvFE6HZcm5U6jgJOaHt98MSFIkILtWeab0cSmC
Aokt8XF+/ezu37mbEvNzCNZpFYG9d6MXuK5HOG0xAAAFqMTKAD/EygA/AAAAB3NzaC1yc2
EAAAGBAM1Bl7dxmHE99+OIlhhhnIC9MwyoZK4nopGfsqsw6S7hM0cLt3qbk5r5h6U+OWsB
8lq+qYDj6Q+zBkg6NdwVUQIwmqWAtt0S/OxN2UWh+mns1bVfrY5er3AkbUMeLkFjrRs1fD
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PcdKwaee2E2hAwJyXctwCLLQLUlpapdYaNjBrCd9R2AHaeFv2Lm37K9tP9QvX6hsiElHH0RorgJJw2tprRlaZrCX81joO6a+XLw6l5TAxrKexkQU8RlXF1cVQdVEtHvg0bHbeyrqo9hm7LlsWFs8moheyHY+XqC8UTodlyblTqOAk5oe33wxIUiQgu1Z5pvRxKYICiS3xcX797O7fuZsS83MI1mkVgb13oxe4rkc4bTE= moritz@moritz-ASUS-TUF-Gaming-A15-FA507NV-FA507NV

View File

@@ -1,4 +1,4 @@
.PHONY: dev online-energieausweis all prod backup run-database build-database install-dependencies wait-for-database prod database prisma-studio backup-database-cronjob .PHONY: dev online-energieausweis all prod backup run-database build-database install-dependencies wait-for-database prod database prisma-studio backup-database-cronjob update-dwd-klimafaktoren-cron
DB_CONTAINER_NAME := database DB_CONTAINER_NAME := database
DB_NAME := main DB_NAME := main
@@ -57,7 +57,10 @@ all:
mkdir -p ~/logs mkdir -p ~/logs
bun run dev 2>&1 | tee ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log bun run dev 2>&1 | tee ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log
prod: install-dependencies prisma-studio backup-database-cronjob update-dwd-klimafaktoren-cron:
pm2 start bun --name "update-dwd-klimafaktoren-cron" --cron "0 12 28 * *" -- src/cronjobs/update-dwd-klimafaktoren.ts
prod: install-dependencies prisma-studio backup-database-cronjob update-dwd-klimafaktoren-cron
bun run build bun run build
mkdir -p ~/logs mkdir -p ~/logs
mkdir -p ~/persistent/online-energieausweis mkdir -p ~/persistent/online-energieausweis

View File

@@ -0,0 +1,209 @@
---
export interface Props {
tab: number;
}
const { tab } = Astro.props;
const { params } = Astro;
const partner = params.partner;
const pathname = Astro.url.pathname;
const isVA = pathname.includes("verbrauchsausweis-wohngebaeude");
const isVAG = pathname.includes("verbrauchsausweis-gewerbe");
const isBA = pathname.includes("bedarfsausweis-wohngebaeude");
const isBAG = pathname.includes("bedarfsausweis-gewerbe-anfragen");
const isGGW = pathname.includes("geg-nachweis-wohnen-anfragen");
const isGGG = pathname.includes("geg-nachweis-gewerbe-anfragen");
const isWEA = pathname.includes("welcher-ausweis");
const isWelt = pathname.includes("immowelt");
const isNET = pathname.includes("immonet");
---
<header id="header" class="w-full bg-white h-[81px] sm:pl-8">
<div class="grid grid-cols-[min-content_1fr] items-center">
<div class="w-[150px] h-[80px]">
<div
class="w-full h-full grid grid-col-1 justify-items-center items-center"
>
<img
class={isNET
? "w-[149px]"
: isWelt
? "w-[109px]"
: "w-[109px]"}
src={`/images/partner/${partner}/${partner}.svg`}
alt={partner}
/>
</div>
</div>
<div>
<ul class="navlist">
<li>
<a
href={`/${partner}/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/`}
><button class={tab === 0 ? "glow" : ""}
>Verbrauchsausweis</button
></a>
</li>
<li>
<a
href={`/${partner}/energieausweis-erstellen/verbrauchsausweis-gewerbe/`}
><button class={tab === 1 ? "glow" : ""}
>Verbrauchsausweis Gewerbe</button
></a>
</li>
<li>
<a
href={`/${partner}/energieausweis-erstellen/bedarfsausweis-wohngebaeude/`}
><button class={tab === 2 ? "glow" : ""}
>Bedarfsausweis</button
></a>
</li>
<li>
<a
href={`/${partner}/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/`}
><button class={tab === 3 ? "glow" : ""}
>Bedarfsausweis Gewerbe</button
></a>
</li>
<li>
<a
href={`/${partner}/angebot-anfragen/geg-nachweis-wohnen-anfragen/`}
><button class={tab === 4 ? "glow" : ""}
>GEG Nachweis Wohngebäude</button
></a>
</li>
<li>
<a
href={`/${partner}/angebot-anfragen/geg-nachweis-gewerbe-anfragen/`}
><button class={tab === 5 ? "glow" : ""}
>GEG Nachweis Gewerbe</button
></a>
</li>
<li>
<a href={`/${partner}/welcher-ausweis/${partner}`}
><button class={tab === 6 ? "glow" : ""}
>Welcher Ausweis</button
></a>
</li>
</ul>
</div>
</div>
</header>
<div
id="titel"
class="block w-full 2xl:h-[270px] lg:h-[148px] bg-cover px-24 py-20"
style={`background-image: url('/images/partner/${partner}/hero-energieausweis.jpg');
background-repeat:no-repeat; background-position:right;`}
>
{
isVA ? (
<div>
Hier komfortabel und einfach online den{" "}
<b>Verbrauchsausweis Wohngebäude</b> bestellen
</div>
) : (
""
)
}
{
isVAG ? (
<div>
Hier komfortabel und einfach online den{" "}
<b>Verbrauchsausweis Gewerbe</b> bestellen
</div>
) : (
""
)
}
{
isBA ? (
<div>
Hier komfortabel und einfach online den{" "}
<b>Bedarfsausweis Wohngebäude</b> bestellen
</div>
) : (
""
)
}
{
isBAG ? (
<div>
Hier komfortabel und einfach online den{" "}
<b>Bedarfsausweis Gewerbe</b> anfragen
</div>
) : (
""
)
}
{
isGGW ? (
<div>
Hier komfortabel und einfach online den{" "}
<b>GEG Nachweis Wohngebäude</b> anfragen
</div>
) : (
""
)
}
{
isGGG ? (
<div>
Hier komfortabel und einfach online den{" "}
<b>GEG Nachweis Gewerbe</b> anfragen
</div>
) : (
""
)
}
{
isWEA ? (
<div>
Hier komfortabel und einfach online den richtigen Ausweis finden
</div>
) : (
""
)
}
</div>
<style lang="postcss">
@font-face {
font-family: "immo Sans";
src: url('/fonts/Immo-Sans/immoSans-Regular.eot');
src: url('/fonts/Immo-Sans/immoSans-Regular.eot?#iefix') format('embedded-opentype'),
url('/fonts/Immo-Sans/immoSans-Regular.woff2') format('woff2'),
url('/fonts/Immo-Sans/immoSans-Regular.woff') format('woff');
font-style: normal;
font-weight: 400;
}
#titel{
font-family: "immo Sans";
font-weight:400;
div{@apply w-fit bg-white/75 py-6 px-16 rounded-lg ring-2 ring-black/15 text-[1.45rem];box-shadow:8px 8px 16px rgba(0,0,0,0.5);}
}
.header-button {
@apply px-4 py-2 text-primary-content font-medium text-lg tracking-normal hover:bg-secondary h-full;
}
.navlist {
@apply flex flex-wrap flex-col sm:flex-row pl-[1.75rem] sm:pl-[1.75rem];
}
.navlist li {
@apply pr-0 sm:pr-[6px] pb-1 sm:pb-0;
}
.navlist li button{@apply text-[0.75rem] md:text-[1rem] text-[#646464] sm:p-2 text-left
hover:rounded-[1rem] hover:bg-[rgba(50,50,50,0.1)];
font-family: "immo Sans";
font-weight:400;}
.glow{@apply rounded-[1rem] bg-[rgba(50,50,50,0.1)];}
</style>

View File

@@ -1,114 +0,0 @@
---
import HeaderLogin from "#components/design/header/HeaderLogin.svelte";
const { tabHover1 } = Astro.props;
const { tabHover2 } = Astro.props;
const { tabHover3 } = Astro.props;
const { tabHover4 } = Astro.props;
const { tabHover5 } = Astro.props;
const { tabHover6 } = Astro.props;
const { tabHover7 } = Astro.props;
const { params, url } = Astro;
const partner = params.partner;
const url1 = new URL(Astro.request.url);
const urlPath = url1.pathname;
const isVA = urlPath.includes("verbrauchsausweis-wohngebaeude");
const isVAG = urlPath.includes("verbrauchsausweis-gewerbe");
const isBA = urlPath.includes("bedarfsausweis-wohngebaeude");
const isBAG = urlPath.includes("bedarfsausweis-gewerbe-anfragen");
const isGGW = urlPath.includes("geg-nachweis-wohnen-anfragen");
const isGGG = urlPath.includes("geg-nachweis-gewerbe-anfragen");
const isWEA = urlPath.includes("welcher-ausweis");
const isWelt = urlPath.includes("immowelt");
const isNET = urlPath.includes("immonet");
---
<header id="header" class="w-full bg-white h-[81px] sm:pl-8">
<div class="grid grid-cols-[min-content_1fr] items-center">
<div class="w-[150px] h-[80px]">
<div class="w-full h-full grid grid-col-1 justify-items-center items-center">
<img class={isNET ? "w-[149px]" : isWelt ? "w-[109px]" : "w-[109px]"} src={`/images/partner/${partner}/${partner}.svg`} alt={partner} />
</div>
</div>
<div>
<ul class="navlist">
<li><a href={`/${partner}/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/`}><button class={tabHover1}>Verbrauchsausweis</button></a></li>
<li><a href={`/${partner}/energieausweis-erstellen/verbrauchsausweis-gewerbe/`}><button class={tabHover2}>Verbrauchsausweis Gewerbe</button></a></li>
<li><a href={`/${partner}/energieausweis-erstellen/bedarfsausweis-wohngebaeude/`}><button class={tabHover3}>Bedarfsausweis</button></a></li>
<li><a href={`/${partner}/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/`}><button class={tabHover4}>Bedarfsausweis Gewerbe</button></a></li>
<li><a href={`/${partner}/angebot-anfragen/geg-nachweis-wohnen-anfragen/`}><button class={tabHover5}>GEG Nachweis Wohngebäude</button></a></li>
<li><a href={`/${partner}/angebot-anfragen/geg-nachweis-gewerbe-anfragen/`}><button class={tabHover6}>GEG Nachweis Gewerbe</button></a></li>
<li><a href={`/${partner}/welcher-ausweis/${partner}`}><button class={tabHover7}>Welcher Ausweis</button></a></li>
</ul>
</div>
</div>
</header>
<div id="titel" class="block w-full 2xl:h-[270px] lg:h-[148px] bg-cover px-24 py-20"
style={`background-image: url('/images/partner/${partner}/hero-energieausweis.jpg');
background-repeat:no-repeat; background-position:right;`}>
{isVA ? <div>Hier komfortabel und einfach online den <b>Verbrauchsausweis Wohngebäude</b> bestellen</div> : ""}
{isVAG ? <div>Hier komfortabel und einfach online den <b>Verbrauchsausweis Gewerbe</b> bestellen</div> : ""}
{isBA ? <div>Hier komfortabel und einfach online den <b>Bedarfsausweis Wohngebäude</b> bestellen</div> : ""}
{isBAG ? <div>Hier komfortabel und einfach online den <b>Bedarfsausweis Gewerbe</b> anfragen</div> : ""}
{isGGW ? <div>Hier komfortabel und einfach online den <b>GEG Nachweis Wohngebäude</b> anfragen</div> : ""}
{isGGG ? <div>Hier komfortabel und einfach online den <b>GEG Nachweis Gewerbe</b> anfragen</div> : ""}
{isWEA ? <div>Hier komfortabel und einfach online den richtigen Ausweis finden</div> : ""}
</div>
<style lang="postcss">
@font-face {
font-family: "immo Sans";
src: url('/fonts/Immo-Sans/immoSans-Regular.eot');
src: url('/fonts/Immo-Sans/immoSans-Regular.eot?#iefix') format('embedded-opentype'),
url('/fonts/Immo-Sans/immoSans-Regular.woff2') format('woff2'),
url('/fonts/Immo-Sans/immoSans-Regular.woff') format('woff');
font-style: normal;
font-weight: 400;
}
#titel{
font-family: "immo Sans";
font-weight:400;
div{@apply w-fit bg-white/75 py-6 px-16 rounded-lg ring-2 ring-black/15 text-[1.45rem];box-shadow:8px 8px 16px rgba(0,0,0,0.5);}
}
.header-button {
@apply px-4 py-2 text-primary-content font-medium text-lg tracking-normal hover:bg-secondary h-full;
}
.navlist {
@apply flex flex-wrap flex-col sm:flex-row pl-[1.75rem] sm:pl-[1.75rem];
}
.navlist li {
@apply pr-0 sm:pr-[6px] pb-1 sm:pb-0;
}
.navlist li button{@apply text-[0.75rem] md:text-[1rem] text-[#646464] sm:p-2 text-left
hover:rounded-[1rem] hover:bg-[rgba(50,50,50,0.1)];
font-family: "immo Sans";
font-weight:400;}
.glow{@apply rounded-[1rem] bg-[rgba(50,50,50,0.1)];}
</style>

View File

@@ -1,7 +1,7 @@
--- ---
import "../style/global.css"; import "../style/global.css";
import "../style/formular.css"; import "../style/formular.css";
import "../../svelte-dialogs.config" import "../../svelte-dialogs.config";
import Header from "#components/design/header/AusweisHeaderImmowelt.astro"; import Header from "#components/design/header/AusweisHeaderImmowelt.astro";
import Footer from "#components/design/footer/Footer.astro"; import Footer from "#components/design/footer/Footer.astro";
import { NotificationWrapper } from "@ibcornelsen/ui"; import { NotificationWrapper } from "@ibcornelsen/ui";
@@ -12,50 +12,53 @@ export interface Props {
const { title } = Astro.props; const { title } = Astro.props;
--- ---
<script> <script>
window.addEventListener("scroll", (event) => { window.addEventListener("scroll", (event) => {
let scroll = window.scrollY; let scroll = window.scrollY;
console.log(scroll);
if (scroll >= 400) {
document
.getElementById("skala")
?.classList.add(
"2xl:fixed",
"2xl:py-4",
"2xl:top-0",
"2xl:z-20"
);
document.getElementById("skala")?.classList.remove("w-full");
document.getElementById("skala").style.borderBottom =
"3px solid #e6e6e6";
console.log(scroll); document.getElementById("performance-box").style.maxWidth =
if(scroll>=400){ "688.5px";
document.getElementById("progress-box").style.maxWidth = "688.5px";
document.getElementById('skala')?.classList.add('2xl:fixed','2xl:py-4','2xl:top-0','2xl:z-20'); document
document.getElementById('skala')?.classList.remove('w-full'); .getElementById("formInput-1")
?.classList.add("2xl:mt-[370px]");
} else {
document
.getElementById("skala")
?.classList.remove(
"2xl:fixed",
"2xl:py-4",
"2xl:top-0",
"2xl:z-20"
);
document.getElementById("skala")?.classList.add("w-full");
document.getElementById("skala").style.borderBottom = "none";
document.getElementById('skala').style.borderBottom = "3px solid #e6e6e6"; document
.getElementById("formInput-1")
?.classList.remove("2xl:mt-[370px]");
document.getElementById('performance-box').style.maxWidth = "688.5px"; }
document.getElementById('progress-box').style.maxWidth = "688.5px"; });
document.getElementById('formInput-1')?.classList.add('2xl:mt-[370px]');
}else{
document.getElementById('skala')?.classList.remove('2xl:fixed','2xl:py-4','2xl:top-0','2xl:z-20');
document.getElementById('skala')?.classList.add('w-full');
document.getElementById('skala').style.borderBottom = "none";
document.getElementById('formInput-1')?.classList.remove('2xl:mt-[370px]');
}
});
</script> </script>
<!DOCTYPE html>
<html lang="de"> <html lang="de">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
@@ -79,7 +82,10 @@ console.log(scroll);
content="✅ Jetzt Ihren Energieausweis online erstellen. Erhalten Sie Ihren online Energieausweis rechtssicher und nach aktueller GEG (vormals EnEV) vom Diplom Ingenieur geprüft." content="✅ Jetzt Ihren Energieausweis online erstellen. Erhalten Sie Ihren online Energieausweis rechtssicher und nach aktueller GEG (vormals EnEV) vom Diplom Ingenieur geprüft."
/> />
<meta property="og:url" content="https://online-energieausweis.org/" /> <meta property="og:url" content="https://online-energieausweis.org/" />
<meta property="og:site_name" content="Energieausweis online erstellen" /> <meta
property="og:site_name"
content="Energieausweis online erstellen"
/>
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta <meta
@@ -95,14 +101,13 @@ console.log(scroll);
content="https://online-energieausweis.org/images/energieausweis-online-erstellen.jpg" content="https://online-energieausweis.org/images/energieausweis-online-erstellen.jpg"
/> />
<title> <title>
{title || 'Energieausweis online erstellen - Online Energieausweis'} {title || "Energieausweis online erstellen - Online Energieausweis"}
</title> </title>
</head> </head>
<body> <body>
<Header /> <Header />
<main <main
class="w-full p-0 grid class="w-full p-0 grid
xs:grid-cols-[minmax(1fr)] xs:gap-1 xs:p-0 xs:grid-cols-[minmax(1fr)] xs:gap-1 xs:p-0
@@ -110,19 +115,15 @@ console.log(scroll);
md:grid-cols-[minmax(1fr)] md:gap-2 md:p-0 md:grid-cols-[minmax(1fr)] md:gap-2 md:p-0
lg:grid-cols-[minmax(1fr)] lg:gap-3 lg:p-4 lg:grid-cols-[minmax(1fr)] lg:gap-3 lg:p-4
xl:grid-cols-[minmax(1fr)] xl:gap-4 xl:p-6 xl:grid-cols-[minmax(1fr)] xl:gap-4 xl:p-6
2xl:grid-cols-[minmax(1fr)] 2xl:gap-5 2xl:p-6 2xl:grid-cols-[minmax(1fr)] 2xl:gap-5 2xl:p-6"
"> >
<article class="box rounded-tl-none p-2 lg:p-12">
<slot />
<article class="box rounded-tl-none p-2 lg:p-12"> </article>
<slot />
</article>
</main> </main>
<Footer /> <Footer />
<NotificationWrapper client:load /> <NotificationWrapper client:load />
</body> </body>
</html> </html>

View File

@@ -2,31 +2,16 @@
import "../style/global.css"; import "../style/global.css";
import "../style/formular.css"; import "../style/formular.css";
import "../../svelte-dialogs.config" import "../../svelte-dialogs.config"
import Header from "#components/design/header/AusweisHeader_partner.astro"; import AusweisHeaderPartner from "#components/design/header/AusweisHeaderPartner.astro";
import Footer from "#components/design/footer/Footer.astro"; import Footer from "#components/design/footer/Footer.astro";
import SidebarLeft from "#components/design/sidebars/SidebarLeft.astro";
import { NotificationWrapper } from "@ibcornelsen/ui"; import { NotificationWrapper } from "@ibcornelsen/ui";
export interface Props { export interface Props {
title: string; title: string;
tabHover1: string; tab: number;
tabHover2: string;
tabHover3: string;
tabHover4: string;
tabHover5: string;
tabHover6: string;
tabHover7: string;
} }
const { title } = Astro.props; const { title, tab } = Astro.props;
const { tabHover1 } = Astro.props;
const { tabHover2 } = Astro.props;
const { tabHover3 } = Astro.props;
const { tabHover4 } = Astro.props;
const { tabHover5 } = Astro.props;
const { tabHover6 } = Astro.props;
const { tabHover7 } = Astro.props;
--- ---
<script> <script>
@@ -143,7 +128,7 @@ window.addEventListener("scroll", () => {
<body> <body>
<Header {tabHover1} {tabHover2} {tabHover3} {tabHover4} {tabHover5} {tabHover6} {tabHover7}/> <AusweisHeaderPartner {tab}/>
<main class="w-full p-0 grid grid-cols-1 rounded-none"> <main class="w-full p-0 grid grid-cols-1 rounded-none">

View File

@@ -1,5 +1,5 @@
--- ---
import AusweisLayout from "#layouts/AusweisLayoutDaten.astro"; import AusweisLayoutDatenPartner from "#layouts/AusweisLayoutDatenPartner.astro";
import VerbrauchsausweisWohnenModule from "#modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte"; import VerbrauchsausweisWohnenModule from "#modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte";
import { import {
Aufnahme, Aufnahme,
@@ -209,7 +209,11 @@ if (typ === AusstellungsTyp.Neuausstellung) {
} }
--- ---
<AusweisLayout title="Verbrauchsausweis erstellen"> <AusweisLayoutDatenPartner title="Verbrauchsausweis erstellen" tab={
ausweisart === "verbrauchsausweis-wohngebaeude" ? 0 :
ausweisart === "verbrauchsausweis-gewerbe" ? 1 :
ausweisart === "bedarfsausweis-wohngebaeude" ? 2 : 0
}>
{ {
ausweisart === "verbrauchsausweis-wohngebaeude" && ( ausweisart === "verbrauchsausweis-wohngebaeude" && (
<VerbrauchsausweisWohnenModule <VerbrauchsausweisWohnenModule
@@ -258,4 +262,4 @@ if (typ === AusstellungsTyp.Neuausstellung) {
/> />
) )
} }
</AusweisLayout> </AusweisLayoutDatenPartner>

View File

@@ -1,87 +0,0 @@
import { Enums } from "#lib/client/prisma";
import { test, describe, expect } from "bun:test";
import {faker} from "@faker-js/faker";
// import { client } from "src/trpc";
import { Buffer } from 'buffer';
describe("Bilder hochladen", async () => {
// Erstmal lesen wir ein Bild ein, mit dem wir testen können
const arrayBuffer = await Bun.file("cypress/fixtures/images/daemmung/1.jpeg").arrayBuffer();
const buffer = Buffer.from(arrayBuffer)
const base64 = buffer.toString("base64");
// Im Browser hätten wir noch einen Mime Type vor dem base64-String
const base64WithMimeType = "data:image/jpeg;base64," + base64;
// Wir müssen uns einloggen, da wir für das Hochladen von Bildern einen Access Token brauchen
const email = faker.internet.email();
const passwort = faker.internet.password();
const signUpResponse = await client.v1.benutzer.erstellen.mutate({
email,
passwort,
name: faker.person.lastName(),
vorname: faker.person.firstName(),
})
// Jetzt loggen wir uns ein
const loginResponse = await client.v1.benutzer.getRefreshToken.query({
email,
passwort,
})
// Wir brauchen den Access Token
const accessToken = loginResponse.accessToken;
// Der Default Client versucht den Cookie zu lesen, das geht hier natürlich nicht
const newClient = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: 'http://localhost:3001/',
headers() {
if (!accessToken) return {};
const buffer = Buffer.from(accessToken, 'utf-8');
const base64 = buffer.toString('base64')
return {
'Authorization': `Bearer ${base64}`,
};
},
}),
],
});
// Wir brauchen noch ein Gebäude, damit wir das Bild hochladen können
const gebaeude = await newClient.v1.gebaeude.erstellen.mutate({})
// Jetzt laden wir das Bild hoch
const image = await newClient.v1.bilder.upload.mutate({
base64: base64WithMimeType,
gebaeude_uid: gebaeude.uid,
kategorie: Enums.BilderKategorie.Daemmung,
})
test("sollte ohne Fehler hochladen", async () => {
expect(image).toHaveProperty("uid");
expect(image.uid).toBeTypeOf("string")
})
test("bild sollte in der Datenbank und abrufbar sein", async () => {
const bild = await newClient.v1.bilder.getBase64.query({ uid: image.uid });
expect(bild).toHaveProperty("base64");
expect(bild.data).toBeTypeOf("string");
expect(bild.data).toEqual(base64);
})
test("bild sollte entfernbar sein", async () => {
const response = await newClient.v1.bilder.entfernen.mutate({ uid: image.uid });
expect(response).toBeEmpty();
// Einmal nachschauen ob es tatächlich gelöscht wurde
expect(newClient.v1.bilder.getBase64.query({ uid: image.uid })).rejects.toThrow()
})
});

View File

@@ -1,19 +0,0 @@
import { test, describe, expect } from "bun:test";
import { pdfVerbrauchsausweisWohnen } from "#lib/pdf/pdfVerbrauchsausweisWohnen.js";
import { fakeVerbrauchsausweisWohnen } from "#lib/faker.js";
import { VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
describe('Verbrauchsausweis Wohnen PDF', async () => {
const ausweis: VerbrauchsausweisWohnenClient = fakeVerbrauchsausweisWohnen(42);
test("Ausweis Erstellung", async () => {
const pdf = await pdfVerbrauchsausweisWohnen(ausweis);
// Wir können das PDF nicht richtig überprüfen, dafür brauchen wir manuelle Tests
// Allerdings können wir überprüfen, ob das PDF erstellt wurde.
expect(pdf).toBeDefined();
expect(pdf).toBeInstanceOf(Uint8Array);
expect(pdf.length).toBeGreaterThan(0);
})
})

View File

@@ -1,39 +0,0 @@
import { test, describe, expect } from "bun:test";
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016.js";
import { importVerbrauchsausweisWohnenAltesSystem, verbrauchsausweisWohnenImportTranslate } from "#lib/altes-system/import.js";
describe('Energieverbrauch', async () => {
const request = await importVerbrauchsausweisWohnenAltesSystem();
for (const ausweis of request.data) {
if (ausweis.ausweisart !== "VA" || !ausweis.objekt_plz) {
continue;
}
const ausweisNeu = verbrauchsausweisWohnenImportTranslate(ausweis);
const berechnungen = await endEnergieVerbrauchVerbrauchsausweis_2016(ausweisNeu);
const berechnungenAlt = ausweis.calculations;
let missingKlimafaktoren: boolean = false;
test("Klimafaktoren", async () => {
console.log("PLZ: " + ausweisNeu.aufnahme.plz)
console.log("Startdatum: " + ausweisNeu.startdatum)
expect(berechnungen?.klimafaktoren).toHaveLength(3)
try {
expect(berechnungen?.klimafaktoren.map(x => x.klimafaktor)).toEqual(berechnungenAlt.klimafaktoren)
} catch(e) {
missingKlimafaktoren = true;
}
})
test.skipIf(missingKlimafaktoren)("Endenergieverbrauch", async () => {
expect(berechnungen?.endEnergieVerbrauchGesamt).toBeCloseTo(berechnungenAlt.endEnergieVerbrauchGesamt, 0)
})
test.skipIf(missingKlimafaktoren)("Primärenergieverbrauch", async () => {
expect(berechnungen?.primaerEnergieVerbrauchGesamt).toBeCloseTo(berechnungenAlt.primaerEnergieVerbrauchGesamt, 0)
})
}
})