Auto stash before checking out "origin/main"

.
This commit is contained in:
Robert Jagtiani
2025-04-02 18:48:52 +02:00
parent cfdfef039e
commit 78523171e9
33 changed files with 798 additions and 79 deletions

View File

@@ -1,77 +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;
---
<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="w-[109px]" src="/images/immowelt/immowelt.svg" alt="immowelt"/>
</div>
</div>
<div>
<ul class="navlist">
<li><a href="/immowelt/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/"><button class={tabHover1}>Verbrauchsausweis</button></a></li>
<li><a href="/immowelt/energieausweis-erstellen/verbrauchsausweis-gewerbe/"><button class={tabHover2}>Verbrauchsausweis Gewerbe</button></a></li>
<li><a href="/immowelt/energieausweis-erstellen/bedarfsausweis-wohngebaeude/"><button class={tabHover3}>Bedarfsausweis</button></a></li>
<li><a href="/immowelt/angebot-anfragen/bedarfsausweis-gewerbe-anfragen/"><button class={tabHover4}>Bedarfsausweis Gewerbe</button></a></li>
<li><a href="/immowelt/angebot-anfragen/geg-nachweis-wohnen-anfragen/"><button class={tabHover5}>GEG Nachweis Wohngebäude</button></a></li>
<li><a href="/immowelt/angebot-anfragen/geg-nachweis-gewerbe-anfragen/"><button class={tabHover6}>GEG Nachweis Gewerbe</button></a></li>
<li><a href="/immowelt/welcher-ausweis/"><button class={tabHover7}>Welcher Ausweis</button></a></li>
</ul>
</div>
</div>
</header>
<div class="block w-full 2xl:h-[270px] lg:h-[148px] bg-cover" style="background-image: url('/images/immowelt/hero-desktop.png');
background-repeat:no-repeat; background-position:right;">
</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;
}
.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

@@ -0,0 +1,110 @@
---
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);
// Beispiel: prüfen, ob "immowelt" im Pfad vorkommt
const urlPath = url1.pathname; // z.B. "/immowelt/angebot-anfragen/..."
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");
---
<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="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/`}><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-12 py-8"
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 Verbrauchsausweis Wohngebäude bestellen</div> : ""}
{isVAG ? <div>Hier komfortabel und einfach online den Verbrauchsausweis Gewerbe bestellen</div> : ""}
{isBA ? <div>Hier komfortabel und einfach online den Bedarfsausweis Wohngebäude bestellen</div> : ""}
{isBAG ? <div>Hier komfortabel und einfach online den Bedarfsausweis Gewerbe bestellen</div> : ""}
{isGGW ? <div>Hier komfortabel und einfach online den GEG Nachweis Wohngebäude bestellen</div> : ""}
{isGGG ? <div>Hier komfortabel und einfach online den GEG Nachweis Gewerbe bestellen</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;
}
.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

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

View File

@@ -0,0 +1,88 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import VerbrauchsausweisWohnenModule from "#modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte";
import { AufnahmeClient, BildClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
import { Aufnahme, BedarfsausweisGewerbe, Bild, Enums, Objekt, Unterlage, VerbrauchsausweisWohnen } from "#lib/server/prisma";
import { getAufnahme, getBedarfsausweisGewerbe, getBilder, getObjekt, getUnterlagen, getVerbrauchsausweisWohnen } from "#lib/server/db";
import { getCurrentUser } from "#lib/server/user";
import BedarfsausweisGewerbeModule from "#modules/angebot-anfragen/BedarfsausweisGewerbeModule.svelte";
const id = Astro.url.searchParams.get("id");
const aufnahme_id = Astro.url.searchParams.get("aufnahme")
let ausweistyp = Astro.url.searchParams.get("ausweistyp") as Enums.AusweisTyp || Enums.AusweisTyp.Standard;
let nachweis: BedarfsausweisGewerbe = {} as BedarfsausweisGewerbe;
let aufnahme: Aufnahme = {} as Aufnahme;
let objekt: Objekt = {} as Objekt;
let bilder: Bild[] = []
let unterlagen: Unterlage[] = []
const user = await getCurrentUser(Astro)
if (id) {
if (!user) {
return Astro.redirect(
`/auth/login?redirect=${Astro.url.toString()}`
);
}
nachweis = await getBedarfsausweisGewerbe(id) as BedarfsausweisGewerbe
if (!nachweis || nachweis.benutzer_id !== user.id) {
// Der Ausweis scheint nicht zu existieren.
// Wir leiten auf die generische Ausweisseite ohne ID weiter.
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-wohngebaeude"
);
}
aufnahme = await getAufnahme(nachweis.aufnahme_id) as Aufnahme
if (!aufnahme) {
// Die Aufnahme existiert nicht, das sollte eigentlich nicht passieren aber so können wir nicht fortfahren.
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-wohngebaeude"
);
}
objekt = await getObjekt(aufnahme.objekt_id) as Objekt
if (!objekt) {
// Das Objekt existiert nicht, das sollte eigentlich nicht passieren aber so können wir nicht fortfahren.
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-wohngebaeude"
);
}
bilder = await getBilder(aufnahme.id);
unterlagen = await getUnterlagen(aufnahme.id);
} else if (aufnahme_id) {
if (!user) {
return Astro.redirect(
`/auth/login?redirect=${Astro.url.toString()}`
);
}
aufnahme = await getAufnahme(nachweis.aufnahme_id) as Aufnahme
if (!aufnahme) {
// Die Aufnahme existiert wohl nicht.
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-wohngebaeude"
);
}
objekt = await getObjekt(aufnahme.objekt_id) as Objekt
if (!objekt) {
// Das Objekt existiert nicht.
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-wohngebaeude"
);
}
}
---
<AusweisLayout title="Bedarfsausweis Gewerbe anfragen">
<BedarfsausweisGewerbeModule client:only {nachweis} {objekt} {aufnahme} {bilder} {unterlagen} {id} {ausweistyp} />
</AusweisLayout>

View File

@@ -0,0 +1,13 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import ProduktUebersichtBedarfsausweisGewerbe from "#components/design/content/ProduktUebersichtBedarfsausweisGewerbe.svelte";
---
<AusweisLayout title="Bedarfsausweis Gewerbe Produktübersicht">
<ProduktUebersichtBedarfsausweisGewerbe>
</ProduktUebersichtBedarfsausweisGewerbe>
</AusweisLayout>

View File

@@ -0,0 +1,90 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import { AufnahmeClient, GEGNachweisWohnenClient, ObjektClient, UnterlageClient, UploadedGebaeudeBild } from "#components/Ausweis/types";
import { createCaller } from "src/astro-typesafe-api-caller";
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants.js";
import { validateAccessTokenServer } from "#server/lib/validateAccessToken.js";
import GEGNachweisGewerbeModule from "#modules/angebot-anfragen/GEGNachweisGewerbeModule.svelte";
const uid = Astro.url.searchParams.get("uid");
let nachweis: GEGNachweisWohnenClient = {} as GEGNachweisWohnenClient;
let aufnahme: AufnahmeClient = {} as AufnahmeClient;
let objekt: ObjektClient = {} as ObjektClient;
let bilder: UploadedGebaeudeBild[] = []
let unterlagen: UnterlageClient[] = []
const valid = validateAccessTokenServer(Astro);
const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
`/auth/login?redirect=${Astro.url.toString()}`
);
}
try {
nachweis = await caller["geg-nachweis-wohnen"]._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid
}
});
aufnahme = await caller.aufnahme._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: nachweis.uid_aufnahme
}
})
objekt = await caller.objekt._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: nachweis.uid_objekt
}
})
bilder = await caller.aufnahme._uid.bilder.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: nachweis.uid_aufnahme
}
})
unterlagen = await caller.aufnahme._uid.unterlagen.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: nachweis.uid_aufnahme
}
})
if (!nachweis) {
// Der Ausweis scheint nicht zu existieren.
// Wir leiten auf die generische Ausweisseite ohne UID weiter.
return Astro.redirect(
"/angebot-anfragen/geg-nachweis-wohnen-anfragen"
);
}
} catch(e) {
return Astro.redirect(
"/angebot-anfragen/geg-nachweis-wohnen-anfragen"
);
}
}
---
<AusweisLayout title="GEG Nachweis Wohnen anfragen" tabHover6="glow">
<GEGNachweisGewerbeModule client:only {nachweis} {objekt} {aufnahme} {bilder} {unterlagen} />
</AusweisLayout>

View File

@@ -0,0 +1,13 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import ProduktUebersichtGEGNachweisGewerbe from "#components/design/content/ProduktUebersichtGEGNachweisGewerbe.svelte";
---
<AusweisLayout title="GEG Nachweis Gewerbe Produktübersicht">
<ProduktUebersichtGEGNachweisGewerbe>
</ProduktUebersichtGEGNachweisGewerbe>
</AusweisLayout>

View File

@@ -0,0 +1,93 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import { AufnahmeClient, GEGNachweisWohnenClient, ObjektClient, UnterlageClient, UploadedGebaeudeBild } from "#components/Ausweis/types";
import { createCaller } from "src/astro-typesafe-api-caller";
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants.js";
import { validateAccessTokenServer } from "#server/lib/validateAccessToken.js";
import GEGNachweisWohnenModule from "#modules/angebot-anfragen/GEGNachweisWohnenModule.svelte";
import { Enums } from "#lib/server/prisma";
const uid = Astro.url.searchParams.get("uid");
const ausweistyp = Astro.url.searchParams.get("ausweistyp") || Enums.AusweisTyp.Standard;
let nachweis: GEGNachweisWohnenClient = {} as GEGNachweisWohnenClient;
let aufnahme: AufnahmeClient = {} as AufnahmeClient;
let objekt: ObjektClient = {} as ObjektClient;
let bilder: UploadedGebaeudeBild[] = []
let unterlagen: UnterlageClient[] = []
const valid = validateAccessTokenServer(Astro);
const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
`/auth/login?redirect=${Astro.url.toString()}`
);
}
try {
nachweis = await caller["geg-nachweis-wohnen"]._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid
}
});
aufnahme = await caller.aufnahme._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: nachweis.uid_aufnahme
}
})
objekt = await caller.objekt._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: nachweis.uid_objekt
}
})
bilder = await caller.aufnahme._uid.bilder.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: nachweis.uid_aufnahme
}
})
unterlagen = await caller.aufnahme._uid.unterlagen.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: nachweis.uid_aufnahme
}
})
if (!nachweis) {
// Der Ausweis scheint nicht zu existieren.
// Wir leiten auf die generische Ausweisseite ohne UID weiter.
return Astro.redirect(
"/angebot-anfragen/geg-nachweis-wohnen-anfragen"
);
}
} catch(e) {
return Astro.redirect(
"/angebot-anfragen/geg-nachweis-wohnen-anfragen"
);
}
}
---
<AusweisLayout title="GEG Nachweis Wohnen anfragen" tabHover5="glow">
<GEGNachweisWohnenModule client:only {nachweis} {objekt} {aufnahme} {bilder} {ausweistyp} {unterlagen} />
</AusweisLayout>

View File

@@ -0,0 +1,13 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import ProduktUebersichtGEGNachweisWohnen from "#components/design/content/ProduktUebersichtGEGNachweisWohnen.svelte";
---
<AusweisLayout title="GEG Nachweis Wohnen Produktübersicht">
<ProduktUebersichtGEGNachweisWohnen>
</ProduktUebersichtGEGNachweisWohnen>
</AusweisLayout>

View File

@@ -0,0 +1,82 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import BedarfsausweisWohnenModule from "#modules/BedarfsausweisWohnen/BedarfsausweisWohnenModule.svelte";
import { AufnahmeClient, BedarfsausweisWohnenClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
import { createCaller } from "src/astro-typesafe-api-caller";
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants";
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
const uid = Astro.url.searchParams.get("uid");
let ausweis: VerbrauchsausweisWohnenClient = {} as VerbrauchsausweisWohnenClient;
let aufnahme: AufnahmeClient = {} as AufnahmeClient;
let objekt: ObjektClient = {} as ObjektClient;
let bilder: UploadedGebaeudeBild[] = []
const valid = validateAccessTokenServer(Astro);
const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
`/auth/login?redirect=${Astro.url.toString()}`
);
}
try {
ausweis = await caller["bedarfsausweis-wohnen"]._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid
}
});
aufnahme = await caller.aufnahme._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: ausweis.uid_aufnahme
}
})
objekt = await caller.objekt._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: ausweis.uid_objekt
}
})
bilder = await caller.aufnahme._uid.bilder.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: ausweis.uid_aufnahme
}
})
if (!ausweis) {
// Der Ausweis scheint nicht zu existieren.
// Wir leiten auf die generische Ausweisseite ohne UID weiter.
return Astro.redirect(
"/energieausweis-erstellen/bedarfsausweis-wohnen"
);
}
} catch(e) {
return Astro.redirect(
"/energieausweis-erstellen/bedarfsausweis-wohnen"
);
}
}
---
<AusweisLayout title="Bedarfsausweis erstellen | IBCornelsen" tabHover3="glow">
<BedarfsausweisWohnenModule client:load {ausweis} {objekt} {aufnahme} {bilder}></BedarfsausweisWohnenModule>
</AusweisLayout>

View File

@@ -0,0 +1,13 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import ProduktUebersichtBedarfsausweisWohnen from "#components/design/content/ProduktUebersichtBedarfsausweisWohnen.svelte";
---
<AusweisLayout title="Bedarfsausweis Wohngebäude Produktübersicht">
<div class="mx-auto my-8" style="width:85%">
<ProduktUebersichtBedarfsausweisWohnen ref="/immowelt"></ProduktUebersichtBedarfsausweisWohnen>
</div>
</AusweisLayout>

View File

@@ -0,0 +1,86 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import { AufnahmeClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisGewerbeClient } from "#components/Ausweis/types";
import { createCaller } from "src/astro-typesafe-api-caller";
import { inferOutput } from "astro-typesafe-api/client";
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants";
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
import VerbrauchsausweisGewerbeModule from "#modules/VerbrauchsausweisGewerbe/VerbrauchsausweisGewerbeModule.svelte";
import { Enums } from "#lib/server/prisma";
const uid = Astro.url.searchParams.get("uid");
const ausweistyp = Astro.url.searchParams.get("ausweistyp") || Enums.AusweisTyp.Standard;
let ausweis: VerbrauchsausweisGewerbeClient = {} as VerbrauchsausweisGewerbeClient;
let aufnahme: AufnahmeClient = {} as AufnahmeClient;
let objekt: ObjektClient = {} as ObjektClient;
let bilder: UploadedGebaeudeBild[] = []
const valid = validateAccessTokenServer(Astro);
const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
`/auth/login?redirect=${Astro.url.toString()}`
);
}
try {
let { uid_aufnahme, uid_objekt, uid_benutzer, ...result } = await caller["verbrauchsausweis-gewerbe"]._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid
}
});
ausweis = result
aufnahme = await caller.aufnahme._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: uid_aufnahme
}
})
objekt = await caller.objekt._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: uid_objekt
}
})
bilder = await caller.aufnahme._uid.bilder.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: uid_aufnahme
}
})
if (!ausweis) {
// Der Ausweis scheint nicht zu existieren.
// Wir leiten auf die generische Ausweisseite ohne UID weiter.
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-gewerbe"
);
}
} catch(e) {
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-gewerbe"
);
}
}
---
<AusweisLayout title="Verbrauchsausweis Gewerbe erstellen | IBCornelsen" tabHover2="glow">
<VerbrauchsausweisGewerbeModule client:only {ausweis} {objekt} {aufnahme} {bilder} {ausweistyp}/>
</AusweisLayout>

View File

@@ -0,0 +1,14 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import ProduktUebersichtVerbrauchsausweisGewerbe from "#components/design/content/ProduktUebersichtVerbrauchsausweisGewerbe.svelte";
---
<AusweisLayout title="Verbrauchsausweis Gewerbe Produktübersicht">
<div class="mx-auto my-8" style="width:85%">
<ProduktUebersichtVerbrauchsausweisGewerbe ref="/immowelt">
</ProduktUebersichtVerbrauchsausweisGewerbe>
</div>
</AusweisLayout>

View File

@@ -0,0 +1,85 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import VerbrauchsausweisWohnenModule from "#modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte";
import { AufnahmeClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
import { createCaller } from "src/astro-typesafe-api-caller";
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants";
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
import { Enums } from "#lib/server/prisma";
const uid = Astro.url.searchParams.get("uid");
const ausweistyp = Astro.url.searchParams.get("ausweistyp") || Enums.AusweisTyp.Standard;
let ausweis: VerbrauchsausweisWohnenClient = {} as VerbrauchsausweisWohnenClient;
let aufnahme: AufnahmeClient = {} as AufnahmeClient;
let objekt: ObjektClient = {} as ObjektClient;
let bilder: UploadedGebaeudeBild[] = []
const valid = validateAccessTokenServer(Astro);
const caller = createCaller(Astro);
if (uid) {
if (!valid) {
return Astro.redirect(
`/auth/login?redirect=${Astro.url.toString()}`
);
}
try {
ausweis = await caller["verbrauchsausweis-wohnen"]._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid
}
});
aufnahme = await caller.aufnahme._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: ausweis.uid_aufnahme
}
})
objekt = await caller.objekt._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: ausweis.uid_objekt
}
})
bilder = await caller.aufnahme._uid.bilder.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
},
params: {
uid: ausweis.uid_aufnahme
}
})
if (!ausweis) {
// Der Ausweis scheint nicht zu existieren.
// Wir leiten auf die generische Ausweisseite ohne UID weiter.
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-wohngebaeude"
);
}
} catch(e) {
return Astro.redirect(
"/energieausweis-erstellen/verbrauchsausweis-wohngebaeude"
);
}
}
---
<AusweisLayout title="Verbrauchsausweis erstellen" tabHover1="glow">
<VerbrauchsausweisWohnenModule client:only {ausweis} {objekt} {aufnahme} {bilder} {ausweistyp} />
</AusweisLayout>

View File

@@ -0,0 +1,13 @@
---
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
import ProduktUebersichtVerbrauchsausweisWohnen from "#components/design/content/ProduktUebersichtVerbrauchsausweisWohnen.svelte";
---
<AusweisLayout title="Verbrauchsausweis Wohngebäude Produktübersicht">
<div class="mx-auto my-8" style="width:85%">
<ProduktUebersichtVerbrauchsausweisWohnen ref="/immowelt">
</ProduktUebersichtVerbrauchsausweisWohnen>
</div>
</AusweisLayout>