Ausweise Prüfen

Nicht fertige Version für Jens
This commit is contained in:
Moritz Utcke
2024-02-23 22:07:47 +07:00
parent 977588f51b
commit b1bd2d20ac
4 changed files with 1460 additions and 37 deletions

View File

@@ -32,16 +32,32 @@ export async function endEnergieVerbrauchVerbrauchsausweis_2016(
return null
}
let klimafaktoren: Awaited<ReturnType<typeof getKlimafaktoren>>;
let klimafaktoren: Awaited<ReturnType<typeof getKlimafaktoren>> = [{
month: ausweis.startdatum.getMonth(),
year: ausweis.startdatum.getFullYear(),
klimafaktor: 1
},
{
month: ausweis.startdatum.getMonth(),
year: ausweis.startdatum.getFullYear() + 1,
klimafaktor: 1
},
{
month: ausweis.startdatum.getMonth(),
year: ausweis.startdatum.getFullYear() + 2,
klimafaktor: 1
}];
try {
klimafaktoren = await getKlimafaktoren(ausweis.startdatum, ausweis.gebaeude_stammdaten.plz)
const response = await getKlimafaktoren(ausweis.startdatum, ausweis.gebaeude_stammdaten.plz)
if (response) {
klimafaktoren = response
}
} catch (e) {
return null
}
if (!klimafaktoren) {
return null
// TODO: Entweder setzen wir hier mit falschen Klimafaktoren fort, oder wir geben null zurück.
// Im Moment setzen wir einfach fort, aber das ist nicht unbedingt die beste Lösung.
// return null
}