Sie haben Hilfe zu diesem Ausweis angefordert. Sie werden innerhalb der nächsten 48 Stunden über die hinterlegte Telefonnummer vom IB Cornelsen kontaktiert.
- {:else if rechnung && rechnung.ausweistyp === Enums.AusweisTyp.Offline}
+ {:else if ausweis.ausweistyp === Enums.AusweisTyp.Offline}
Sie haben die offline Variant zu diesem Ausweis angefordert. Bitte übermitteln Sie uns die letzten drei Jahre der Energieabrechnungen Ihres Energieversorgers.
{:else}
Der Ausweis wurde von Ihnen freigegeben und befindet sich in Prüfung vom IB Cornelsen
`
- if (rechnung.ausweistyp === Enums.AusweisTyp.Beratung) {
+ if (ausweis.ausweistyp === Enums.AusweisTyp.Beratung) {
body = `
vielen Dank für Ihre Bestellung. Sie haben telefonische Beratung zu Ihrer online Eingabe angefordert.
Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und dann die offenen Fragen zu Ihrer Eingabe beantworten.
@@ -85,7 +85,7 @@ export function getPaymentInvoiceBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- } else if (rechnung.ausweistyp === Enums.AusweisTyp.Offline) {
+ } else if (ausweis.ausweistyp === Enums.AusweisTyp.Offline) {
body = `
vielen Dank für Ihre Bestellung. Sie haben unseren offline Service für Ihren Energieausweis angefordert.
Bitte antworten Sie auf diese E-Mail und schicken uns drei aktuelle Heizkostenabrechnungen Ihres Energieversorgers zu. Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und die Eingabe in Absprache mit Ihnen durchführen.
@@ -134,7 +134,7 @@ export function getPaymentInvoiceBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- if (rechnung.ausweistyp === Enums.AusweisTyp.Beratung) {
+ if (ausweis.ausweistyp === Enums.AusweisTyp.Beratung) {
body = `
vielen Dank für Ihre Bestellung. Sie haben telefonische Beratung zu Ihrer online Eingabe angefordert.
Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und dann die offenen Fragen zu Ihrer Eingabe beantworten.
@@ -158,7 +158,7 @@ export function getPaymentInvoiceBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- } else if (rechnung.ausweistyp === Enums.AusweisTyp.Offline) {
+ } else if (ausweis.ausweistyp === Enums.AusweisTyp.Offline) {
body = `
vielen Dank für Ihre Bestellung. Sie haben unseren offline Service für Ihren Energieausweis angefordert.
Bitte antworten Sie auf diese E-Mail und schicken uns drei aktuelle Heizkostenabrechnungen Ihres Energieversorgers zu. Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und die Eingabe in Absprache mit Ihnen durchführen.
@@ -207,7 +207,7 @@ export function getPaymentInvoiceBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- if (rechnung.ausweistyp === Enums.AusweisTyp.Beratung) {
+ if (ausweis.ausweistyp === Enums.AusweisTyp.Beratung) {
body = `
vielen Dank für Ihre Bestellung. Sie haben telefonische Beratung zu Ihrer online Eingabe angefordert.
Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und dann die offenen Fragen zu Ihrer Eingabe beantworten.
@@ -231,7 +231,7 @@ export function getPaymentInvoiceBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- } else if (rechnung.ausweistyp === Enums.AusweisTyp.Offline) {
+ } else if (ausweis.ausweistyp === Enums.AusweisTyp.Offline) {
body = `
vielen Dank für Ihre Bestellung. Sie haben unseren offline Service für Ihren Energieausweis angefordert.
Bitte antworten Sie auf diese E-Mail und schicken uns Grundriss- und Ansichtspläne Ihres Gebäudes zu. Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und die Eingabe in Absprache mit Ihnen durchführen.
@@ -290,7 +290,7 @@ export function getPaymentSuccessBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- if (rechnung.ausweistyp === Enums.AusweisTyp.Beratung) {
+ if (ausweis.ausweistyp === Enums.AusweisTyp.Beratung) {
body = `
vielen Dank für Ihre Bestellung. Sie haben telefonische Beratung zu Ihrer online Eingabe angefordert.
Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und dann die offenen Fragen zu Ihrer Eingabe beantworten.
@@ -314,7 +314,7 @@ export function getPaymentSuccessBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- } else if (rechnung.ausweistyp === Enums.AusweisTyp.Offline) {
+ } else if (ausweis.ausweistyp === Enums.AusweisTyp.Offline) {
body = `
vielen Dank für Ihre Bestellung. Sie haben unseren offline Service für Ihren Energieausweis angefordert.
Bitte antworten Sie auf diese E-Mail und schicken uns drei aktuelle Heizkostenabrechnungen Ihres Energieversorgers zu. Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und die Eingabe in Absprache mit Ihnen durchführen.
@@ -363,7 +363,7 @@ export function getPaymentSuccessBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- if (rechnung.ausweistyp === Enums.AusweisTyp.Beratung) {
+ if (ausweis.ausweistyp === Enums.AusweisTyp.Beratung) {
body = `
vielen Dank für Ihre Bestellung. Sie haben telefonische Beratung zu Ihrer online Eingabe angefordert.
Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und dann die offenen Fragen zu Ihrer Eingabe beantworten.
@@ -387,7 +387,7 @@ export function getPaymentSuccessBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- } else if (rechnung.ausweistyp === Enums.AusweisTyp.Offline) {
+ } else if (ausweis.ausweistyp === Enums.AusweisTyp.Offline) {
body = `
vielen Dank für Ihre Bestellung. Sie haben unseren offline Service für Ihren Energieausweis angefordert.
Bitte antworten Sie auf diese E-Mail und schicken uns drei aktuelle Heizkostenabrechnungen Ihres Energieversorgers zu. Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und die Eingabe in Absprache mit Ihnen durchführen.
@@ -436,7 +436,7 @@ export function getPaymentSuccessBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- if (rechnung.ausweistyp === Enums.AusweisTyp.Beratung) {
+ if (ausweis.ausweistyp === Enums.AusweisTyp.Beratung) {
body = `
vielen Dank für Ihre Bestellung. Sie haben telefonische Beratung zu Ihrer online Eingabe angefordert.
Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und dann die offenen Fragen zu Ihrer Eingabe beantworten.
@@ -460,7 +460,7 @@ export function getPaymentSuccessBody(ausweis: VerbrauchsausweisWohnen | Verbrau
fax 040 · 209339859
`
- } else if (rechnung.ausweistyp === Enums.AusweisTyp.Offline) {
+ } else if (ausweis.ausweistyp === Enums.AusweisTyp.Offline) {
body = `
vielen Dank für Ihre Bestellung. Sie haben unseren offline Service für Ihren Energieausweis angefordert.
Bitte antworten Sie auf diese E-Mail und schicken uns Grundriss- und Ansichtspläne Ihres Gebäudes zu. Wir werden Sie innerhalb von 48 Stunden unter der von Ihnen hinterlegten Telefonnummer kontaktieren und die Eingabe in Absprache mit Ihnen durchführen.
- {#if ausweistyp === Enums.AusweisTyp.Standard}
+ {#if ausweis.ausweistyp === Enums.AusweisTyp.Standard}
Netto-Preis Energieausweis
- {:else if ausweistyp === Enums.AusweisTyp.Beratung}
+ {:else if ausweis.ausweistyp === Enums.AusweisTyp.Beratung}
Energieausweis inkl. Beratung
- {:else if ausweistyp === Enums.AusweisTyp.Offline}
+ {:else if ausweis.ausweistyp === Enums.AusweisTyp.Offline}
Energieausweis Offline
{/if}
:
diff --git a/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte b/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte
index 737df028..56fd8171 100644
--- a/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte
+++ b/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte
@@ -64,6 +64,7 @@
const localStorageAusweis = localStorage.getItem("verbrauchsausweis-wohnen.ausweis");
if (localStorageAusweis) {
ausweis = JSON.parse(localStorageAusweis)
+ ausweis.ausweistyp = ausweistyp;
}
const localStorageAufnahme = localStorage.getItem("verbrauchsausweis-wohnen.aufnahme");
diff --git a/src/pages/api/rechnung/index.ts b/src/pages/api/rechnung/index.ts
index 156a2606..81e4049e 100644
--- a/src/pages/api/rechnung/index.ts
+++ b/src/pages/api/rechnung/index.ts
@@ -25,7 +25,6 @@ export const PUT = defineApiRoute({
.object({
ausweisart: z.nativeEnum(Enums.Ausweisart),
ausweis_uid: UUidWithPrefix,
- ausweistyp: z.nativeEnum(Enums.AusweisTyp)
})
.merge(
RechnungSchema.omit({
@@ -50,13 +49,7 @@ export const PUT = defineApiRoute({
// Wir erstellen eine Mollie Payment Referenz und eine neue Rechnung in unserer Datenbank, daraufhin geben
// wir eine Checkout URL zurück auf die der Nutzer weitergeleitet werden kann.
- const { ausweis_uid, ausweisart, bezahlmethode, services, ausweistyp } = input;
- let betrag = PRICES[ausweisart][ausweistyp]
-
- const servicePriceList = SERVICES[ausweisart]
- for (const service of input.services) {
- betrag += servicePriceList[service]
- }
+ const { ausweis_uid, ausweisart, bezahlmethode, services } = input;
const adapter = getPrismaAusweisAdapter(ausweis_uid);
@@ -87,6 +80,13 @@ export const PUT = defineApiRoute({
});
}
+ let betrag = PRICES[ausweisart][ausweis.ausweistyp]
+
+ const servicePriceList = SERVICES[ausweisart]
+ for (const service of input.services) {
+ betrag += servicePriceList[service]
+ }
+
// Wir erstellen eine neue Rechnung in unserer Datenbank.
let rechnung: Rechnung | null = null;
if (ausweisart === Enums.Ausweisart.VerbrauchsausweisWohnen) {
@@ -102,7 +102,6 @@ export const PUT = defineApiRoute({
}
},
services,
- ausweistyp
}
});
} else if (ausweisart === Enums.Ausweisart.VerbrauchsausweisGewerbe) {
@@ -118,7 +117,6 @@ export const PUT = defineApiRoute({
}
},
services,
- ausweistyp
}
});
} else if (ausweisart === Enums.Ausweisart.BedarfsausweisWohnen) {
@@ -134,7 +132,6 @@ export const PUT = defineApiRoute({
}
},
services,
- ausweistyp
}
});
}
diff --git a/src/pages/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/index.astro b/src/pages/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/index.astro
index 89052740..1f13bb8c 100644
--- a/src/pages/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/index.astro
+++ b/src/pages/energieausweis-erstellen/verbrauchsausweis-wohngebaeude/index.astro
@@ -9,7 +9,7 @@ import { Enums } from "#lib/server/prisma";
const uid = Astro.url.searchParams.get("uid");
const uid_aufnahme = Astro.url.searchParams.get("aufnahme")
-const ausweistyp = Astro.url.searchParams.get("ausweistyp") || Enums.AusweisTyp.Standard;
+let ausweistyp = Astro.url.searchParams.get("ausweistyp") || Enums.AusweisTyp.Standard;
let ausweis: VerbrauchsausweisWohnenClient = {} as VerbrauchsausweisWohnenClient;
let aufnahme: AufnahmeClient = {} as AufnahmeClient;
@@ -37,6 +37,8 @@ if (uid) {
}
});
+ ausweistyp = ausweis.ausweistyp
+
aufnahme = await caller.aufnahme._uid.GET.fetch(null, {
headers: {
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
diff --git a/src/pages/kundendaten.astro b/src/pages/kundendaten.astro
index 8b51f13c..7e0382cc 100644
--- a/src/pages/kundendaten.astro
+++ b/src/pages/kundendaten.astro
@@ -16,16 +16,15 @@ if (!params.has("ausweis") || !params.has("aufnahme") || !params.has("objekt") |
return Astro.redirect("/404")
}
-let ausweis, aufnahme, objekt, ausweisart, bilder, ausweistyp;
+let ausweis, aufnahme, objekt, ausweisart, bilder;
try {
ausweis = JSON.parse(params.get("ausweis") || "")
aufnahme = JSON.parse(params.get("aufnahme") || "")
objekt = JSON.parse(params.get("objekt") || "")
ausweisart = JSON.parse(params.get("ausweisart") || "") as Enums.Ausweisart;
bilder = JSON.parse(params.get("bilder") || "");
- ausweistyp = JSON.parse(params.get("ausweistyp") || "") as Enums.AusweisTyp;
- if (!ausweisart || !Object.keys(Enums.Ausweisart).includes(ausweisart) || !ausweistyp || !Object.keys(Enums.AusweisTyp).includes(ausweistyp)) {
+ if (!ausweisart || !Object.keys(Enums.Ausweisart).includes(ausweisart)) {
throw new Error()
}
} catch(e){
@@ -35,6 +34,6 @@ try {
---
-
+
From 5d66eb10ca449c2b480e8ff3105e27ec5562861d Mon Sep 17 00:00:00 2001
From: Moritz Utcke
Date: Tue, 25 Mar 2025 14:01:13 -0300
Subject: [PATCH 3/9] Highlight und neue ID
---
bun.lock | 26 +
cypress.config.ts | 8 +-
package.json | 2 +
.../20250324210605_id/migration.sql | 573 ++++++++++++++++++
prisma/schema/Anteilshaber.prisma | 8 +-
prisma/schema/ApiRequests.prisma | 4 +-
prisma/schema/Aufnahme.prisma | 8 +-
prisma/schema/BedarfsausweisGewerbe.prisma | 11 +-
prisma/schema/BedarfsausweisWohnen.prisma | 9 +-
prisma/schema/Benutzer.prisma | 3 +-
prisma/schema/Bild.prisma | 5 +-
prisma/schema/Event.prisma | 7 +-
prisma/schema/GEGEinpreisung.prisma | 5 +-
prisma/schema/GEGNachweisGewerbe.prisma | 11 +-
prisma/schema/GEGNachweisWohnen.prisma | 11 +-
prisma/schema/Objekt.prisma | 5 +-
prisma/schema/Rechnung.prisma | 5 +-
prisma/schema/RefreshTokens.prisma | 2 +-
prisma/schema/Tickets.prisma | 7 +-
prisma/schema/Unterlage.prisma | 5 +-
prisma/schema/VerbrauchsausweisGewerbe.prisma | 9 +-
prisma/schema/VerbrauchsausweisWohnen.prisma | 13 +-
prisma/schema/documenttemplates.prisma | 2 +-
prisma/schema/tokens.prisma | 2 +-
prisma/seed.ts | 2 +
server.ts | 16 +
src/astro-typesafe-api-caller.ts | 28 +-
src/client/lib/ausweisSpeichern.ts | 73 +--
.../Ausweis/ButtonWeiterHilfe.svelte | 6 +-
src/components/Ausweis/types.ts | 62 +-
...ktUebersichtVerbrauchsausweisWohnen.svelte | 8 +-
.../VerbrauchsausweisGewerbe/erstellen.cy.ts | 93 ++-
.../VerbrauchsausweisWohnen/bearbeiten.cy.ts | 282 +++++++++
.../VerbrauchsausweisWohnen/erstellen.cy.ts | 2 +
src/generated/zod/anteilshaber.ts | 7 +-
src/generated/zod/apirequests.ts | 4 +-
src/generated/zod/aufnahme.ts | 7 +-
src/generated/zod/bedarfsausweisgewerbe.ts | 11 +-
src/generated/zod/bedarfsausweiswohnen.ts | 9 +-
src/generated/zod/benutzer.ts | 3 +-
src/generated/zod/bild.ts | 5 +-
src/generated/zod/documenttemplates.ts | 2 +-
src/generated/zod/event.ts | 7 +-
src/generated/zod/gegeinpreisung.ts | 5 +-
src/generated/zod/gegnachweisgewerbe.ts | 11 +-
src/generated/zod/gegnachweiswohnen.ts | 11 +-
src/generated/zod/index.ts | 46 +-
src/generated/zod/objekt.ts | 5 +-
src/generated/zod/rechnung.ts | 5 +-
src/generated/zod/refreshtokens.ts | 2 +-
src/generated/zod/tickets.ts | 7 +-
src/generated/zod/tokens.ts | 2 +-
src/generated/zod/unterlage.ts | 5 +-
src/generated/zod/verbrauchsausweisgewerbe.ts | 9 +-
src/generated/zod/verbrauchsausweiswohnen.ts | 9 +-
src/layouts/AusweisLayoutDaten.astro | 11 +
src/layouts/AusweisLayoutPruefung.astro | 13 +
src/layouts/BlankLayout.astro | 13 +
src/layouts/DashboardLayout.astro | 13 +
src/layouts/Layout.astro | 11 +
src/lib/auth/types.ts | 2 +-
src/lib/constants.ts | 33 +-
src/lib/db.ts | 37 ++
src/lib/middleware/authorization.ts | 2 +-
src/lib/server/ausweis.ts | 6 +-
src/modules/KundendatenModule.svelte | 30 +-
.../api/aufnahme/{[uid] => [id]}/bilder.ts | 20 +-
.../api/aufnahme/{[uid] => [id]}/index.ts | 26 +-
.../aufnahme/{[uid] => [id]}/unterlagen.ts | 19 +-
src/pages/api/aufnahme/index.ts | 16 +-
src/pages/api/auth/access-token.ts | 4 +-
src/pages/api/auth/refresh-token.ts | 8 +-
.../{[uid].ts => [id].ts} | 0
src/pages/api/bild.ts | 31 +-
src/pages/api/bilder/{[uid].ts => [id].ts} | 4 +-
src/pages/api/objekt/{[uid] => [id]}/index.ts | 14 +-
src/pages/api/objekt/index.ts | 14 +-
src/pages/api/rechnung/{[uid].ts => [id].ts} | 16 +-
src/pages/api/rechnung/index.ts | 37 +-
src/pages/api/unterlage.ts | 30 +-
src/pages/api/user/index.ts | 22 +-
.../{[uid].ts => [id].ts} | 50 +-
.../api/verbrauchsausweis-gewerbe/index.ts | 36 +-
.../{[uid].ts => [id].ts} | 48 +-
.../api/verbrauchsausweis-wohnen/index.ts | 35 +-
.../bilder/{[uid].jpg.ts => [id].jpg.ts} | 6 +-
src/pages/dashboard/aufnahme/index.astro | 113 ++++
src/pages/dashboard/objekte/[page].astro | 12 +-
.../index.astro | 34 +-
89 files changed, 1650 insertions(+), 601 deletions(-)
create mode 100644 prisma/migrations/20250324210605_id/migration.sql
create mode 100644 src/cypress/e2e/VerbrauchsausweisWohnen/bearbeiten.cy.ts
create mode 100644 src/lib/db.ts
rename src/pages/api/aufnahme/{[uid] => [id]}/bilder.ts (91%)
rename src/pages/api/aufnahme/{[uid] => [id]}/index.ts (85%)
rename src/pages/api/aufnahme/{[uid] => [id]}/unterlagen.ts (86%)
rename src/pages/api/bedarfsausweis-wohnen/{[uid].ts => [id].ts} (100%)
rename src/pages/api/bilder/{[uid].ts => [id].ts} (97%)
rename src/pages/api/objekt/{[uid] => [id]}/index.ts (89%)
rename src/pages/api/rechnung/{[uid].ts => [id].ts} (94%)
rename src/pages/api/verbrauchsausweis-gewerbe/{[uid].ts => [id].ts} (86%)
rename src/pages/api/verbrauchsausweis-wohnen/{[uid].ts => [id].ts} (87%)
rename src/pages/bilder/{[uid].jpg.ts => [id].jpg.ts} (84%)
create mode 100644 src/pages/dashboard/aufnahme/index.astro
diff --git a/bun.lock b/bun.lock
index 7f7da9ef..c53622c4 100644
--- a/bun.lock
+++ b/bun.lock
@@ -9,6 +9,7 @@
"@astrojs/svelte": "^2.2.0",
"@astrojs/tailwind": "^3.1.3",
"@aws-sdk/client-s3": "^3.758.0",
+ "@highlight-run/node": "^3.12.0",
"@ibcornelsen/ui": "^0.0.2",
"@mollie/api-client": "^4.1.0",
"@pdfme/common": "^5.2.16",
@@ -25,6 +26,7 @@
"express": "^4.21.2",
"flag-icons": "^6.15.0",
"fontkit": "^2.0.4",
+ "highlight.run": "^9.14.0",
"is-base64": "^1.1.0",
"js-cookie": "^3.0.5",
"js-interpolate": "^1.3.2",
@@ -346,6 +348,8 @@
"@hapi/bourne": ["@hapi/bourne@3.0.0", "", {}, "sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w=="],
+ "@highlight-run/node": ["@highlight-run/node@3.12.0", "", { "dependencies": { "@prisma/instrumentation": ">=5.0.0", "require-in-the-middle": "^7.4.0" } }, "sha512-wmvj8rf+p/JbUTfgsbhc5srP87sfZNofHTlXlaLI5JT8XpfRgBHXgSHWOw79l8dgncqceUkct1cN+liR5LdnKg=="],
+
"@humanwhocodes/config-array": ["@humanwhocodes/config-array@0.9.5", "", { "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", "minimatch": "^3.0.4" } }, "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw=="],
"@humanwhocodes/object-schema": ["@humanwhocodes/object-schema@1.2.1", "", {}, "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="],
@@ -416,6 +420,10 @@
"@opentelemetry/api": ["@opentelemetry/api@1.4.1", "", {}, "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA=="],
+ "@opentelemetry/api-logs": ["@opentelemetry/api-logs@0.57.2", "", { "dependencies": { "@opentelemetry/api": "^1.3.0" } }, "sha512-uIX52NnTM0iBh84MShlpouI7UKqkZ7MrUszTmaypHBu4r7NofznSnQRfJ+uUeDtQDj6w8eFGg5KBLDAwAPz1+A=="],
+
+ "@opentelemetry/instrumentation": ["@opentelemetry/instrumentation@0.57.2", "", { "dependencies": { "@opentelemetry/api-logs": "0.57.2", "@types/shimmer": "^1.2.0", "import-in-the-middle": "^1.8.1", "require-in-the-middle": "^7.1.1", "semver": "^7.5.2", "shimmer": "^1.2.1" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg=="],
+
"@oslojs/encoding": ["@oslojs/encoding@1.1.0", "", {}, "sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ=="],
"@oven/bun-darwin-aarch64": ["@oven/bun-darwin-aarch64@1.2.5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-ggZfdpgUJ/OiWrfcfTgHeSTHcec5HAjkGrZHL9FJ/R60sydRKPYHgAgexdIoJAGfsCVAL+x7y8NSTRIAX8J4Ng=="],
@@ -500,6 +508,8 @@
"@prisma/get-platform": ["@prisma/get-platform@6.4.1", "", { "dependencies": { "@prisma/debug": "6.4.1" } }, "sha512-gXqZaDI5scDkBF8oza7fOD3Q3QMD0e0rBynlzDDZdTWbWmzjuW58PRZtj+jkvKje2+ZigCWkH8SsWZAsH6q1Yw=="],
+ "@prisma/instrumentation": ["@prisma/instrumentation@6.5.0", "", { "dependencies": { "@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0" }, "peerDependencies": { "@opentelemetry/api": "^1.8" } }, "sha512-morJDtFRoAp5d/KENEm+K6Y3PQcn5bCvpJ5a9y3V3DNMrNy/ZSn2zulPGj+ld+Xj2UYVoaMJ8DpBX/o6iF6OiA=="],
+
"@prisma/internals": ["@prisma/internals@5.0.0", "", { "dependencies": { "@antfu/ni": "0.21.4", "@opentelemetry/api": "1.4.1", "@prisma/debug": "5.0.0", "@prisma/engines": "5.0.0", "@prisma/fetch-engine": "5.0.0", "@prisma/generator-helper": "5.0.0", "@prisma/get-platform": "5.0.0", "@prisma/prisma-schema-wasm": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584", "archiver": "5.3.1", "arg": "5.0.2", "checkpoint-client": "1.1.24", "cli-truncate": "2.1.0", "dotenv": "16.0.3", "escape-string-regexp": "4.0.0", "execa": "5.1.1", "find-up": "5.0.0", "fp-ts": "2.16.0", "fs-extra": "11.1.1", "fs-jetpack": "5.1.0", "global-dirs": "3.0.1", "globby": "11.1.0", "indent-string": "4.0.0", "is-windows": "1.0.2", "is-wsl": "2.2.0", "kleur": "4.1.5", "new-github-issue-url": "0.2.1", "node-fetch": "2.6.12", "npm-packlist": "5.1.3", "open": "7.4.2", "p-map": "4.0.0", "prompts": "2.4.2", "read-pkg-up": "7.0.1", "replace-string": "3.1.0", "resolve": "1.22.2", "string-width": "4.2.3", "strip-ansi": "6.0.1", "strip-indent": "3.0.0", "temp-dir": "2.0.0", "temp-write": "4.0.0", "tempy": "1.0.1", "terminal-link": "2.1.1", "tmp": "0.2.1", "ts-pattern": "4.3.0" } }, "sha512-VGWyFk6QlSBXT8z65Alq5F3o9E8IiTtaBoa3rmKkGpZjUk85kJy3jZz4xkRv53TaeghGE5rWfwkfak26KtY5yQ=="],
"@prisma/prisma-schema-wasm": ["@prisma/prisma-schema-wasm@4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584", "", {}, "sha512-JFdsnSgBPN8reDTLOI9Vh/6ccCb2aD1LbY/LWQnkcIgNo6IdpzvuM+qRVbBuA6IZP2SdqQI8Lu6RL2P8EFBQUA=="],
@@ -792,6 +802,8 @@
"@types/serve-static": ["@types/serve-static@1.15.7", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*", "@types/send": "*" } }, "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw=="],
+ "@types/shimmer": ["@types/shimmer@1.2.0", "", {}, "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg=="],
+
"@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=="],
@@ -834,6 +846,8 @@
"acorn": ["acorn@8.14.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA=="],
+ "acorn-import-attributes": ["acorn-import-attributes@1.9.5", "", { "peerDependencies": { "acorn": "^8" } }, "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ=="],
+
"acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],
"add-dom-event-listener": ["add-dom-event-listener@1.1.0", "", { "dependencies": { "object-assign": "4.x" } }, "sha512-WCxx1ixHT0GQU9hb0KI/mhgRQhnU+U3GvwY6ZvVjYq8rsihIGoaIOUbY0yMPBxLH5MDtr0kz3fisWGNcbWW7Jw=="],
@@ -1012,6 +1026,8 @@
"ci-info": ["ci-info@4.1.0", "", {}, "sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A=="],
+ "cjs-module-lexer": ["cjs-module-lexer@1.4.3", "", {}, "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q=="],
+
"classnames": ["classnames@2.5.1", "", {}, "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow=="],
"clean-stack": ["clean-stack@2.2.0", "", {}, "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A=="],
@@ -1470,6 +1486,8 @@
"hexoid": ["hexoid@2.0.0", "", {}, "sha512-qlspKUK7IlSQv2o+5I7yhUd7TxlOG2Vr5LTa3ve2XSNVKAL/n/u/7KLvKmFNimomDIKvZFXWHv0T12mv7rT8Aw=="],
+ "highlight.run": ["highlight.run@9.14.0", "", {}, "sha512-ZR+ZLHlVU8lXqsuto0ZEMAOuvptaTBBf1jradnKDIn9OfAXupcYFbkASDlbsZtyBh2SYJSK50xwrucXujhksRg=="],
+
"hosted-git-info": ["hosted-git-info@2.8.9", "", {}, "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw=="],
"hotkeys-js": ["hotkeys-js@3.13.9", "", {}, "sha512-3TRCj9u9KUH6cKo25w4KIdBfdBfNRjfUwrljCLDC2XhmPDG0SjAZFcFZekpUZFmXzfYoGhFDcdx2gX/vUVtztQ=="],
@@ -1504,6 +1522,8 @@
"import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="],
+ "import-in-the-middle": ["import-in-the-middle@1.13.1", "", { "dependencies": { "acorn": "^8.14.0", "acorn-import-attributes": "^1.9.5", "cjs-module-lexer": "^1.2.2", "module-details-from-path": "^1.0.3" } }, "sha512-k2V9wNm9B+ysuelDTHjI9d5KPc4l8zAZTGqj+pcynvWkypZd857ryzN8jNC7Pg2YZXNMJcHRPpaDyCBbNyVRpA=="],
+
"import-meta-resolve": ["import-meta-resolve@4.1.0", "", {}, "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw=="],
"imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],
@@ -1862,6 +1882,8 @@
"mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="],
+ "module-details-from-path": ["module-details-from-path@1.0.3", "", {}, "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A=="],
+
"moment": ["moment@2.30.1", "", {}, "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="],
"moment-timezone": ["moment-timezone@0.5.47", "", { "dependencies": { "moment": "^2.29.4" } }, "sha512-UbNt/JAWS0m/NJOebR0QMRHBk0hu03r5dx9GK8Cs0AS3I81yDcOc9k+DytPItgVvBP7J6Mf6U2n3BPAacAV9oA=="],
@@ -2246,6 +2268,8 @@
"request-progress": ["request-progress@3.0.0", "", { "dependencies": { "throttleit": "^1.0.0" } }, "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg=="],
+ "require-in-the-middle": ["require-in-the-middle@7.5.2", "", { "dependencies": { "debug": "^4.3.5", "module-details-from-path": "^1.0.3", "resolve": "^1.22.8" } }, "sha512-gAZ+kLqBdHarXB64XpAe2VCjB7rIRv+mU8tfRWziHRJ5umKsIHN2tLLv6EtMw7WCdP19S0ERVMldNvxYCHnhSQ=="],
+
"resize-observer-polyfill": ["resize-observer-polyfill@1.5.1", "", {}, "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="],
"resolve": ["resolve@1.22.10", "", { "dependencies": { "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w=="],
@@ -2326,6 +2350,8 @@
"shiki": ["shiki@1.29.2", "", { "dependencies": { "@shikijs/core": "1.29.2", "@shikijs/engine-javascript": "1.29.2", "@shikijs/engine-oniguruma": "1.29.2", "@shikijs/langs": "1.29.2", "@shikijs/themes": "1.29.2", "@shikijs/types": "1.29.2", "@shikijs/vscode-textmate": "^10.0.1", "@types/hast": "^3.0.4" } }, "sha512-njXuliz/cP+67jU2hukkxCNuH1yUi4QfdZZY+sMr5PPrIyXSu5iTb/qYC4BiWWB0vZ+7TbdvYUCeL23zpwCfbg=="],
+ "shimmer": ["shimmer@1.2.1", "", {}, "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw=="],
+
"side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="],
"side-channel-list": ["side-channel-list@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" } }, "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA=="],
diff --git a/cypress.config.ts b/cypress.config.ts
index d39cc165..0c24e21e 100644
--- a/cypress.config.ts
+++ b/cypress.config.ts
@@ -1,6 +1,6 @@
import { defineConfig } from "cypress";
import dsv from "@rollup/plugin-dsv"
-
+import { prisma } from "./src/lib/server/prisma"
import { fileURLToPath } from "url";
import vitePreprocessor from "cypress-vite";
@@ -18,6 +18,7 @@ export default defineConfig({
},
resolve: {
alias: {
+ ".prisma/client/index-browser": fileURLToPath(new URL("./node_modules/.prisma/client/index-browser.js", import.meta.url)),
"#": fileURLToPath(new URL("./src", import.meta.url)),
"#components": fileURLToPath(new URL("./src/components", import.meta.url)),
"#lib": fileURLToPath(new URL("./src/lib", import.meta.url))
@@ -31,6 +32,11 @@ export default defineConfig({
},
plugins: [dsv()]
}))
+ on("task", {
+ async verbrauchsausweisWohnen(query) {
+ return await prisma.verbrauchsausweisWohnen.findFirst(query)
+ }
+ })
},
},
component: {
diff --git a/package.json b/package.json
index f5206d3b..1e55d508 100644
--- a/package.json
+++ b/package.json
@@ -23,6 +23,7 @@
"@astrojs/svelte": "^2.2.0",
"@astrojs/tailwind": "^3.1.3",
"@aws-sdk/client-s3": "^3.758.0",
+ "@highlight-run/node": "^3.12.0",
"@ibcornelsen/ui": "^0.0.2",
"@mollie/api-client": "^4.1.0",
"@pdfme/common": "^5.2.16",
@@ -39,6 +40,7 @@
"express": "^4.21.2",
"flag-icons": "^6.15.0",
"fontkit": "^2.0.4",
+ "highlight.run": "^9.14.0",
"is-base64": "^1.1.0",
"js-cookie": "^3.0.5",
"js-interpolate": "^1.3.2",
diff --git a/prisma/migrations/20250324210605_id/migration.sql b/prisma/migrations/20250324210605_id/migration.sql
new file mode 100644
index 00000000..e4be4967
--- /dev/null
+++ b/prisma/migrations/20250324210605_id/migration.sql
@@ -0,0 +1,573 @@
+/*
+ Warnings:
+
+ - The primary key for the `Anteilshaber` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `Anteilshaber` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `Anteilshaber` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `ApiRequests` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to alter the column `id` on the `ApiRequests` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `Aufnahme` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `Aufnahme` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `Aufnahme` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `BedarfsausweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `BedarfsausweisGewerbe` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `BedarfsausweisGewerbe` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `BedarfsausweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `BedarfsausweisWohnen` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `BedarfsausweisWohnen` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `Bild` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to alter the column `id` on the `Bild` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `Event` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `Event` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `Event` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `GEGEinpreisung` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `GEGEinpreisung` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `GEGEinpreisung` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `GEGNachweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `GEGNachweisGewerbe` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `GEGNachweisGewerbe` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `GEGNachweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `GEGNachweisWohnen` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `GEGNachweisWohnen` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `Objekt` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `Objekt` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `Objekt` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `Rechnung` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `Rechnung` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `Rechnung` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `Tickets` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `Tickets` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `Tickets` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `Unterlage` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `Unterlage` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `Unterlage` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `VerbrauchsausweisGewerbe` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `VerbrauchsausweisGewerbe` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `VerbrauchsausweisGewerbe` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `VerbrauchsausweisWohnen` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `VerbrauchsausweisWohnen` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `VerbrauchsausweisWohnen` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - The primary key for the `benutzer` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to drop the column `uid` on the `benutzer` table. All the data in the column will be lost.
+ - You are about to alter the column `id` on the `benutzer` table. The data in that column could be lost. The data in that column will be cast from `Integer` to `VarChar(8)`.
+ - A unique constraint covering the columns `[id]` on the table `Anteilshaber` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `ApiRequests` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `Aufnahme` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `BedarfsausweisGewerbe` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `BedarfsausweisWohnen` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `Bild` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `Event` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `GEGEinpreisung` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `GEGNachweisGewerbe` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `GEGNachweisWohnen` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `Objekt` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `Rechnung` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `Tickets` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `Unterlage` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `VerbrauchsausweisGewerbe` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `VerbrauchsausweisWohnen` will be added. If there are existing duplicate values, this will fail.
+ - A unique constraint covering the columns `[id]` on the table `benutzer` will be added. If there are existing duplicate values, this will fail.
+
+*/
+-- DropForeignKey
+ALTER TABLE "Anteilshaber" DROP CONSTRAINT "Anteilshaber_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Anteilshaber" DROP CONSTRAINT "Anteilshaber_objekt_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "ApiRequests" DROP CONSTRAINT "ApiRequests_user_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Aufnahme" DROP CONSTRAINT "Aufnahme_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Aufnahme" DROP CONSTRAINT "Aufnahme_objekt_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_geg_einpreisung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_rechnung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_rechnung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Bild" DROP CONSTRAINT "Bild_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Event" DROP CONSTRAINT "Event_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Event" DROP CONSTRAINT "Event_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGEinpreisung" DROP CONSTRAINT "GEGEinpreisung_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_geg_einpreisung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_rechnung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_geg_einpreisung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_rechnung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Objekt" DROP CONSTRAINT "Objekt_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Rechnung" DROP CONSTRAINT "Rechnung_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "RefreshTokens" DROP CONSTRAINT "RefreshTokens_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Tickets" DROP CONSTRAINT "Tickets_bearbeiter_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Tickets" DROP CONSTRAINT "Tickets_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Unterlage" DROP CONSTRAINT "Unterlage_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_rechnung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_aufnahme_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_benutzer_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_rechnung_id_fkey";
+
+-- DropForeignKey
+ALTER TABLE "documenttemplates" DROP CONSTRAINT "benutzer_fk";
+
+-- DropForeignKey
+ALTER TABLE "tokens" DROP CONSTRAINT "fk_benutzer_tokens_user_id";
+
+-- DropIndex
+DROP INDEX "Anteilshaber_uid_key";
+
+-- DropIndex
+DROP INDEX "Aufnahme_uid_key";
+
+-- DropIndex
+DROP INDEX "BedarfsausweisGewerbe_uid_key";
+
+-- DropIndex
+DROP INDEX "BedarfsausweisWohnen_uid_key";
+
+-- DropIndex
+DROP INDEX "Event_uid_key";
+
+-- DropIndex
+DROP INDEX "GEGEinpreisung_uid_key";
+
+-- DropIndex
+DROP INDEX "GEGNachweisGewerbe_uid_key";
+
+-- DropIndex
+DROP INDEX "GEGNachweisWohnen_uid_key";
+
+-- DropIndex
+DROP INDEX "Objekt_uid_key";
+
+-- DropIndex
+DROP INDEX "Rechnung_uid_key";
+
+-- DropIndex
+DROP INDEX "Tickets_uid_key";
+
+-- DropIndex
+DROP INDEX "Unterlage_uid_key";
+
+-- DropIndex
+DROP INDEX "VerbrauchsausweisGewerbe_uid_key";
+
+-- DropIndex
+DROP INDEX "VerbrauchsausweisWohnen_uid_key";
+
+-- DropIndex
+DROP INDEX "benutzer_uid_key";
+
+-- AlterTable
+ALTER TABLE "Anteilshaber" DROP CONSTRAINT "Anteilshaber_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "objekt_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "Anteilshaber_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "Anteilshaber_id_seq";
+
+-- AlterTable
+ALTER TABLE "ApiRequests" DROP CONSTRAINT "ApiRequests_pkey",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "user_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "ApiRequests_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "ApiRequests_id_seq";
+
+-- AlterTable
+ALTER TABLE "Aufnahme" DROP CONSTRAINT "Aufnahme_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "objekt_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "Aufnahme_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "Aufnahme_id_seq";
+
+-- AlterTable
+ALTER TABLE "BedarfsausweisGewerbe" DROP CONSTRAINT "BedarfsausweisGewerbe_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
+ALTER COLUMN "geg_einpreisung_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "BedarfsausweisGewerbe_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "BedarfsausweisGewerbe_id_seq";
+
+-- AlterTable
+ALTER TABLE "BedarfsausweisWohnen" DROP CONSTRAINT "BedarfsausweisWohnen_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "BedarfsausweisWohnen_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "BedarfsausweisWohnen_id_seq";
+
+-- AlterTable
+ALTER TABLE "Bild" DROP CONSTRAINT "Bild_pkey",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "uid" SET DEFAULT 'img-' || gen_random_uuid(),
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "Bild_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "Bild_id_seq";
+
+-- AlterTable
+ALTER TABLE "Event" DROP CONSTRAINT "Event_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "Event_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "Event_id_seq";
+
+-- AlterTable
+ALTER TABLE "GEGEinpreisung" DROP CONSTRAINT "GEGEinpreisung_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "GEGEinpreisung_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "GEGEinpreisung_id_seq";
+
+-- AlterTable
+ALTER TABLE "GEGNachweisGewerbe" DROP CONSTRAINT "GEGNachweisGewerbe_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
+ALTER COLUMN "geg_einpreisung_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "GEGNachweisGewerbe_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "GEGNachweisGewerbe_id_seq";
+
+-- AlterTable
+ALTER TABLE "GEGNachweisWohnen" DROP CONSTRAINT "GEGNachweisWohnen_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
+ALTER COLUMN "geg_einpreisung_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "GEGNachweisWohnen_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "GEGNachweisWohnen_id_seq";
+
+-- AlterTable
+ALTER TABLE "Objekt" DROP CONSTRAINT "Objekt_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "Objekt_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "Objekt_id_seq";
+
+-- AlterTable
+ALTER TABLE "Rechnung" DROP CONSTRAINT "Rechnung_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "Rechnung_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "Rechnung_id_seq";
+
+-- AlterTable
+ALTER TABLE "RefreshTokens" ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT;
+
+-- AlterTable
+ALTER TABLE "Tickets" DROP CONSTRAINT "Tickets_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "bearbeiter_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "Tickets_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "Tickets_id_seq";
+
+-- AlterTable
+ALTER TABLE "Unterlage" DROP CONSTRAINT "Unterlage_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "Unterlage_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "Unterlage_id_seq";
+
+-- AlterTable
+ALTER TABLE "VerbrauchsausweisGewerbe" DROP CONSTRAINT "VerbrauchsausweisGewerbe_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "VerbrauchsausweisGewerbe_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "VerbrauchsausweisGewerbe_id_seq";
+
+-- AlterTable
+ALTER TABLE "VerbrauchsausweisWohnen" DROP CONSTRAINT "VerbrauchsausweisWohnen_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ALTER COLUMN "benutzer_id" SET DATA TYPE TEXT,
+ALTER COLUMN "rechnung_id" SET DATA TYPE TEXT,
+ALTER COLUMN "aufnahme_id" SET DATA TYPE TEXT,
+ADD CONSTRAINT "VerbrauchsausweisWohnen_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "VerbrauchsausweisWohnen_id_seq";
+
+-- AlterTable
+ALTER TABLE "benutzer" DROP CONSTRAINT "benutzer_pkey",
+DROP COLUMN "uid",
+ALTER COLUMN "id" DROP DEFAULT,
+ALTER COLUMN "id" SET DATA TYPE VARCHAR(8),
+ADD CONSTRAINT "benutzer_pkey" PRIMARY KEY ("id");
+DROP SEQUENCE "benutzer_id_seq";
+
+-- AlterTable
+ALTER TABLE "documenttemplates" ALTER COLUMN "user_id" SET DATA TYPE TEXT;
+
+-- AlterTable
+ALTER TABLE "tokens" ALTER COLUMN "user_id" SET DATA TYPE TEXT;
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Anteilshaber_id_key" ON "Anteilshaber"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "ApiRequests_id_key" ON "ApiRequests"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Aufnahme_id_key" ON "Aufnahme"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "BedarfsausweisGewerbe_id_key" ON "BedarfsausweisGewerbe"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "BedarfsausweisWohnen_id_key" ON "BedarfsausweisWohnen"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Bild_id_key" ON "Bild"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Event_id_key" ON "Event"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "GEGEinpreisung_id_key" ON "GEGEinpreisung"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "GEGNachweisGewerbe_id_key" ON "GEGNachweisGewerbe"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "GEGNachweisWohnen_id_key" ON "GEGNachweisWohnen"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Objekt_id_key" ON "Objekt"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Rechnung_id_key" ON "Rechnung"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Tickets_id_key" ON "Tickets"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Unterlage_id_key" ON "Unterlage"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "VerbrauchsausweisGewerbe_id_key" ON "VerbrauchsausweisGewerbe"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "VerbrauchsausweisWohnen_id_key" ON "VerbrauchsausweisWohnen"("id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "benutzer_id_key" ON "benutzer"("id");
+
+-- AddForeignKey
+ALTER TABLE "Anteilshaber" ADD CONSTRAINT "Anteilshaber_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "Anteilshaber" ADD CONSTRAINT "Anteilshaber_objekt_id_fkey" FOREIGN KEY ("objekt_id") REFERENCES "Objekt"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "ApiRequests" ADD CONSTRAINT "ApiRequests_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "Aufnahme" ADD CONSTRAINT "Aufnahme_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "Aufnahme" ADD CONSTRAINT "Aufnahme_objekt_id_fkey" FOREIGN KEY ("objekt_id") REFERENCES "Objekt"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "BedarfsausweisGewerbe" ADD CONSTRAINT "BedarfsausweisGewerbe_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "BedarfsausweisGewerbe" ADD CONSTRAINT "BedarfsausweisGewerbe_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "BedarfsausweisGewerbe" ADD CONSTRAINT "BedarfsausweisGewerbe_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "BedarfsausweisGewerbe" ADD CONSTRAINT "BedarfsausweisGewerbe_geg_einpreisung_id_fkey" FOREIGN KEY ("geg_einpreisung_id") REFERENCES "GEGEinpreisung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "BedarfsausweisWohnen" ADD CONSTRAINT "BedarfsausweisWohnen_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "BedarfsausweisWohnen" ADD CONSTRAINT "BedarfsausweisWohnen_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "BedarfsausweisWohnen" ADD CONSTRAINT "BedarfsausweisWohnen_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "Bild" ADD CONSTRAINT "Bild_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "Event" ADD CONSTRAINT "Event_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "Event" ADD CONSTRAINT "Event_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGEinpreisung" ADD CONSTRAINT "GEGEinpreisung_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGNachweisGewerbe" ADD CONSTRAINT "GEGNachweisGewerbe_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGNachweisGewerbe" ADD CONSTRAINT "GEGNachweisGewerbe_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGNachweisGewerbe" ADD CONSTRAINT "GEGNachweisGewerbe_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGNachweisGewerbe" ADD CONSTRAINT "GEGNachweisGewerbe_geg_einpreisung_id_fkey" FOREIGN KEY ("geg_einpreisung_id") REFERENCES "GEGEinpreisung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGNachweisWohnen" ADD CONSTRAINT "GEGNachweisWohnen_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGNachweisWohnen" ADD CONSTRAINT "GEGNachweisWohnen_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGNachweisWohnen" ADD CONSTRAINT "GEGNachweisWohnen_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "GEGNachweisWohnen" ADD CONSTRAINT "GEGNachweisWohnen_geg_einpreisung_id_fkey" FOREIGN KEY ("geg_einpreisung_id") REFERENCES "GEGEinpreisung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "Objekt" ADD CONSTRAINT "Objekt_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Rechnung" ADD CONSTRAINT "Rechnung_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "RefreshTokens" ADD CONSTRAINT "RefreshTokens_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Tickets" ADD CONSTRAINT "Tickets_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Tickets" ADD CONSTRAINT "Tickets_bearbeiter_id_fkey" FOREIGN KEY ("bearbeiter_id") REFERENCES "benutzer"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Unterlage" ADD CONSTRAINT "Unterlage_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "VerbrauchsausweisGewerbe" ADD CONSTRAINT "VerbrauchsausweisGewerbe_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "VerbrauchsausweisGewerbe" ADD CONSTRAINT "VerbrauchsausweisGewerbe_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "VerbrauchsausweisGewerbe" ADD CONSTRAINT "VerbrauchsausweisGewerbe_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "VerbrauchsausweisWohnen" ADD CONSTRAINT "VerbrauchsausweisWohnen_benutzer_id_fkey" FOREIGN KEY ("benutzer_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "VerbrauchsausweisWohnen" ADD CONSTRAINT "VerbrauchsausweisWohnen_rechnung_id_fkey" FOREIGN KEY ("rechnung_id") REFERENCES "Rechnung"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "VerbrauchsausweisWohnen" ADD CONSTRAINT "VerbrauchsausweisWohnen_aufnahme_id_fkey" FOREIGN KEY ("aufnahme_id") REFERENCES "Aufnahme"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
+
+-- AddForeignKey
+ALTER TABLE "documenttemplates" ADD CONSTRAINT "benutzer_fk" FOREIGN KEY ("user_id") REFERENCES "benutzer"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "tokens" ADD CONSTRAINT "fk_benutzer_tokens_user_id" FOREIGN KEY ("user_id") REFERENCES "benutzer"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
diff --git a/prisma/schema/Anteilshaber.prisma b/prisma/schema/Anteilshaber.prisma
index c20e48bd..a3542975 100644
--- a/prisma/schema/Anteilshaber.prisma
+++ b/prisma/schema/Anteilshaber.prisma
@@ -1,11 +1,11 @@
model Anteilshaber {
- id Int @id @default(autoincrement())
- benutzer_id Int
+ id String @id @unique @db.VarChar(8)
rolle String? @db.VarChar
privilegien BigInt?
- uid String @unique @default(dbgenerated("'ant-' || gen_random_uuid()"))
+
+ benutzer_id String
benutzer Benutzer @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- objekt_id Int
+ objekt_id String
objekt Objekt @relation(fields: [objekt_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
\ No newline at end of file
diff --git a/prisma/schema/ApiRequests.prisma b/prisma/schema/ApiRequests.prisma
index c8c253cf..1f61860e 100644
--- a/prisma/schema/ApiRequests.prisma
+++ b/prisma/schema/ApiRequests.prisma
@@ -1,6 +1,6 @@
model ApiRequests {
- id Int @id @default(autoincrement())
+ id String @id @unique @db.VarChar(8)
date DateTime @default(now()) @db.Timestamp(6)
ip String @db.VarChar(50)
method String @db.VarChar(10)
@@ -9,6 +9,6 @@ model ApiRequests {
responseTime Float
responseSize Int
userAgent String @db.VarChar(500)
- user_id Int?
+ user_id String?
user Benutzer? @relation(fields: [user_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
diff --git a/prisma/schema/Aufnahme.prisma b/prisma/schema/Aufnahme.prisma
index ba750f00..317d78c2 100644
--- a/prisma/schema/Aufnahme.prisma
+++ b/prisma/schema/Aufnahme.prisma
@@ -13,10 +13,8 @@ enum Lueftungskonzept {
}
model Aufnahme {
- id Int @id @default(autoincrement())
- /// @zod.describe("UID der Gebäude Aufnahme")
- uid String @unique @default(dbgenerated("'auf-' || gen_random_uuid()"))
- benutzer_id Int?
+ id String @id @unique @db.VarChar(8)
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
/// @zod.describe("Art des korrespondierenden Ausweises, wie z.B. VerbrauchsausweisWohnen")
ausweisart Ausweisart?
@@ -142,7 +140,7 @@ model Aufnahme {
geg_nachweise_gewerbe GEGNachweisGewerbe[]
bedarfsausweise_gewerbe BedarfsausweisGewerbe[]
- objekt_id Int
+ objekt_id String
objekt Objekt @relation(fields: [objekt_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
diff --git a/prisma/schema/BedarfsausweisGewerbe.prisma b/prisma/schema/BedarfsausweisGewerbe.prisma
index f904331e..d0c97158 100644
--- a/prisma/schema/BedarfsausweisGewerbe.prisma
+++ b/prisma/schema/BedarfsausweisGewerbe.prisma
@@ -1,6 +1,5 @@
model BedarfsausweisGewerbe {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'bag-' || gen_random_uuid()"))
+ id String @id @unique @db.VarChar(8)
/// @zod.describe("Ausstellgrund wie z.B. Vermietung oder Verkauf")
ausstellgrund Ausstellgrund?
@@ -27,13 +26,13 @@ model BedarfsausweisGewerbe {
klimatisierung Boolean? @default(false)
/// @zod.describe("Die ID des Benutzers, welchem dieser Ausweis gehört")
- benutzer_id Int?
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- aufnahme_id Int @unique
+ aufnahme_id String @unique
aufnahme Aufnahme @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- rechnung_id Int? @unique
+ rechnung_id String? @unique
rechnung Rechnung? @relation(fields: [rechnung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- geg_einpreisung_id Int? @unique
+ geg_einpreisung_id String? @unique
geg_einpreisung GEGEinpreisung? @relation(fields: [geg_einpreisung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
\ No newline at end of file
diff --git a/prisma/schema/BedarfsausweisWohnen.prisma b/prisma/schema/BedarfsausweisWohnen.prisma
index 0724094a..e2ce4f2a 100644
--- a/prisma/schema/BedarfsausweisWohnen.prisma
+++ b/prisma/schema/BedarfsausweisWohnen.prisma
@@ -1,9 +1,8 @@
model BedarfsausweisWohnen {
- id Int @id @default(autoincrement())
+ id String @id @unique @db.VarChar(8)
alte_ausweis_id Int?
- uid String @unique @default(dbgenerated("'baw-' || gen_random_uuid()"))
- benutzer_id Int?
+ benutzer_id String?
ausstellgrund Ausstellgrund?
registriernummer String? @db.VarChar
@@ -83,10 +82,10 @@ model BedarfsausweisWohnen {
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- rechnung_id Int? @unique
+ rechnung_id String? @unique
rechnung Rechnung? @relation(fields: [rechnung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
/// @zod.describe("ID der korrespondierenden Gebäudeaufnahme")
- aufnahme_id Int @unique
+ aufnahme_id String @unique
aufnahme Aufnahme @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
diff --git a/prisma/schema/Benutzer.prisma b/prisma/schema/Benutzer.prisma
index 2ed48f96..1ea65d80 100644
--- a/prisma/schema/Benutzer.prisma
+++ b/prisma/schema/Benutzer.prisma
@@ -5,8 +5,7 @@ enum BenutzerRolle {
}
model Benutzer {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'usr-' || gen_random_uuid()"))
+ id String @id @unique @db.VarChar(8)
name String? @db.VarChar(50)
vorname String? @db.VarChar(50)
email String @unique(map: "benutzer_email_idx") @db.VarChar(255)
diff --git a/prisma/schema/Bild.prisma b/prisma/schema/Bild.prisma
index 3c238907..284f380d 100644
--- a/prisma/schema/Bild.prisma
+++ b/prisma/schema/Bild.prisma
@@ -8,11 +8,10 @@ enum BilderKategorie {
}
model Bild {
- id Int @id @default(autoincrement())
+ id String @id @unique @db.VarChar(8)
kategorie BilderKategorie
- uid String @unique @default(dbgenerated("'img-' || gen_random_uuid()"))
name String
- aufnahme_id Int?
+ aufnahme_id String?
aufnahme Aufnahme? @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
\ No newline at end of file
diff --git a/prisma/schema/Event.prisma b/prisma/schema/Event.prisma
index 2203363d..f6ae0866 100644
--- a/prisma/schema/Event.prisma
+++ b/prisma/schema/Event.prisma
@@ -3,8 +3,7 @@
// Hier werden beispielsweise Events wie "Nachricht Verschickt" gespeichert.
// Diese Events werden dann in der Admin-Oberfläche angezeigt.
model Event {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'evt-' || gen_random_uuid()"))
+ id String @id @unique @db.VarChar(8)
date DateTime @default(now()) @db.Timestamp(6)
title String @db.VarChar(255)
@@ -12,9 +11,9 @@ model Event {
// Verlinkung des Gebäudes
- aufnahme_id Int
+ aufnahme_id String
aufnahme Aufnahme @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
// Verlinkung des Benutzers
- benutzer_id Int?
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
diff --git a/prisma/schema/GEGEinpreisung.prisma b/prisma/schema/GEGEinpreisung.prisma
index 14ef101a..a8c8ef58 100644
--- a/prisma/schema/GEGEinpreisung.prisma
+++ b/prisma/schema/GEGEinpreisung.prisma
@@ -6,8 +6,7 @@ enum Einpreisungsstatus {
}
model GEGEinpreisung {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'gge-' || gen_random_uuid()"))
+ id String @id @unique @db.VarChar(8)
empfaenger String? @db.VarChar
strasse String? @db.VarChar
@@ -31,6 +30,6 @@ model GEGEinpreisung {
bedarfsausweis_gewerbe BedarfsausweisGewerbe?
/// @zod.describe("Die ID des Benutzers, der diese Einpreisung bekommt.")
- benutzer_id Int?
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
\ No newline at end of file
diff --git a/prisma/schema/GEGNachweisGewerbe.prisma b/prisma/schema/GEGNachweisGewerbe.prisma
index 19a2d401..b7f39cca 100644
--- a/prisma/schema/GEGNachweisGewerbe.prisma
+++ b/prisma/schema/GEGNachweisGewerbe.prisma
@@ -1,6 +1,5 @@
model GEGNachweisGewerbe {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'gng-' || gen_random_uuid()"))
+ id String @id @unique @db.VarChar(8)
/// @zod.describe("Ausstellgrund wie z.B. Vermietung oder Verkauf")
ausstellgrund Ausstellgrund?
@@ -18,13 +17,13 @@ model GEGNachweisGewerbe {
beschreibung String? @db.Text
/// @zod.describe("Die ID des Benutzers, welchem dieser Ausweis gehört")
- benutzer_id Int?
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- aufnahme_id Int @unique
+ aufnahme_id String @unique
aufnahme Aufnahme @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- rechnung_id Int? @unique
+ rechnung_id String? @unique
rechnung Rechnung? @relation(fields: [rechnung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- geg_einpreisung_id Int? @unique
+ geg_einpreisung_id String? @unique
geg_einpreisung GEGEinpreisung? @relation(fields: [geg_einpreisung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
diff --git a/prisma/schema/GEGNachweisWohnen.prisma b/prisma/schema/GEGNachweisWohnen.prisma
index ac10d2d9..c4b747b0 100644
--- a/prisma/schema/GEGNachweisWohnen.prisma
+++ b/prisma/schema/GEGNachweisWohnen.prisma
@@ -1,6 +1,5 @@
model GEGNachweisWohnen {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'gnw-' || gen_random_uuid()"))
+ id String @id @unique @db.VarChar(8)
/// @zod.describe("Ausstellgrund wie z.B. Vermietung oder Verkauf")
ausstellgrund Ausstellgrund?
@@ -18,13 +17,13 @@ model GEGNachweisWohnen {
beschreibung String? @db.Text
/// @zod.describe("Die ID des Benutzers, welchem dieser Ausweis gehört")
- benutzer_id Int?
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- aufnahme_id Int @unique
+ aufnahme_id String @unique
aufnahme Aufnahme @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- rechnung_id Int? @unique
+ rechnung_id String? @unique
rechnung Rechnung? @relation(fields: [rechnung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- geg_einpreisung_id Int? @unique
+ geg_einpreisung_id String? @unique
geg_einpreisung GEGEinpreisung? @relation(fields: [geg_einpreisung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
diff --git a/prisma/schema/Objekt.prisma b/prisma/schema/Objekt.prisma
index bf1acda9..3f0fb4af 100644
--- a/prisma/schema/Objekt.prisma
+++ b/prisma/schema/Objekt.prisma
@@ -1,7 +1,5 @@
model Objekt {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'obj-' || gen_random_uuid()"))
- benutzer_id Int?
+ id String @id @unique @db.VarChar(8)
latitude Float?
longitude Float?
@@ -15,6 +13,7 @@ model Objekt {
erstellungsdatum DateTime? @default(now())
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id])
aufnahmen Aufnahme[]
anteilshaber Anteilshaber[]
diff --git a/prisma/schema/Rechnung.prisma b/prisma/schema/Rechnung.prisma
index 7b202bf1..a517b851 100644
--- a/prisma/schema/Rechnung.prisma
+++ b/prisma/schema/Rechnung.prisma
@@ -24,10 +24,8 @@ enum AusweisTyp {
}
model Rechnung {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'inv-' || gen_random_uuid()"))
+ id String @id @unique @db.VarChar(8)
- benutzer_id Int
empfaenger String? @db.VarChar
strasse String? @db.VarChar
plz String? @db.VarChar
@@ -52,6 +50,7 @@ model Rechnung {
storniert_am DateTime?
transaktions_referenz String? @unique @db.VarChar
+ benutzer_id String
benutzer Benutzer @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
verbrauchsausweis_wohnen VerbrauchsausweisWohnen?
diff --git a/prisma/schema/RefreshTokens.prisma b/prisma/schema/RefreshTokens.prisma
index f5292663..4c2003b0 100644
--- a/prisma/schema/RefreshTokens.prisma
+++ b/prisma/schema/RefreshTokens.prisma
@@ -1,7 +1,6 @@
model RefreshTokens {
id Int @id @default(autoincrement())
- benutzer_id Int
token String @unique
// Wir nehmen die IP Adresse des Clients mit auf.
// Falls sich die IP Adresse eines Refresh Token Owners ändert, können wir diesen einfach invalidieren.
@@ -9,5 +8,6 @@ model RefreshTokens {
expiry DateTime
// Relationen
+ benutzer_id String
user Benutzer @relation(fields: [benutzer_id], references: [id], onDelete: Cascade)
}
\ No newline at end of file
diff --git a/prisma/schema/Tickets.prisma b/prisma/schema/Tickets.prisma
index 95210fef..f13213e6 100644
--- a/prisma/schema/Tickets.prisma
+++ b/prisma/schema/Tickets.prisma
@@ -8,9 +8,7 @@ enum TicketStatus {
}
model Tickets {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'tkt-' || gen_random_uuid()"))
- benutzer_id Int?
+ id String @id @unique @db.VarChar(8)
created_at DateTime @default(now())
updated_at DateTime? @updatedAt
deleted_at DateTime?
@@ -21,10 +19,11 @@ model Tickets {
metadata Json?
email String
- bearbeiter_id Int?
+ bearbeiter_id String?
prioritaet Int? @default(0)
// Relationen
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], name: "ErstellteTickets")
bearbeiter Benutzer? @relation(fields: [bearbeiter_id], references: [id], name: "BearbeiteteTickets")
}
diff --git a/prisma/schema/Unterlage.prisma b/prisma/schema/Unterlage.prisma
index 64dce49f..af8cb225 100644
--- a/prisma/schema/Unterlage.prisma
+++ b/prisma/schema/Unterlage.prisma
@@ -5,12 +5,11 @@ enum UnterlagenKategorie {
}
model Unterlage {
- id Int @id @default(autoincrement())
- uid String @unique @default(dbgenerated("'pln-' || gen_random_uuid()"))
+ id String @id @unique @db.VarChar(8)
name String?
kategorie String?
mime String?
- aufnahme_id Int?
+ aufnahme_id String?
aufnahme Aufnahme? @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
\ No newline at end of file
diff --git a/prisma/schema/VerbrauchsausweisGewerbe.prisma b/prisma/schema/VerbrauchsausweisGewerbe.prisma
index f894cf80..c827a1e7 100644
--- a/prisma/schema/VerbrauchsausweisGewerbe.prisma
+++ b/prisma/schema/VerbrauchsausweisGewerbe.prisma
@@ -1,9 +1,7 @@
model VerbrauchsausweisGewerbe {
- id Int @id @default(autoincrement())
+ id String @id @unique @db.VarChar(8)
alte_ausweis_id Int?
- uid String @unique @default(dbgenerated("'vag-' || gen_random_uuid()"))
- benutzer_id Int?
ausstellgrund Ausstellgrund?
registriernummer String? @db.VarChar
zusaetzliche_heizquelle Boolean?
@@ -68,12 +66,13 @@ model VerbrauchsausweisGewerbe {
ausweistyp AusweisTyp @default(Standard)
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- rechnung_id Int? @unique
+ rechnung_id String? @unique
rechnung Rechnung? @relation(fields: [rechnung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
/// @zod.describe("ID der korrespondierenden Gebäudeaufnahme")
- aufnahme_id Int @unique
+ aufnahme_id String @unique
aufnahme Aufnahme @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
diff --git a/prisma/schema/VerbrauchsausweisWohnen.prisma b/prisma/schema/VerbrauchsausweisWohnen.prisma
index 2e334f17..a19e0e18 100644
--- a/prisma/schema/VerbrauchsausweisWohnen.prisma
+++ b/prisma/schema/VerbrauchsausweisWohnen.prisma
@@ -1,11 +1,8 @@
model VerbrauchsausweisWohnen {
- id Int @id @default(autoincrement())
+ /// @zod.describe("ID des Ausweises")
+ id String @id @unique @db.VarChar(8)
alte_ausweis_id Int?
- /// @zod.describe("UID des Ausweises")
- uid String @unique @default(dbgenerated("'vaw-' || gen_random_uuid()"))
- /// @zod.describe("Die ID des Benutzers, welchem dieser Ausweis gehört")
- benutzer_id Int?
/// @zod.describe("Ausstellgrund wie z.B. Vermietung oder Verkauf")
ausstellgrund Ausstellgrund?
/// @zod.describe("Die Registriernummer des Ausweises")
@@ -72,12 +69,14 @@ model VerbrauchsausweisWohnen {
created_at DateTime @default(now())
updated_at DateTime @updatedAt
+ /// @zod.describe("Die ID des Benutzers, welchem dieser Ausweis gehört")
+ benutzer_id String?
benutzer Benutzer? @relation(fields: [benutzer_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- rechnung_id Int? @unique
+ rechnung_id String? @unique
rechnung Rechnung? @relation(fields: [rechnung_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
/// @zod.describe("ID der korrespondierenden Gebäudeaufnahme")
- aufnahme_id Int @unique
+ aufnahme_id String @unique
aufnahme Aufnahme @relation(fields: [aufnahme_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
diff --git a/prisma/schema/documenttemplates.prisma b/prisma/schema/documenttemplates.prisma
index 6d57d88d..edda24d8 100644
--- a/prisma/schema/documenttemplates.prisma
+++ b/prisma/schema/documenttemplates.prisma
@@ -4,7 +4,7 @@ model documenttemplates {
name String @db.VarChar(100)
shortdescription String @db.VarChar(100)
longdescription String @db.VarChar(5000)
- user_id Int
+ user_id String
is_private Boolean @default(true)
documenttype Int
filename String @db.VarChar(100)
diff --git a/prisma/schema/tokens.prisma b/prisma/schema/tokens.prisma
index 27a93f13..2f287068 100644
--- a/prisma/schema/tokens.prisma
+++ b/prisma/schema/tokens.prisma
@@ -2,7 +2,7 @@
model tokens {
id Int @id(map: "PK_TOKENS") @default(autoincrement())
token String @db.VarChar(36)
- user_id Int
+ user_id String
date_created DateTime @default(now()) @db.Timestamp(6)
last_used DateTime @default(now()) @db.Timestamp(6)
times_used Int @default(0)
diff --git a/prisma/seed.ts b/prisma/seed.ts
index 9e7b6d05..b368b03d 100644
--- a/prisma/seed.ts
+++ b/prisma/seed.ts
@@ -93,6 +93,7 @@ await prisma.benutzer.create({
vorname: "Admin",
adresse: "Adminstraße 1",
plz: "12345",
+ id: "USADMIN1"
},
});
@@ -106,6 +107,7 @@ await prisma.benutzer.create({
vorname: "User",
adresse: "Userstraße 1",
plz: "12345",
+ id: "USUSER01"
},
});
diff --git a/server.ts b/server.ts
index 98f9fcb8..1fba8129 100644
--- a/server.ts
+++ b/server.ts
@@ -1,7 +1,21 @@
import express from 'express';
+import { H, Handlers } from '@highlight-run/node'
// @ts-ignore
import { handler as ssrHandler } from './dist/server/entry.mjs';
+const highlightConfig = {
+ projectID: '1jdkoe52',
+ serviceName: "online-energieausweis",
+ serviceVersion: "git-sha",
+ environment: "production",
+ backendUrl: "http://212.227.61.149:3000/public",
+ networkRecording: {
+ enabled: true,
+ recordHeadersAndBody: true,
+ },
+}
+
+H.init(highlightConfig)
const app = express();
const base = '/';
@@ -9,6 +23,8 @@ app.use(base, express.static('dist/client/'));
app.use(ssrHandler);
app.use(express.json({ limit: "50mb" }))
app.use(express.urlencoded({ limit: "50mb" }))
+app.use(Handlers.middleware(highlightConfig))
+app.use(Handlers.errorHandler(highlightConfig))
app.listen(3000, function() {
console.log('Server started on http://localhost:3000');
diff --git a/src/astro-typesafe-api-caller.ts b/src/astro-typesafe-api-caller.ts
index 63e7abf0..fd3dc1a0 100644
--- a/src/astro-typesafe-api-caller.ts
+++ b/src/astro-typesafe-api-caller.ts
@@ -12,34 +12,34 @@ 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"),
+ "bedarfsausweis-gewerbe/[uid]": await import("../src/pages/api/bedarfsausweis-gewerbe/[uid].ts"),
+ "bedarfsausweis-gewerbe": await import("../src/pages/api/bedarfsausweis-gewerbe/index.ts"),
"auth/access-token": await import("../src/pages/api/auth/access-token.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-gewerbe/[uid]": await import("../src/pages/api/bedarfsausweis-gewerbe/[uid].ts"),
- "bedarfsausweis-gewerbe": await import("../src/pages/api/bedarfsausweis-gewerbe/index.ts"),
- "bedarfsausweis-wohnen/[uid]": await import("../src/pages/api/bedarfsausweis-wohnen/[uid].ts"),
+ "ausweise": await import("../src/pages/api/ausweise/index.ts"),
+ "aufnahme": await import("../src/pages/api/aufnahme/index.ts"),
+ "bedarfsausweis-wohnen/[id]": await import("../src/pages/api/bedarfsausweis-wohnen/[id].ts"),
"bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"),
- "bilder/[uid]": await import("../src/pages/api/bilder/[uid].ts"),
+ "bilder/[id]": await import("../src/pages/api/bilder/[id].ts"),
"geg-nachweis-gewerbe/[uid]": await import("../src/pages/api/geg-nachweis-gewerbe/[uid].ts"),
"geg-nachweis-gewerbe": await import("../src/pages/api/geg-nachweis-gewerbe/index.ts"),
"geg-nachweis-wohnen/[uid]": await import("../src/pages/api/geg-nachweis-wohnen/[uid].ts"),
"geg-nachweis-wohnen": await import("../src/pages/api/geg-nachweis-wohnen/index.ts"),
"objekt": await import("../src/pages/api/objekt/index.ts"),
- "rechnung/[uid]": await import("../src/pages/api/rechnung/[uid].ts"),
+ "rechnung/[id]": await import("../src/pages/api/rechnung/[id].ts"),
"rechnung/anfordern": await import("../src/pages/api/rechnung/anfordern.ts"),
"rechnung": await import("../src/pages/api/rechnung/index.ts"),
"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/[id]": await import("../src/pages/api/verbrauchsausweis-gewerbe/[id].ts"),
"verbrauchsausweis-gewerbe": await import("../src/pages/api/verbrauchsausweis-gewerbe/index.ts"),
+ "verbrauchsausweis-wohnen/[id]": await import("../src/pages/api/verbrauchsausweis-wohnen/[id].ts"),
+ "verbrauchsausweis-wohnen": await import("../src/pages/api/verbrauchsausweis-wohnen/index.ts"),
"webhooks/mollie": await import("../src/pages/api/webhooks/mollie.ts"),
- "aufnahme/[uid]/bilder": await import("../src/pages/api/aufnahme/[uid]/bilder.ts"),
- "aufnahme/[uid]": await import("../src/pages/api/aufnahme/[uid]/index.ts"),
- "aufnahme/[uid]/unterlagen": await import("../src/pages/api/aufnahme/[uid]/unterlagen.ts"),
- "objekt/[uid]": await import("../src/pages/api/objekt/[uid]/index.ts"),
+ "aufnahme/[id]/bilder": await import("../src/pages/api/aufnahme/[id]/bilder.ts"),
+ "aufnahme/[id]": await import("../src/pages/api/aufnahme/[id]/index.ts"),
+ "aufnahme/[id]/unterlagen": await import("../src/pages/api/aufnahme/[id]/unterlagen.ts"),
+ "objekt/[id]": await import("../src/pages/api/objekt/[id]/index.ts"),
})
\ No newline at end of file
diff --git a/src/client/lib/ausweisSpeichern.ts b/src/client/lib/ausweisSpeichern.ts
index c8c2f168..db460ed6 100644
--- a/src/client/lib/ausweisSpeichern.ts
+++ b/src/client/lib/ausweisSpeichern.ts
@@ -13,8 +13,8 @@ export async function ausweisSpeichern(
bilder: BildClient[],
ausweisart: Enums.Ausweisart
) {
- if (objekt.uid) {
- await api.objekt._uid.PATCH.fetch({
+ if (objekt.id) {
+ await api.objekt._id.PATCH.fetch({
adresse: objekt.adresse,
latitude: 0,
longitude: 0,
@@ -22,14 +22,14 @@ export async function ausweisSpeichern(
plz: objekt.plz
}, {
params: {
- uid: objekt.uid
+ id: objekt.id
},
headers: {
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
}
})
} else {
- const { uid } = await api.objekt.PUT.fetch({
+ const { id } = await api.objekt.PUT.fetch({
adresse: objekt.adresse,
latitude: 0,
longitude: 0,
@@ -41,16 +41,16 @@ export async function ausweisSpeichern(
}
})
- objekt.uid = uid;
+ objekt.id = id;
}
- if (aufnahme.uid) {
- await api.aufnahme._uid.PATCH.fetch({
+ if (aufnahme.id) {
+ await api.aufnahme._id.PATCH.fetch({
baujahr_gebaeude: aufnahme.baujahr_gebaeude,
baujahr_heizung: aufnahme.baujahr_heizung,
- baujahr_klima: aufnahme.baujahr_klima,
+ baujahr_klima: aufnahme.baujahr_klima || [],
alternative_heizung: aufnahme.alternative_heizung,
alternative_kuehlung: aufnahme.alternative_kuehlung,
alternative_lueftung: aufnahme.alternative_lueftung,
@@ -102,14 +102,14 @@ export async function ausweisSpeichern(
zirkulation: aufnahme.zirkulation
}, {
params: {
- uid: aufnahme.uid
+ id: aufnahme.id
},
headers: {
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
}
})
} else {
- const { uid } = await api.aufnahme.PUT.fetch({
+ const { id } = await api.aufnahme.PUT.fetch({
aufnahme: {
baujahr_gebaeude: aufnahme.baujahr_gebaeude,
baujahr_heizung: aufnahme.baujahr_heizung,
@@ -165,56 +165,56 @@ export async function ausweisSpeichern(
zentralheizung: aufnahme.zentralheizung,
zirkulation: aufnahme.zirkulation
},
- uid_objekt: objekt.uid
+ objekt_id: objekt.id
}, {
headers: {
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
}
})
- aufnahme.uid = uid
+ aufnahme.id = id
}
let patchRoute: any;
let putRoute: any;
if (ausweisart == Enums.Ausweisart.VerbrauchsausweisWohnen) {
- patchRoute = api["verbrauchsausweis-wohnen"]._uid.PATCH
+ patchRoute = api["verbrauchsausweis-wohnen"]._id.PATCH
putRoute = api["verbrauchsausweis-wohnen"].PUT
} else if (ausweisart == Enums.Ausweisart.VerbrauchsausweisGewerbe) {
- patchRoute = api["verbrauchsausweis-gewerbe"]._uid.PATCH
+ patchRoute = api["verbrauchsausweis-gewerbe"]._id.PATCH
putRoute = api["verbrauchsausweis-gewerbe"].PUT
} else if (ausweisart == Enums.Ausweisart.BedarfsausweisWohnen) {
- patchRoute = api["bedarfsausweis-wohnen"]._uid.PATCH
+ patchRoute = api["bedarfsausweis-wohnen"]._id.PATCH
putRoute = api["bedarfsausweis-wohnen"].PUT
}
- if (ausweis.uid) {
+ if (ausweis.id) {
await patchRoute.fetch({
- ...exclude(ausweis, ["uid"])
+ ...exclude(ausweis, ["id"])
}, {
params: {
- uid: ausweis.uid
+ id: ausweis.id
},
headers: {
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
}
})
} else {
- const { uid } = await putRoute.fetch({
+ const { id } = await putRoute.fetch({
ausweis,
- uid_aufnahme: aufnahme.uid
+ aufnahme_id: aufnahme.id
}, {
headers: {
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
}
})
- ausweis.uid = uid;
+ ausweis.id = id;
}
- await api.aufnahme._uid.bilder.PUT.fetch(bilder.map(bild => bild.uid), {
+ await api.aufnahme._id.bilder.PUT.fetch(bilder.map(bild => bild.id), {
params: {
- uid: aufnahme.uid
+ id: aufnahme.id
},
headers: {
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
@@ -222,29 +222,8 @@ export async function ausweisSpeichern(
})
return {
- uid_ausweis: ausweis.uid,
- uid_aufnahme: aufnahme.uid,
- uid_objekt: objekt.uid
+ ausweis_id: ausweis.id,
+ aufnahme_id: aufnahme.id,
+ objekt_id: objekt.id
}
-
-
- // await client.v1.tickets.erstellen.mutate({
- // titel: "Ausweis konnte nicht gespeichert werden",
- // beschreibung: e.stack,
- // email: user.email ?? "",
- // metadata: JSON.stringify({
- // ausweis,
- // }),
- // });
-
- // addNotification({
- // dismissable: false,
- // message:
- // "Ausweis konnte nicht gespeichert werden, bitte versuchen sie es erneut.",
- // subtext:
- // "Sollte das Problem weiterhin bestehen, kontaktieren sie bitte den Support.",
- // timeout: 6000,
- // type: "error",
- // });
- return null;
}
diff --git a/src/components/Ausweis/ButtonWeiterHilfe.svelte b/src/components/Ausweis/ButtonWeiterHilfe.svelte
index 9c5d67f1..ce5f7c8c 100644
--- a/src/components/Ausweis/ButtonWeiterHilfe.svelte
+++ b/src/components/Ausweis/ButtonWeiterHilfe.svelte
@@ -48,7 +48,7 @@
openWindowWithPost("/kundendaten", {
- ausweis,
+ ausweis: { ...ausweis, ausweistyp },
objekt,
aufnahme,
bilder,
@@ -80,11 +80,11 @@
window.history.pushState(
{},
"",
- `${location.pathname}?uid=${ausweis.uid}`
+ `${location.pathname}?uid=${ausweis.id}`
);
localStorage.clear()
- window.location.href = `/speichern-erfolgreich?uid=${ausweis.uid}`
+ window.location.href = `/speichern-erfolgreich?uid=${ausweis.id}`
}
}
diff --git a/src/components/Ausweis/types.ts b/src/components/Ausweis/types.ts
index 5cae8ff7..d693338e 100644
--- a/src/components/Ausweis/types.ts
+++ b/src/components/Ausweis/types.ts
@@ -31,13 +31,8 @@ export type UploadedGebaeudeBild = OmitKeys & {
* @export
* @typedef {VerbrauchsausweisWohnenClient}
*/
-export type VerbrauchsausweisWohnenClient = OmitKeys<
- VerbrauchsausweisWohnen,
- "id" | "aufnahme_id" | "benutzer_id"
-> & {
- uid_objekt: string,
- uid_aufnahme: string,
- uid_benutzer?: string
+export type VerbrauchsausweisWohnenClient = VerbrauchsausweisWohnen & {
+ objekt_id: string
};
/**
@@ -50,13 +45,8 @@ export type VerbrauchsausweisWohnenClient = OmitKeys<
* @export
* @typedef {VerbrauchsausweisWohnenClient}
*/
-export type VerbrauchsausweisGewerbeClient = OmitKeys<
- VerbrauchsausweisGewerbe,
- "id" | "aufnahme_id" | "benutzer_id"
-> & {
- uid_objekt: string,
- uid_aufnahme: string,
- uid_benutzer?: string
+export type VerbrauchsausweisGewerbeClient = VerbrauchsausweisGewerbe & {
+ objekt_id: string
};
/**
@@ -69,13 +59,8 @@ export type VerbrauchsausweisGewerbeClient = OmitKeys<
* @export
* @typedef {VerbrauchsausweisWohnenClient}
*/
-export type BedarfsausweisWohnenClient = OmitKeys<
- BedarfsausweisWohnen,
- "id" | "aufnahme_id" | "benutzer_id"
-> & {
- uid_objekt: string,
- uid_aufnahme: string,
- uid_benutzer?: string
+export type BedarfsausweisWohnenClient = BedarfsausweisWohnen & {
+ objekt_id: string
};
/**
@@ -88,20 +73,15 @@ export type BedarfsausweisWohnenClient = OmitKeys<
* @export
* @typedef {ObjektClient}
*/
-export type ObjektClient = OmitKeys;
+export type ObjektClient = Objekt;
-export type AufnahmeClient = OmitKeys<
- Aufnahme,
- "id" | "objekt_id" | "benutzer_id"
-> & {
- uid_objekt: string
-};
+export type AufnahmeClient = Aufnahme
export type TicketClient = OmitKeys
-export type BenutzerClient = OmitKeys;
+export type BenutzerClient = OmitKeys;
-export type RechnungClient = OmitKeys
+export type RechnungClient = Rechnung
export function ZodOverlap>(arg: S): S {
return arg;
@@ -122,34 +102,34 @@ export type OptionalNullable = T extends object ? {
} : T;
export const UUidWithPrefix = z.string().refine((value) => {
- const prefixedUUidRegex = /^([0-9a-z]+)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
+ const prefixedUUidRegex = /^([A-Z]{2})[0-9A-Z]{6}$/i
const match = value.match(prefixedUUidRegex)
- if (match && match[1] in VALID_UUID_PREFIXES) {
+ if (match && Object.values(VALID_UUID_PREFIXES).indexOf(match[1] as VALID_UUID_PREFIXES) > -1) {
return true;
}
return false;
})
-export function getAusweisartFromUUID(uid: string): Enums.Ausweisart | null {
- if (!UUidWithPrefix.safeParse(uid).success) {
+export function getAusweisartFromUUID(id: string): Enums.Ausweisart | null {
+ if (!UUidWithPrefix.safeParse(id).success) {
return null
}
- switch(uid.split("-")[0]) {
- case "vaw":
+ switch(id.slice(0, 2) as VALID_UUID_PREFIXES) {
+ case VALID_UUID_PREFIXES.VerbrauchsausweisWohnen:
return Enums.Ausweisart.VerbrauchsausweisWohnen
- case "vag":
+ case VALID_UUID_PREFIXES.VerbrauchsausweisGewerbe:
return Enums.Ausweisart.VerbrauchsausweisGewerbe
- case "baw":
+ case VALID_UUID_PREFIXES.BedarfsausweisWohnen:
return Enums.Ausweisart.BedarfsausweisWohnen
- case "bag":
+ case VALID_UUID_PREFIXES.BedarfsausweisGewerbe:
return Enums.Ausweisart.BedarfsausweisGewerbe
- case "gnw":
+ case VALID_UUID_PREFIXES.GEGNachweisWohnen:
return Enums.Ausweisart.GEGNachweisWohnen
- case "gng":
+ case VALID_UUID_PREFIXES.GEGNachweisGewerbe:
return Enums.Ausweisart.GEGNachweisGewerbe
default:
return null
diff --git a/src/components/design/content/ProduktUebersichtVerbrauchsausweisWohnen.svelte b/src/components/design/content/ProduktUebersichtVerbrauchsausweisWohnen.svelte
index 925b421a..0f7edb8a 100644
--- a/src/components/design/content/ProduktUebersichtVerbrauchsausweisWohnen.svelte
+++ b/src/components/design/content/ProduktUebersichtVerbrauchsausweisWohnen.svelte
@@ -1,6 +1,6 @@
+
diff --git a/src/layouts/BlankLayout.astro b/src/layouts/BlankLayout.astro
index b38aa5a1..22171da8 100644
--- a/src/layouts/BlankLayout.astro
+++ b/src/layouts/BlankLayout.astro
@@ -34,6 +34,19 @@ const schema = JSON.stringify({
});
---
+
+
diff --git a/src/layouts/DashboardLayout.astro b/src/layouts/DashboardLayout.astro
index 0a88f9b6..35ff39f5 100644
--- a/src/layouts/DashboardLayout.astro
+++ b/src/layouts/DashboardLayout.astro
@@ -71,6 +71,19 @@ const schema = JSON.stringify({
let lightTheme = Astro.cookies.get("theme")?.value === "light";
---
+
+
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index e37e6fd7..3d4c6486 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -19,6 +19,17 @@ const { title } = Astro.props;
---
diff --git a/src/layouts/BlankLayout.astro b/src/layouts/BlankLayout.astro
index 24e146b4..a2dc74c0 100644
--- a/src/layouts/BlankLayout.astro
+++ b/src/layouts/BlankLayout.astro
@@ -37,15 +37,17 @@ const schema = JSON.stringify({
diff --git a/src/layouts/DashboardLayout.astro b/src/layouts/DashboardLayout.astro
index 3fa13611..f1fd1059 100644
--- a/src/layouts/DashboardLayout.astro
+++ b/src/layouts/DashboardLayout.astro
@@ -74,15 +74,17 @@ let lightTheme = Astro.cookies.get("theme")?.value === "light";
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index ecc6ba59..b909f06f 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -21,15 +21,17 @@ const { title } = Astro.props;
diff --git a/src/components/Ausweis/AnlagenTechnik.svelte b/src/components/Ausweis/AnlagenTechnik.svelte
index 757f9cc2..a3077d1b 100644
--- a/src/components/Ausweis/AnlagenTechnik.svelte
+++ b/src/components/Ausweis/AnlagenTechnik.svelte
@@ -2,7 +2,7 @@
import {
AufnahmeClient,
ObjektClient,
- UploadedGebaeudeBild,
+ BildClient,
} from "./types.js";
import SanierungsOption from "#components/Ausweis/SanierungsOption.svelte";
import AnlagenTechnikImage from "./AnlagenTechnikImage.svelte";
@@ -11,7 +11,7 @@
export let objekt: ObjektClient;
export let aufnahme: AufnahmeClient;
export let ausweis: BedarfsausweisGewerbe;
- export let images: UploadedGebaeudeBild[];
+ export let images: BildClient[];
diff --git a/src/components/Ausweis/BilderZusatzsysteme.svelte b/src/components/Ausweis/BilderZusatzsysteme.svelte
index 4711ee33..869fac8c 100644
--- a/src/components/Ausweis/BilderZusatzsysteme.svelte
+++ b/src/components/Ausweis/BilderZusatzsysteme.svelte
@@ -12,7 +12,7 @@
import {
AufnahmeClient,
ObjektClient,
- UploadedGebaeudeBild,
+ BildClient,
VerbrauchsausweisWohnenClient,
} from "./types.js";
import { boolean } from "astro:schema";
@@ -21,7 +21,7 @@
export let gebaeude: ObjektClient;
export let aufnahme: AufnahmeClient;
export let ausweis: VerbrauchsausweisWohnenClient;
- export let images: UploadedGebaeudeBild[];
+ export let images: BildClient[];
import { ausweisSpeichern } from "#client/lib/ausweisSpeichern.js";
import { validateAccessTokenClient } from "#client/lib/validateAccessToken.js";
- import { AufnahmeClient, BedarfsausweisWohnenClient, BenutzerClient, GEGNachweisWohnenClient, ObjektClient, UnterlageClient, UploadedGebaeudeBild, VerbrauchsausweisGewerbeClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
+ import { AufnahmeClient, BedarfsausweisWohnenClient, BenutzerClient, GEGNachweisWohnenClient, ObjektClient, UnterlageClient, BildClient, VerbrauchsausweisGewerbeClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
import Overlay from "#components/Overlay.svelte";
import EmbeddedAuthFlowModule from "#modules/EmbeddedAuthFlowModule.svelte";
@@ -11,9 +11,9 @@
import { nachweisSpeichern } from "#client/lib/nachweisSpeichern.js";
export let ausweis: VerbrauchsausweisWohnenClient | VerbrauchsausweisGewerbeClient | BedarfsausweisWohnenClient | GEGNachweisWohnenClient;
- export let bilder: UploadedGebaeudeBild[];
+ export let bilder: BildClient[];
export let unterlagen: UnterlageClient[] = [];
- export let user: BenutzerClient;
+ export let user: BenutzerClient | null;
export let objekt: ObjektClient;
export let aufnahme: AufnahmeClient;
export let ausweisart: Enums.Ausweisart
@@ -71,20 +71,22 @@
let result: Awaited> | Awaited> | null = null;
if (ausweisart === Enums.Ausweisart.GEGNachweisWohnen || ausweisart === Enums.Ausweisart.GEGNachweisGewerbe || ausweisart === Enums.Ausweisart.BedarfsausweisGewerbe) {
- result = await nachweisSpeichern(ausweis, objekt, aufnahme, bilder, unterlagen, ausweisart)
+ result = await nachweisSpeichern({ ...ausweis, ausweistyp }, objekt, aufnahme, bilder, unterlagen, ausweisart)
+ ausweis.id = result.nachweis_id;
} else {
- result = await ausweisSpeichern(ausweis, objekt, aufnahme, bilder, ausweisart)
+ result = await ausweisSpeichern({ ...ausweis, ausweistyp }, objekt, aufnahme, bilder, ausweisart)
+ ausweis.id = result.ausweis_id;
}
if (result !== null) {
window.history.pushState(
{},
"",
- `${location.pathname}?uid=${ausweis.id}`
+ `${location.pathname}?id=${ausweis.id}`
);
localStorage.clear()
- window.location.href = `/speichern-erfolgreich?uid=${ausweis.id}`
+ window.location.href = `/speichern-erfolgreich?id=${ausweis.id}`
}
}
diff --git a/src/components/Ausweis/DaemmungImage.svelte b/src/components/Ausweis/DaemmungImage.svelte
index 76c74a04..ad0456c8 100644
--- a/src/components/Ausweis/DaemmungImage.svelte
+++ b/src/components/Ausweis/DaemmungImage.svelte
@@ -1,9 +1,9 @@
diff --git a/src/components/Ausweis/FensterImage.svelte b/src/components/Ausweis/FensterImage.svelte
index a3cf0281..c3b6450b 100644
--- a/src/components/Ausweis/FensterImage.svelte
+++ b/src/components/Ausweis/FensterImage.svelte
@@ -1,9 +1,9 @@
diff --git a/src/components/Ausweis/HeizungImage.svelte b/src/components/Ausweis/HeizungImage.svelte
index 38678ef2..d891f14d 100644
--- a/src/components/Ausweis/HeizungImage.svelte
+++ b/src/components/Ausweis/HeizungImage.svelte
@@ -1,9 +1,9 @@
diff --git a/src/components/Ausweis/SanierungszustandFensterTueren.svelte b/src/components/Ausweis/SanierungszustandFensterTueren.svelte
index 8ccc2906..13ee27db 100644
--- a/src/components/Ausweis/SanierungszustandFensterTueren.svelte
+++ b/src/components/Ausweis/SanierungszustandFensterTueren.svelte
@@ -9,7 +9,7 @@
import {
AufnahmeClient,
ObjektClient,
- UploadedGebaeudeBild,
+ BildClient,
VerbrauchsausweisGewerbeClient,
VerbrauchsausweisWohnenClient,
} from "./types.js";
@@ -19,7 +19,7 @@
export let objekt: ObjektClient;
export let aufnahme: AufnahmeClient;
export let ausweis: VerbrauchsausweisWohnenClient | VerbrauchsausweisGewerbeClient;
- export let images: UploadedGebaeudeBild[];
+ export let images: BildClient[];
- import HelpLabel from "#components/labels/HelpLabel.svelte";
- import Inputlabel from "#components/labels/InputLabel.svelte";
-
+ import { Enums } from "#lib/client/prisma.js";
import HeizungImage from "./HeizungImage.svelte";
import {
AufnahmeClient,
ObjektClient,
- UploadedGebaeudeBild,
+ BildClient,
VerbrauchsausweisGewerbeClient,
VerbrauchsausweisWohnenClient,
} from "./types.js";
- import { boolean } from "astro:schema";
import SanierungsOption from "#components/Ausweis/SanierungsOption.svelte";
import AngabenZurHeizunganlage from "#components/Ausweis/AngabenZurHeizunganlage.svelte";
export let objekt: ObjektClient;
export let aufnahme: AufnahmeClient;
export let ausweis: VerbrauchsausweisWohnenClient | VerbrauchsausweisGewerbeClient;
- export let images: UploadedGebaeudeBild[];
+ export let images: BildClient[];
export let ausweisart: Enums.Ausweisart;
diff --git a/src/components/Ausweis/SanierungszustandWaermedammung.svelte b/src/components/Ausweis/SanierungszustandWaermedammung.svelte
index 8ea58bb9..282422b1 100644
--- a/src/components/Ausweis/SanierungszustandWaermedammung.svelte
+++ b/src/components/Ausweis/SanierungszustandWaermedammung.svelte
@@ -6,7 +6,7 @@
AufnahmeClient,
BedarfsausweisWohnenClient,
ObjektClient,
- UploadedGebaeudeBild,
+ BildClient,
VerbrauchsausweisGewerbeClient,
VerbrauchsausweisWohnenClient,
} from "./types.js";
@@ -18,7 +18,7 @@
| VerbrauchsausweisWohnenClient
| VerbrauchsausweisGewerbeClient
| BedarfsausweisWohnenClient;
- export let images: UploadedGebaeudeBild[];
+ export let images: BildClient[];
& {
* @export
* @typedef {VerbrauchsausweisWohnenClient}
*/
-export type VerbrauchsausweisWohnenClient = VerbrauchsausweisWohnen & {
- objekt_id: string
-};
+export type VerbrauchsausweisWohnenClient = VerbrauchsausweisWohnen
/**
* Das ist der Typescript Type für den Verbrauchsausweis Gewerbe mit allen Feldern die
@@ -45,9 +43,7 @@ export type VerbrauchsausweisWohnenClient = VerbrauchsausweisWohnen & {
* @export
* @typedef {VerbrauchsausweisWohnenClient}
*/
-export type VerbrauchsausweisGewerbeClient = VerbrauchsausweisGewerbe & {
- objekt_id: string
-};
+export type VerbrauchsausweisGewerbeClient = VerbrauchsausweisGewerbe
/**
* Das ist der Typescript Type für den Verbrauchsausweis Gewerbe mit allen Feldern die
@@ -59,9 +55,7 @@ export type VerbrauchsausweisGewerbeClient = VerbrauchsausweisGewerbe & {
* @export
* @typedef {VerbrauchsausweisWohnenClient}
*/
-export type BedarfsausweisWohnenClient = BedarfsausweisWohnen & {
- objekt_id: string
-};
+export type BedarfsausweisWohnenClient = BedarfsausweisWohnen
/**
* Das ist der Typescript Type für die Gebäude Stammdaten mit allen Feldern die
@@ -152,8 +146,4 @@ export type AufnahmeKomplettClient = AufnahmeClient & {
geg_nachweise_wohnen: (GEGNachweisWohnenClient & { rechnung: RechnungClient })[]
}
-export type GEGNachweisWohnenClient = Omit & {
- uid_objekt: string,
- uid_aufnahme: string,
- uid_benutzer?: string
-}
\ No newline at end of file
+export type GEGNachweisWohnenClient = GEGNachweisWohnen
\ No newline at end of file
diff --git a/src/components/AusweisPruefenBox.svelte b/src/components/AusweisPruefenBox.svelte
index c1f72128..cde3277b 100644
--- a/src/components/AusweisPruefenBox.svelte
+++ b/src/components/AusweisPruefenBox.svelte
@@ -5,7 +5,7 @@
AufnahmeClient,
getAusweisartFromUUID,
ObjektClient,
- UploadedGebaeudeBild,
+ BildClient,
VerbrauchsausweisWohnenClient,
} from "./Ausweis/types.js";
import AusweisPruefenTooltip from "./AusweisPruefenTooltip.svelte";
@@ -22,7 +22,7 @@
export let ausweis: VerbrauchsausweisWohnenClient;
export let aufnahme: AufnahmeClient;
export let objekt: ObjektClient;
- export let bilder: UploadedGebaeudeBild[]
+ export let bilder: BildClient[]
export let events: Event[]
export let calculations: Awaited<
ReturnType
@@ -49,7 +49,7 @@
- const ausweisArt = getAusweisartFromUUID(ausweis.uid)
+ const ausweisArt = getAusweisartFromUUID(ausweis.id)
let verbrauchWWGesamt_1 = "";
let verbrauchWWGesamt_2 = "";
@@ -458,7 +458,7 @@
async function stornieren(ausweis: VerbrauchsausweisWohnenClient) {
try {
const response = await api.admin.stornieren.PUT.fetch({
- uid_ausweis: ausweis.uid
+ uid_ausweis: ausweis.id
}, {
headers: {
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
@@ -748,7 +748,7 @@
{#each bilder as image}