Fehler gefixt

This commit is contained in:
Moritz Utcke
2025-03-10 20:11:57 -03:00
parent e69362536e
commit 4979a1d112
23 changed files with 501 additions and 233 deletions

View File

@@ -463,6 +463,8 @@ Table VerbrauchsausweisGewerbe {
prueftext String [note: '@zod.describe("Durch den Kunden hinzugefügte Anmerkung zur Vorabprüfung")']
beschreibung String
kontrolldatei_angefragt Boolean [default: false, note: '@zod.describe("Ob bei der Anfrage der Registriernummer eine Kontrolldatei angefragt wurde")']
created_at DateTime [default: `now()`, not null]
updated_at DateTime [not null]
benutzer benutzer
rechnung_id Int [unique]
rechnung Rechnung
@@ -503,6 +505,8 @@ Table VerbrauchsausweisWohnen {
prueftext String [note: '@zod.describe("Durch den Kunden hinzugefügte Anmerkung zur Vorabprüfung")']
beschreibung String
kontrolldatei_angefragt Boolean [default: false, note: '@zod.describe("Ob bei der Anfrage der Registriernummer eine Kontrolldatei angefragt wurde")']
created_at DateTime [default: `now()`, not null]
updated_at DateTime [not null]
benutzer benutzer
rechnung_id Int [unique]
rechnung Rechnung

View File

@@ -0,0 +1,49 @@
-- AlterTable
ALTER TABLE "Anteilshaber" ALTER COLUMN "uid" SET DEFAULT 'ant-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Aufnahme" ALTER COLUMN "uid" SET DEFAULT 'auf-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'bag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'baw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Bild" ALTER COLUMN "uid" SET DEFAULT 'img-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Event" ALTER COLUMN "uid" SET DEFAULT 'evt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGEinpreisung" ALTER COLUMN "uid" SET DEFAULT 'gge-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Objekt" ALTER COLUMN "uid" SET DEFAULT 'obj-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Rechnung" ALTER COLUMN "uid" SET DEFAULT 'inv-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Tickets" ALTER COLUMN "uid" SET DEFAULT 'tkt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Unterlage" ALTER COLUMN "uid" SET DEFAULT 'pln-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -0,0 +1,48 @@
-- AlterTable
ALTER TABLE "Anteilshaber" ALTER COLUMN "uid" SET DEFAULT 'ant-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Aufnahme" ALTER COLUMN "uid" SET DEFAULT 'auf-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'bag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'baw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Bild" ALTER COLUMN "uid" SET DEFAULT 'img-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Event" ALTER COLUMN "uid" SET DEFAULT 'evt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGEinpreisung" ALTER COLUMN "uid" SET DEFAULT 'gge-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Objekt" ALTER COLUMN "uid" SET DEFAULT 'obj-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Rechnung" ALTER COLUMN "uid" SET DEFAULT 'inv-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Tickets" ALTER COLUMN "uid" SET DEFAULT 'tkt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Unterlage" ALTER COLUMN "uid" SET DEFAULT 'pln-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid(),
ALTER COLUMN "updated_at" DROP DEFAULT;
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -0,0 +1,49 @@
-- AlterTable
ALTER TABLE "Anteilshaber" ALTER COLUMN "uid" SET DEFAULT 'ant-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Aufnahme" ALTER COLUMN "uid" SET DEFAULT 'auf-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'bag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'baw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Bild" ALTER COLUMN "uid" SET DEFAULT 'img-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Event" ALTER COLUMN "uid" SET DEFAULT 'evt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGEinpreisung" ALTER COLUMN "uid" SET DEFAULT 'gge-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Objekt" ALTER COLUMN "uid" SET DEFAULT 'obj-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Rechnung" ALTER COLUMN "uid" SET DEFAULT 'inv-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Tickets" ALTER COLUMN "uid" SET DEFAULT 'tkt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Unterlage" ALTER COLUMN "uid" SET DEFAULT 'pln-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -0,0 +1,48 @@
-- AlterTable
ALTER TABLE "Anteilshaber" ALTER COLUMN "uid" SET DEFAULT 'ant-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Aufnahme" ALTER COLUMN "uid" SET DEFAULT 'auf-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'bag-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "BedarfsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'baw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Bild" ALTER COLUMN "uid" SET DEFAULT 'img-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Event" ALTER COLUMN "uid" SET DEFAULT 'evt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGEinpreisung" ALTER COLUMN "uid" SET DEFAULT 'gge-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "GEGNachweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Objekt" ALTER COLUMN "uid" SET DEFAULT 'obj-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Rechnung" ALTER COLUMN "uid" SET DEFAULT 'inv-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Tickets" ALTER COLUMN "uid" SET DEFAULT 'tkt-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "Unterlage" ALTER COLUMN "uid" SET DEFAULT 'pln-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "VerbrauchsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid(),
ALTER COLUMN "updated_at" DROP DEFAULT;
-- AlterTable
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
-- AlterTable
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();

View File

@@ -62,6 +62,9 @@ model VerbrauchsausweisGewerbe {
/// @zod.describe("Ob bei der Anfrage der Registriernummer eine Kontrolldatei angefragt wurde")
kontrolldatei_angefragt Boolean? @default(false)
created_at DateTime @default(now())
updated_at DateTime @updatedAt
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)

View File

@@ -66,6 +66,9 @@ model VerbrauchsausweisWohnen {
/// @zod.describe("Ob bei der Anfrage der Registriernummer eine Kontrolldatei angefragt wurde")
kontrolldatei_angefragt Boolean? @default(false)
created_at DateTime @default(now())
updated_at DateTime @updatedAt
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
rechnung_id Int? @unique

View File

@@ -12,10 +12,10 @@ export const createCaller = createCallerFactory({
"admin/post-ausstellen": await import("../src/pages/api/admin/post-ausstellen.ts"),
"admin/registriernummer": await import("../src/pages/api/admin/registriernummer.ts"),
"admin/stornieren": await import("../src/pages/api/admin/stornieren.ts"),
"aufnahme": await import("../src/pages/api/aufnahme/index.ts"),
"ausweise": await import("../src/pages/api/ausweise/index.ts"),
"aufnahme": await import("../src/pages/api/aufnahme/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/passwort-vergessen": await import("../src/pages/api/auth/passwort-vergessen.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"),

View File

@@ -47,6 +47,8 @@ export const VerbrauchsausweisGewerbeSchema = z.object({
prueftext: z.string().describe("Durch den Kunden hinzugefügte Anmerkung zur Vorabprüfung").nullish(),
beschreibung: z.string().nullish(),
kontrolldatei_angefragt: z.boolean().describe("Ob bei der Anfrage der Registriernummer eine Kontrolldatei angefragt wurde").nullish(),
created_at: z.date(),
updated_at: z.date(),
rechnung_id: z.number().int().nullish(),
aufnahme_id: z.number().int().describe("ID der korrespondierenden Gebäudeaufnahme"),
})

View File

@@ -34,6 +34,8 @@ export const VerbrauchsausweisWohnenSchema = z.object({
prueftext: z.string().describe("Durch den Kunden hinzugefügte Anmerkung zur Vorabprüfung").nullish(),
beschreibung: z.string().nullish(),
kontrolldatei_angefragt: z.boolean().describe("Ob bei der Anfrage der Registriernummer eine Kontrolldatei angefragt wurde").nullish(),
created_at: z.date(),
updated_at: z.date(),
rechnung_id: z.number().int().nullish(),
aufnahme_id: z.number().int().describe("ID der korrespondierenden Gebäudeaufnahme"),
})

View File

@@ -0,0 +1,48 @@
import { transport } from "#lib/mail.js";
import {
BedarfsausweisGewerbe,
Benutzer,
GEGNachweisGewerbe,
GEGNachweisWohnen,
} from "#lib/client/prisma.js";
export async function sendGEGAnforderungsMail(
nachweis: GEGNachweisWohnen | GEGNachweisGewerbe | BedarfsausweisGewerbe,
user: Benutzer,
) {
await transport.sendMail({
from: `"IBCornelsen" <info@online-energieausweis.org>`,
to: user.email,
subject: `GEG Nachweis angefordert beim IBCornelsen (ID: ${nachweis.id})`,
cc: {
address: user.email || "",
name: user.name || "",
},
bcc: "info@online-energieausweis.org",
html: `<p>Sehr geehrte/r ${user.vorname} ${user.name},
<br>
<br>
Sie haben einen GEG Nachweis bei uns angefordert.</p>
<p>
Mit freundlichen Grüßen,
<br>
Dipl.-Ing. Jens Cornelsen
<br>
<br>
<strong>IB Cornelsen</strong>
<br>
Katendeich 5A
<br>
21035 Hamburg
<br>
www.online-energieausweis.org
<br>
<br>
fon 040 · 209339850
<br>
fax 040 · 209339859
</p>`,
});
}

View File

@@ -2,7 +2,7 @@ import { transport } from "#lib/mail.js";
import {
Benutzer,
GEGNachweisWohnen,
} from "#lib/client/prisma";
} from "#lib/client/prisma.js";
export async function sendGEGBestellungsMail(
nachweis: GEGNachweisWohnen,

View File

@@ -11,12 +11,14 @@
async function sendPasswordMail(e: SubmitEvent) {
e.preventDefault()
try {
const response = await api.auth["forgot-password"].GET.fetch({
sent = true
const response = await api.auth["passwort-vergessen"].GET.fetch({
email
})
showEmailSuccess = true;
} catch (e) {
sent = false;
addNotification({
message: "Ups...",
subtext: "Da ist wohl etwas schiefgelaufen... Bitte versuchen sie es erneut, falls das Problem weiterhin bestehen sollte melden sie sich bei unserem Support damit wir ihnen helfen können.",
@@ -28,6 +30,7 @@
}
let showEmailSuccess = false;
let sent = false;
</script>
<div class="mx-auto w-1/3 bg-base-200 p-8 border border-base-300 rounded-lg">
@@ -48,7 +51,7 @@
<span class="font-semibold">Falls sie ein Konto bei uns haben wurde eine Email an sie verschickt.</span>
</div>
{/if}
<button type="submit" class="button"
<button type="submit" class="button" disabled={sent}
>Email zum Zurücksetzen des Passworts senden.</button
>
{#if showEmailSuccess}

View File

@@ -14,7 +14,7 @@
e.preventDefault()
try {
disabled = true
await api.auth["forgot-password"].POST.fetch({
await api.auth["passwort-vergessen"].POST.fetch({
passwort,
token
})

View File

@@ -52,73 +52,37 @@
const ausweisart = Enums.Ausweisart.VerbrauchsausweisGewerbe
const anliegen = "Energieausweis erstellen";
if (Object.keys(ausweis).length === 0) {
const localStorageAusweis = localStorage.getItem("ausweis");
if (moment(localStorage.getItem("verbrauchsausweis-gewerbe.updated_at") || new Date()).isAfter(ausweis.updated_at)) {
const localStorageAusweis = localStorage.getItem("verbrauchsausweis-gewerbe.ausweis");
if (localStorageAusweis) {
ausweis = JSON.parse(localStorageAusweis)
}
}
if (Object.keys(aufnahme).length === 0) {
const localStorageAufnahme = localStorage.getItem("aufnahme");
const localStorageAufnahme = localStorage.getItem("verbrauchsausweis-gewerbe.aufnahme");
if (localStorageAufnahme) {
aufnahme = JSON.parse(localStorageAufnahme)
}
}
if (Object.keys(objekt).length === 0) {
const localStorageObjekt = localStorage.getItem("objekt");
const localStorageObjekt = localStorage.getItem("verbrauchsausweis-gewerbe.objekt");
if (localStorageObjekt) {
objekt = JSON.parse(localStorageObjekt)
}
}
if (Object.keys(bilder).length === 0) {
const localStorageBilder = localStorage.getItem("bilder");
const localStorageBilder = localStorage.getItem("verbrauchsausweis-gewerbe.bilder");
if (localStorageBilder) {
bilder = JSON.parse(localStorageBilder)
}
}
function automatischAusfüllen() {
aufnahme.baujahr_gebaeude = [1952];
aufnahme.baujahr_heizung = [1952];
aufnahme.saniert = true;
aufnahme.einheiten = 1;
aufnahme.gebaeudetyp = "Polizeidienstgebäude";
aufnahme.keller =
Enums.Heizungsstatus.NICHT_VORHANDEN;
aufnahme.dachgeschoss =
Enums.Heizungsstatus.NICHT_VORHANDEN;
aufnahme.lueftung = "Fensterlueftung";
aufnahme.kuehlung = "1";
ausweis.ausstellgrund = "Vermietung";
ausweis.verbrauch_1 = 15000;
ausweis.verbrauch_2 = 14000;
ausweis.verbrauch_3 = 16000;
aufnahme.flaeche = 152;
aufnahme.nutzflaeche = 172;
ausweis.keller_beheizt = true;
aufnahme.brennstoff_1 = "Erdgas H";
ausweis.einheit_1 = "kWh";
ausweis.anteil_warmwasser_1 = 18;
ausweis.startdatum = moment("01.01.2021").toDate();
objekt.plz = "21039";
objekt.ort = "Hamburg";
objekt.adresse = "Curslacker Deich 170";
aufnahme.gebaeudeteil = "Gesamtgebäude";
objekt = objekt;
ausweis = ausweis;
}
let waitOverlayHidden = true;
let speichernOverlayHidden = true;
$: {
localStorage.setItem("ausweis", JSON.stringify(ausweis))
localStorage.setItem("aufnahme", JSON.stringify(aufnahme))
localStorage.setItem("objekt", JSON.stringify(objekt))
localStorage.setItem("bilder", JSON.stringify(bilder))
localStorage.setItem("verbrauchsausweis-gewerbe.ausweis", JSON.stringify(ausweis))
localStorage.setItem("verbrauchsausweis-gewerbe.aufnahme", JSON.stringify(aufnahme))
localStorage.setItem("verbrauchsausweis-gewerbe.objekt", JSON.stringify(objekt))
localStorage.setItem("verbrauchsausweis-gewerbe.bilder", JSON.stringify(bilder))
localStorage.setItem("verbrauchsausweis-gewerbe.updated_at", moment().toString())
}
let form: HTMLFormElement;

View File

@@ -1,7 +1,6 @@
<script lang="ts">
import PerformanceScore from "#components/Ausweis/PerformanceScore.svelte";
import Progressbar from "#components/Ausweis/Progressbar.svelte";
import { PRICES } from "#lib/constants.js";
import Bereich from "#components/labels/Bereich.svelte";
@@ -11,7 +10,6 @@
import Warmwasseranteil from "#components/Ausweis/Warmwasseranteil.svelte";
import Verbrauch from "#components/Ausweis/Verbrauch.svelte";
import moment from "moment";
import LueftungundLeerstand from "#components/Ausweis/LueftungundLeerstand.svelte";
import SanierungszustandHeizungsanlage from "#components/Ausweis/SanierungszustandHeizungsanlage.svelte";
@@ -50,85 +48,48 @@
AufnahmeClient,
} from "#components/Ausweis/types.js";
import { Enums } from "#lib/client/prisma.js";
import moment from "moment";
// TODO: Vom Server sollte ein volles Objekt kommen, dass alle Subobjekte enthält, weil es sonst zu Problemen führen kann
// wenn aufnahme oder objekt nicht existiert...
export let ausweis: VerbrauchsausweisWohnenClient;
export let objekt: ObjektClient
export let aufnahme: AufnahmeClient
export let user: BenutzerClient = {} as BenutzerClient;
export let bilder: UploadedGebaeudeBild[] = []
export let ausweistyp: Enums.AusweisTyp;
if (Object.keys(ausweis).length === 0) {
const localStorageAusweis = localStorage.getItem("ausweis");
export let user: BenutzerClient;
export let bilder: UploadedGebaeudeBild[];
export let ausweistyp: Enums.AusweisTyp;
if (moment(localStorage.getItem("verbrauchsausweis-wohnen.updated_at") || new Date()).isAfter(ausweis.updated_at)) {
const localStorageAusweis = localStorage.getItem("verbrauchsausweis-wohnen.ausweis");
if (localStorageAusweis) {
ausweis = JSON.parse(localStorageAusweis)
}
}
if (Object.keys(aufnahme).length === 0) {
const localStorageAufnahme = localStorage.getItem("aufnahme");
const localStorageAufnahme = localStorage.getItem("verbrauchsausweis-wohnen.aufnahme");
if (localStorageAufnahme) {
aufnahme = JSON.parse(localStorageAufnahme)
}
}
if (Object.keys(objekt).length === 0) {
const localStorageObjekt = localStorage.getItem("objekt");
const localStorageObjekt = localStorage.getItem("verbrauchsausweis-wohnen.objekt");
if (localStorageObjekt) {
objekt = JSON.parse(localStorageObjekt)
}
}
if (Object.keys(bilder).length === 0) {
const localStorageBilder = localStorage.getItem("bilder");
const localStorageBilder = localStorage.getItem("verbrauchsausweis-wohnen.bilder");
if (localStorageBilder) {
bilder = JSON.parse(localStorageBilder)
}
}
function automatischAusfüllen() {
aufnahme.baujahr_gebaeude = [1962];
aufnahme.baujahr_heizung = [1952];
aufnahme.saniert = true;
aufnahme.einheiten = 1;
aufnahme.gebaeudetyp = "Einfamilienhaus";
aufnahme.keller =
Enums.Heizungsstatus.NICHT_VORHANDEN;
aufnahme.dachgeschoss =
Enums.Heizungsstatus.NICHT_VORHANDEN;
aufnahme.lueftung = "Fensterlueftung";
aufnahme.kuehlung = "1";
ausweis.ausstellgrund = "Vermietung";
ausweis.verbrauch_1 = 15000;
ausweis.verbrauch_2 = 14000;
ausweis.verbrauch_3 = 16000;
aufnahme.flaeche = 152;
aufnahme.nutzflaeche = 172;
ausweis.keller_beheizt = true;
aufnahme.brennstoff_1 = "Erdgas H";
ausweis.einheit_1 = "kWh";
ausweis.anteil_warmwasser_1 = 18;
ausweis.startdatum = moment("01.01.2021").toDate();
objekt.plz = "21039";
objekt.ort = "Hamburg";
objekt.adresse = "Curslacker Deich 170";
aufnahme.gebaeudeteil = "Gesamtgebäude";
objekt = objekt;
ausweis = ausweis;
}
let waitOverlayHidden = true;
let speichernOverlayHidden = true;
$: {
localStorage.setItem("ausweis", JSON.stringify(ausweis))
localStorage.setItem("aufnahme", JSON.stringify(aufnahme))
localStorage.setItem("objekt", JSON.stringify(objekt))
localStorage.setItem("bilder", JSON.stringify(bilder))
localStorage.setItem("verbrauchsausweis-wohnen.ausweis", JSON.stringify(ausweis))
localStorage.setItem("verbrauchsausweis-wohnen.aufnahme", JSON.stringify(aufnahme))
localStorage.setItem("verbrauchsausweis-wohnen.objekt", JSON.stringify(objekt))
localStorage.setItem("verbrauchsausweis-wohnen.bilder", JSON.stringify(bilder))
localStorage.setItem("verbrauchsausweis-wohnen.updated_at", moment().toString())
}
$: {

View File

@@ -1,7 +1,7 @@
import { APIError, defineApiRoute } from "astro-typesafe-api/server";
import { z } from "zod";
import * as nodemailer from "nodemailer"
import { prisma } from "#lib/server/prisma";
import { prisma } from "#lib/server/prisma.js";
import { decodeToken, encodeToken } from "#lib/auth/token.js";
import { TokenType } from "#lib/auth/types.js";
import { hashPassword } from "#lib/password.js";

View File

@@ -1,8 +1,10 @@
import { getAusweisartFromUUID, UUidWithPrefix } from "#components/Ausweis/types.js";
import { omit } from "#lib/helpers.js";
import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js";
import { Enums, GEGEinpreisungSchema, prisma } from "#lib/server/prisma";
import { sendGEGAnforderungsMail } from "#lib/server/mail/geg-anfordern.js";
import { Enums, prisma } from "#lib/server/prisma.js";
import { APIError, defineApiRoute } from "astro-typesafe-api/server";
import { GEGEinpreisungSchema } from "src/generated/zod/gegeinpreisung.js";
import { z } from "zod";
export const PUT = defineApiRoute({
@@ -51,13 +53,15 @@ export const PUT = defineApiRoute({
}
}
})
} else {
await sendGEGAnforderungsMail(nachweis, user)
} else {
throw new APIError({
"code": "BAD_REQUEST",
"message": `Ausweisart wird nicht unterstützt: ${ausweisart}`
})
}
return {

View File

@@ -17,7 +17,8 @@ export const PUT = defineApiRoute({
id: true,
benutzer_id: true,
uid: true,
aufnahme_id: true
aufnahme_id: true,
rechnung_id: true
}).merge(z.object({
startdatum: z.coerce.date()
})),
@@ -110,12 +111,7 @@ export const GET = defineApiRoute({
benutzer: true,
aufnahme: {
include: {
objekt: {
include: {
bilder: true,
},
},
rechnungen: true,
bilder: true,
events: {
include: {
benutzer: {

View File

@@ -11,7 +11,10 @@ export const PATCH = defineApiRoute({
uid: true,
id: true,
benutzer_id: true,
aufnahme_id: true
aufnahme_id: true,
rechnung_id: true,
created_at: true,
updated_at: true
}).merge(z.object({
startdatum: z.coerce.date()
})),

View File

@@ -1,7 +1,8 @@
import { UUidWithPrefix } from "#components/Ausweis/types.js";
import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js";
import { prisma, VerbrauchsausweisWohnenSchema } from "#lib/server/prisma";
import { prisma } from "#lib/server/prisma.js";
import { APIError, defineApiRoute } from "astro-typesafe-api/server";
import { VerbrauchsausweisWohnenSchema } from "src/generated/zod/verbrauchsausweiswohnen.js";
import { z } from "zod";
export const PATCH = defineApiRoute({
@@ -22,7 +23,10 @@ export const PUT = defineApiRoute({
id: true,
benutzer_id: true,
uid: true,
aufnahme_id: true
aufnahme_id: true,
rechnung_id: true,
created_at: true,
updated_at: true
}),
uid_aufnahme: UUidWithPrefix
}),
@@ -113,12 +117,7 @@ export const GET = defineApiRoute({
benutzer: true,
aufnahme: {
include: {
objekt: {
include: {
bilder: true,
},
},
rechnungen: true,
bilder: true,
events: {
include: {
benutzer: {

View File

@@ -2,28 +2,28 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,400&display=swap');*/
@font-face {
font-family: 'Heron';
font-family: "Heron";
font-weight: 400;
font-style: normal;
font-display:swap;
src: url("/fonts/HeronSans-Light.woff2") format('woff2');
}
font-display: swap;
src: url("/fonts/HeronSans-Light.woff2") format("woff2");
}
@font-face {
font-family: 'Heron';
font-family: "Heron";
font-weight: 700;
font-style: normal;
font-display:swap;
src: url("/fonts/HeronSans-Regular.woff2") format('woff2');
}
font-display: swap;
src: url("/fonts/HeronSans-Regular.woff2") format("woff2");
}
@font-face {
font-family: 'Antique Olive Compact bold';
@font-face {
font-family: "Antique Olive Compact bold";
font-weight: 700;
font-style: normal;
font-display:swap;
src: url("/fonts/Antique Olive Std Compact.woff2") format('woff2');
}
font-display: swap;
src: url("/fonts/Antique Olive Std Compact.woff2") format("woff2");
}
* {
font-weight: 400;
@@ -31,48 +31,72 @@
font-family: "Heron";
}
.promo{
font-weight: 700;
box-sizing: border-box;
font-family: "Antique Olive Compact bold";
color:#222222;
.promo {
font-weight: 700;
box-sizing: border-box;
font-family: "Antique Olive Compact bold";
color: #222222;
}
body{
@apply bg-[#efefef] min-w-[320px]
body {
@apply bg-[#efefef] min-w-[320px];
}
main{
main {
@apply bg-[url('/images/pattern.png')] bg-repeat bg-fixed max-w-[1920px] mx-auto border-gray-200 border-[1px] min-w-[320px];
}
.button {
@apply w-full sm:w-min h-[38px] px-4 py-2 bg-secondary ring-2 ring-secondary/25 rounded-none xs:rounded-md text-white text-nowrap
hover:bg-gradient-to-br from-secondary to-secondary-grad hover:shadow-lg transition-all hover:no-underline hover:ring-2 hover:ring-primary
@apply w-full sm:w-min h-[38px] px-4 py-2 bg-secondary ring-2 ring-secondary/25 rounded-none xs:rounded-md text-white text-nowrap transition-all;
}
input, select, textarea{
.button:not([disabled]):hover {
@apply bg-gradient-to-br from-secondary to-secondary-grad shadow-lg no-underline ring-2 ring-primary;
}
.button[disabled] {
@apply bg-gray-400;
}
.button[disabled]:hover {
@apply bg-gray-400;
}
input,
select,
textarea {
@apply py-1.5 px-2.5 w-full outline-none;
}
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="file"],
textarea,
select{
@apply p-1 min-h-[38px] ring-1 ring-black/15 rounded-sm;}
select {
@apply p-1 min-h-[38px] ring-1 ring-black/15 rounded-sm;
}
select option{font-family: "Heron", sans-serif !important;}
select, select option:disabled{@apply bg-white}
select option {
font-family: "Heron", sans-serif !important;
}
select,
select option:disabled {
@apply bg-white;
}
input[type="file"]{@apply pt-[4px]}
input[type="file"] {
@apply pt-[4px];
}
input[type="checkbox"],input[type="radio"]{@apply inline-block accent-secondary h-[13px]}
input[type="checkbox"],
input[type="radio"] {
@apply inline-block accent-secondary h-[13px];
}
input:disabled, input:read-only {
input:disabled,
input:read-only {
@apply lg:bg-gray-200 border-gray-500/15;
}
@@ -81,125 +105,177 @@ input:disabled, input:read-only {
article {
@apply w-full relative bg-white p-0 z-0 box rounded-tl-none sm:p-2 lg:p-12;
hr {@apply mb-4 mt-4 border-primary;}
hr {
@apply mb-4 mt-4 border-primary;
}
h1 {@apply pl-2 font-normal mb-2
h1 {
@apply pl-2 font-normal mb-2
[font-size:_clamp(24px,1.5vw,36px)] leading-7
sm:text-4xl;}
h2 {@apply pl-2 font-normal mb-2
sm:text-4xl;
}
h2 {
@apply pl-2 font-normal mb-2
[font-size:_clamp(24px,1.5vw,36px)] leading-7
sm:text-2xl;}
h3 {@apply pl-2 sm:pl-0 text-xl font-normal ml-1 mb-1;}
a {@apply text-blue-700 font-medium inline;}
sm:text-2xl;
}
h3 {
@apply pl-2 sm:pl-0 text-xl font-normal ml-1 mb-1;
}
p {@apply text-lg font-normal pl-2 pr-2 mb-4;}
li {@apply text-lg font-normal }
ul {@apply list-disc list-inside mb-4}
a {
@apply text-blue-700 font-medium inline;
}
p {
@apply text-lg font-normal pl-2 pr-2 mb-4;
}
li {
@apply text-lg font-normal;
}
ul {
@apply list-disc list-inside mb-4;
}
/*span {@apply text-secondary font-bold;}*/
}
/*SIDEBARS*/
/*BOXES*/
.box{
@apply rounded-lg
.box {
@apply rounded-lg
lg:shadow-box lg:ring-1 lg:ring-gray-300
xl:rounded-xl
xl:rounded-xl;
}
.card:not(:last-child){@apply mb-5}
.card{@apply bg-white px-6 py-4;
h2 {@apply w-full [font-size:_clamp(8px,1.25vw,16px)] font-bold text-box-heading leading-6 pb-1 mb-4 border-b-[1px] border-primary/35}
hr {@apply my-0}
p {@apply text-lg}
a {@apply text-lg}
.card:not(:last-child) {
@apply mb-5;
}
.card {
@apply bg-white px-6 py-4;
h2 {
@apply w-full [font-size:_clamp(8px,1.25vw,16px)] font-bold text-box-heading leading-6 pb-1 mb-4 border-b-[1px] border-primary/35;
}
hr {
@apply my-0;
}
p {
@apply text-lg;
}
a {
@apply text-lg;
}
}
/*SIDEBAR-LEFT*/
/*NAVIGATION*/
.nav-element{@apply relative block cursor-pointer}
.nav-element:not(:first-child){@apply border-gray-200 border-t-[1px]}
.no-dropdown, .no-dropdown:hover{@apply text-black no-underline}
.nav-element:hover > .nav-element-child{
@apply !bg-primary !text-white cursor-pointer
.nav-element {
@apply relative block cursor-pointer;
}
.nav-element:hover > .nav-element-child .no-dropdown{
@apply !bg-primary !text-white cursor-pointer
.nav-element:not(:first-child) {
@apply border-gray-200 border-t-[1px];
}
.nav-element:hover > .dropdown-content{
@apply lg:visible lg:opacity-100 lg:block lg:ml-[calc(100%+2px)]
.no-dropdown,
.no-dropdown:hover {
@apply text-black no-underline;
}
.nav-element:hover:first-child > .nav-element-child{
@apply !rounded-none
lg:!rounded-tl-xl lg:!rounded-tr-none
.nav-element:hover > .nav-element-child {
@apply !bg-primary !text-white cursor-pointer;
}
.nav-element:hover:last-child > .nav-element-child{
@apply !rounded-none
xl:!rounded-b-xl
.nav-element:hover > .nav-element-child .no-dropdown {
@apply !bg-primary !text-white cursor-pointer;
}
.nav-element-child{
@apply px-4 py-2 w-full justify-start text-sm bg-white flex !no-underline text-black
xl:text-lg
.nav-element:hover > .dropdown-content {
@apply lg:visible lg:opacity-100 lg:block lg:ml-[calc(100%+2px)];
}
.nav-element:hover:first-child > .nav-element-child {
@apply !rounded-none
lg:!rounded-tl-xl lg:!rounded-tr-none;
}
.dropdown-content{
@apply !relative z-[1] !p-0 !scale-100 hidden
.nav-element:hover:last-child > .nav-element-child {
@apply !rounded-none
xl:!rounded-b-xl;
}
.nav-element-child {
@apply px-4 py-2 w-full justify-start text-sm bg-white flex !no-underline text-black
xl:text-lg;
}
.dropdown-content {
@apply !relative z-[1] !p-0 !scale-100 hidden
lg:!absolute lg:min-w-max lg:p-2 lg:shadow-lg lg:!top-0 lg:ring-gray-300 lg:ring-1;
li {@apply text-sm bg-white flex
xl:text-lg}
li a {@apply w-full text-sm px-4 py-2 rounded-none no-underline hover:text-white hover:bg-gradient-to-br from-secondary to-secondary-grad
li {
@apply text-sm bg-white flex
xl:text-lg;
}
li a {
@apply w-full text-sm px-4 py-2 rounded-none no-underline hover:text-white hover:bg-gradient-to-br from-secondary to-secondary-grad
lg:px-4 bg-[#efefef] text-black lg:hover:bg-secondary
xl:text-lg}
xl:text-lg;
}
li:not(:first-child) {@apply !border-gray-200 !border-t-[1px]}
li:not(:first-child) {
@apply !border-gray-200 !border-t-[1px];
}
}
.verbrauchsausweis li:nth-child(6), .bedarfsausweis li:nth-child(6){
@apply !border-primary !border-t-[1px]
.verbrauchsausweis li:nth-child(6),
.bedarfsausweis li:nth-child(6) {
@apply !border-primary !border-t-[1px];
}
#hamburger{
#hamburger {
@apply my-1;
.burger {@apply w-6}
span {@apply block h-[4px] bg-white !transition-all}
span:nth-child(2) {@apply my-[3px]}
.burger {
@apply w-6;
}
span {
@apply block h-[4px] bg-white !transition-all;
}
span:nth-child(2) {
@apply my-[3px];
}
}
.hamburger-swing-0{@apply origin-left rotate-45 -translate-y-[1.5px] !transition-all duration-500}
.hamburger-swing-1{@apply origin-center opacity-0 !transition-all}
.hamburger-swing-2{@apply origin-left -rotate-45 translate-y-[1.5px] !transition-all duration-500}
.show-dropdown-content{@apply block !visible !opacity-100 lg:!invisible}
.dd-symbol{ @apply absolute right-[20px] rotate-0 transition-all duration-300 origin-center md:transition-none}
.dd-symbol-clone{ @apply absolute right-[20px] lg:text-primary}
.rotate-symbol{@apply rotate-[90deg] transition-all duration-300 origin-center lg:rotate-0 md:transition-none}
.hamburger-swing-0 {
@apply origin-left rotate-45 -translate-y-[1.5px] !transition-all duration-500;
}
.hamburger-swing-1 {
@apply origin-center opacity-0 !transition-all;
}
.hamburger-swing-2 {
@apply origin-left -rotate-45 translate-y-[1.5px] !transition-all duration-500;
}
.show-dropdown-content {
@apply block !visible !opacity-100 lg:!invisible;
}
.dd-symbol {
@apply absolute right-[20px] rotate-0 transition-all duration-300 origin-center md:transition-none;
}
.dd-symbol-clone {
@apply absolute right-[20px] lg:text-primary;
}
.rotate-symbol {
@apply rotate-[90deg] transition-all duration-300 origin-center lg:rotate-0 md:transition-none;
}
/*NAVIGATION-ANIMATION*/
/*SIDEBAR-RIGHT*/
/*FOOTER*/
/*FOOTER*/

View File

@@ -665,6 +665,7 @@ export function fakeVerbrauchsausweisGewerbe() {
anteil_warmwasser_2: undefined,
prueftext: undefined,
beschreibung: undefined,
updated_at: faker.date.anytime(),
};
}
export function fakeVerbrauchsausweisGewerbeComplete() {
@@ -714,6 +715,8 @@ export function fakeVerbrauchsausweisGewerbeComplete() {
prueftext: undefined,
beschreibung: undefined,
kontrolldatei_angefragt: false,
created_at: new Date(),
updated_at: faker.date.anytime(),
rechnung_id: undefined,
aufnahme_id: faker.number.int(),
};
@@ -744,6 +747,7 @@ export function fakeVerbrauchsausweisWohnen() {
anteil_warmwasser_2: undefined,
prueftext: undefined,
beschreibung: undefined,
updated_at: faker.date.anytime(),
};
}
export function fakeVerbrauchsausweisWohnenComplete() {
@@ -780,6 +784,8 @@ export function fakeVerbrauchsausweisWohnenComplete() {
prueftext: undefined,
beschreibung: undefined,
kontrolldatei_angefragt: false,
created_at: new Date(),
updated_at: faker.date.anytime(),
rechnung_id: undefined,
aufnahme_id: faker.number.int(),
};