ID statt UID
This commit is contained in:
@@ -137,7 +137,7 @@ export function getAusweisartFromUUID(id: string): Enums.Ausweisart | null {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type UnterlageClient = Omit<Unterlage, "id" | "aufnahme_id">
|
export type UnterlageClient = Omit<Unterlage, "id" | "aufnahme_id">
|
||||||
export type BildClient = Omit<Bild, "id" | "aufnahme_id" | "name">
|
export type BildClient = Omit<Bild, "aufnahme_id" | "name">
|
||||||
|
|
||||||
export type ObjektKomplettClient = ObjektClient & {
|
export type ObjektKomplettClient = ObjektClient & {
|
||||||
aufnahmen: AufnahmeKomplettClient[]
|
aufnahmen: AufnahmeKomplettClient[]
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants.js";
|
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants.js";
|
||||||
import { Enums, Objekt } from "#lib/client/prisma.js";
|
import { Enums, Objekt } from "#lib/client/prisma.js";
|
||||||
import { endEnergieVerbrauchVerbrauchsausweisGewerbe_2016 } from "#lib/Berechnungen/VerbrauchsausweisGewerbe/VerbrauchsausweisGewerbe_2016.js";
|
import { endEnergieVerbrauchVerbrauchsausweisGewerbe_2016 } from "#lib/Berechnungen/VerbrauchsausweisGewerbe/VerbrauchsausweisGewerbe_2016.js";
|
||||||
import { shortenUID } from "#server/lib/hash.js";
|
|
||||||
import { addNotification } from "#components/Notifications/shared.js";
|
import { addNotification } from "#components/Notifications/shared.js";
|
||||||
|
|
||||||
export let ausweis: VerbrauchsausweisWohnenClient | VerbrauchsausweisGewerbeClient | BedarfsausweisWohnenClient;
|
export let ausweis: VerbrauchsausweisWohnenClient | VerbrauchsausweisGewerbeClient | BedarfsausweisWohnenClient;
|
||||||
@@ -25,9 +24,9 @@
|
|||||||
export let benutzer: BenutzerClient;
|
export let benutzer: BenutzerClient;
|
||||||
const progress = ausweis.ausgestellt ? 100 : ausweis.bestellt ? 66 : 33;
|
const progress = ausweis.ausgestellt ? 100 : ausweis.bestellt ? 66 : 33;
|
||||||
|
|
||||||
const ausweisart = getAusweisartFromUUID(ausweis.uid);
|
const ausweisart = getAusweisartFromUUID(ausweis.id);
|
||||||
|
|
||||||
const id = ausweis.alte_ausweis_id || shortenUID(ausweis.uid);
|
const id = ausweis.alte_ausweis_id || ausweis.id;
|
||||||
|
|
||||||
async function ausweisStornieren() {
|
async function ausweisStornieren() {
|
||||||
const result = await dialogs.confirm({
|
const result = await dialogs.confirm({
|
||||||
@@ -46,18 +45,18 @@
|
|||||||
|
|
||||||
if (result === true) {
|
if (result === true) {
|
||||||
if (ausweisart === Enums.Ausweisart.VerbrauchsausweisWohnen) {
|
if (ausweisart === Enums.Ausweisart.VerbrauchsausweisWohnen) {
|
||||||
await api["verbrauchsausweis-wohnen"]._uid.DELETE.fetch(undefined, {
|
await api["verbrauchsausweis-wohnen"]._id.DELETE.fetch(undefined, {
|
||||||
params: {
|
params: {
|
||||||
uid: ausweis.uid,
|
id: ausweis.id,
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`,
|
Authorization: `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else if (ausweisart === Enums.Ausweisart.VerbrauchsausweisGewerbe) {
|
} else if (ausweisart === Enums.Ausweisart.VerbrauchsausweisGewerbe) {
|
||||||
await api["verbrauchsausweis-gewerbe"]._uid.DELETE.fetch(undefined, {
|
await api["verbrauchsausweis-gewerbe"]._id.DELETE.fetch(undefined, {
|
||||||
params: {
|
params: {
|
||||||
uid: ausweis.uid,
|
id: ausweis.id,
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`,
|
Authorization: `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`,
|
||||||
@@ -95,7 +94,7 @@
|
|||||||
async function registriernummerAnfordern() {
|
async function registriernummerAnfordern() {
|
||||||
try {
|
try {
|
||||||
const result = await api.admin.registriernummer.GET.fetch({
|
const result = await api.admin.registriernummer.GET.fetch({
|
||||||
uid: ausweis.uid
|
uid: ausweis.id
|
||||||
}, {
|
}, {
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
|
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
|
||||||
@@ -115,7 +114,7 @@
|
|||||||
async function stornieren() {
|
async function stornieren() {
|
||||||
try {
|
try {
|
||||||
const response = await api.admin.stornieren.PUT.fetch({
|
const response = await api.admin.stornieren.PUT.fetch({
|
||||||
uid_ausweis: ausweis.uid
|
uid_ausweis: ausweis.id
|
||||||
}, {
|
}, {
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
|
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
|
||||||
@@ -145,7 +144,7 @@
|
|||||||
async function ausweisAusstellen() {
|
async function ausweisAusstellen() {
|
||||||
try {
|
try {
|
||||||
await api.admin.ausstellen.GET.fetch({
|
await api.admin.ausstellen.GET.fetch({
|
||||||
uid_ausweis: ausweis.uid
|
uid_ausweis: ausweis.id
|
||||||
}, {
|
}, {
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
|
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
|
||||||
@@ -297,13 +296,13 @@
|
|||||||
<!--
|
<!--
|
||||||
<a
|
<a
|
||||||
class="button text-sm"
|
class="button text-sm"
|
||||||
href="/energieausweis-erstellen/verbrauchsausweis-wohngebaeude?uid={ausweis.uid}"
|
href="/energieausweis-erstellen/verbrauchsausweis-wohngebaeude?uid={ausweis.id}"
|
||||||
>Stornieren</a>
|
>Stornieren</a>
|
||||||
-->
|
-->
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if ausweis.bestellt && (!rechnung || rechnung.bezahlmethode === Enums.Bezahlmethoden.rechnung)}
|
{#if ausweis.bestellt && (!rechnung || rechnung.bezahlmethode === Enums.Bezahlmethoden.rechnung)}
|
||||||
<!-- <a href="/energieausweis-erstellen/bezahlung?uid={ausweis.uid}" class="button text-sm">Bezahlen</a> -->
|
<!-- <a href="/energieausweis-erstellen/bezahlung?uid={ausweis.id}" class="button text-sm">Bezahlen</a> -->
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
@@ -312,12 +311,12 @@
|
|||||||
{#if ausweisart === Enums.Ausweisart.VerbrauchsausweisWohnen}
|
{#if ausweisart === Enums.Ausweisart.VerbrauchsausweisWohnen}
|
||||||
<a
|
<a
|
||||||
class="button text-sm"
|
class="button text-sm"
|
||||||
href="/energieausweis-erstellen/verbrauchsausweis-wohngebaeude?uid={ausweis.uid}"
|
href="/energieausweis-erstellen/verbrauchsausweis-wohngebaeude?uid={ausweis.id}"
|
||||||
>Bearbeiten</a>
|
>Bearbeiten</a>
|
||||||
{:else if ausweisart === Enums.Ausweisart.VerbrauchsausweisGewerbe}
|
{:else if ausweisart === Enums.Ausweisart.VerbrauchsausweisGewerbe}
|
||||||
<a
|
<a
|
||||||
class="button text-sm"
|
class="button text-sm"
|
||||||
href="/energieausweis-erstellen/verbrauchsausweis-gewerbe?uid={ausweis.uid}"
|
href="/energieausweis-erstellen/verbrauchsausweis-gewerbe?uid={ausweis.id}"
|
||||||
>Bearbeiten</a>
|
>Bearbeiten</a>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
@@ -327,12 +326,12 @@
|
|||||||
{#if ausweisart === Enums.Ausweisart.VerbrauchsausweisWohnen}
|
{#if ausweisart === Enums.Ausweisart.VerbrauchsausweisWohnen}
|
||||||
<a
|
<a
|
||||||
class="button text-sm"
|
class="button text-sm"
|
||||||
href="/energieausweis-erstellen/verbrauchsausweis-wohngebaeude?uid={ausweis.uid}"
|
href="/energieausweis-erstellen/verbrauchsausweis-wohngebaeude?uid={ausweis.id}"
|
||||||
>Formular</a>
|
>Formular</a>
|
||||||
{:else if ausweisart === Enums.Ausweisart.VerbrauchsausweisGewerbe}
|
{:else if ausweisart === Enums.Ausweisart.VerbrauchsausweisGewerbe}
|
||||||
<a
|
<a
|
||||||
class="button text-sm"
|
class="button text-sm"
|
||||||
href="/energieausweis-erstellen/verbrauchsausweis-gewerbe?uid={ausweis.uid}"
|
href="/energieausweis-erstellen/verbrauchsausweis-gewerbe?uid={ausweis.id}"
|
||||||
>Formular</a>
|
>Formular</a>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
@@ -347,7 +346,7 @@
|
|||||||
class="p-2 rounded-lg hover:bg-gray-200"
|
class="p-2 rounded-lg hover:bg-gray-200"
|
||||||
title="PDF Herunterladen"
|
title="PDF Herunterladen"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href="/pdf/ansichtsausweis?uid={ausweis.uid}"
|
href="/pdf/ansichtsausweis?uid={ausweis.id}"
|
||||||
>
|
>
|
||||||
<img src="/images/ausweis.webp" width="32" alt="Energieausweis">
|
<img src="/images/ausweis.webp" width="32" alt="Energieausweis">
|
||||||
</a>
|
</a>
|
||||||
@@ -355,7 +354,7 @@
|
|||||||
class="p-2 rounded-lg hover:bg-gray-200"
|
class="p-2 rounded-lg hover:bg-gray-200"
|
||||||
title="PDF Herunterladen"
|
title="PDF Herunterladen"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href="/pdf/datenblatt?uid={ausweis.uid}"
|
href="/pdf/datenblatt?uid={ausweis.id}"
|
||||||
>
|
>
|
||||||
<img src="/images/datenblatt.webp" width="32" alt="Datenblatt">
|
<img src="/images/datenblatt.webp" width="32" alt="Datenblatt">
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -20,15 +20,17 @@ const { title } = Astro.props;
|
|||||||
<script>
|
<script>
|
||||||
import { H } from "highlight.run";
|
import { H } from "highlight.run";
|
||||||
|
|
||||||
H.init("1jdkoe52", {
|
if (import.meta.env.PROD) {
|
||||||
serviceName: "online-energieausweis",
|
H.init("1jdkoe52", {
|
||||||
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
serviceName: "online-energieausweis",
|
||||||
tracingOrigins: true,
|
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
||||||
networkRecording: {
|
tracingOrigins: true,
|
||||||
enabled: true,
|
networkRecording: {
|
||||||
recordHeadersAndBody: true
|
enabled: true,
|
||||||
}
|
recordHeadersAndBody: true
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
window.addEventListener("scroll", (event) => {
|
window.addEventListener("scroll", (event) => {
|
||||||
const skala = document.getElementById("skala");
|
const skala = document.getElementById("skala");
|
||||||
|
|||||||
@@ -20,15 +20,17 @@ const { title } = Astro.props;
|
|||||||
<script>
|
<script>
|
||||||
import { H } from "highlight.run";
|
import { H } from "highlight.run";
|
||||||
|
|
||||||
H.init("1jdkoe52", {
|
if (import.meta.env.PROD) {
|
||||||
serviceName: "online-energieausweis",
|
H.init("1jdkoe52", {
|
||||||
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
serviceName: "online-energieausweis",
|
||||||
tracingOrigins: true,
|
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
||||||
networkRecording: {
|
tracingOrigins: true,
|
||||||
enabled: true,
|
networkRecording: {
|
||||||
recordHeadersAndBody: true
|
enabled: true,
|
||||||
|
recordHeadersAndBody: true
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,15 +37,17 @@ const schema = JSON.stringify({
|
|||||||
<script>
|
<script>
|
||||||
import { H } from "highlight.run";
|
import { H } from "highlight.run";
|
||||||
|
|
||||||
H.init("1jdkoe52", {
|
if (import.meta.env.PROD) {
|
||||||
serviceName: "online-energieausweis",
|
H.init("1jdkoe52", {
|
||||||
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
serviceName: "online-energieausweis",
|
||||||
tracingOrigins: true,
|
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
||||||
networkRecording: {
|
tracingOrigins: true,
|
||||||
enabled: true,
|
networkRecording: {
|
||||||
recordHeadersAndBody: true
|
enabled: true,
|
||||||
|
recordHeadersAndBody: true
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -74,15 +74,17 @@ let lightTheme = Astro.cookies.get("theme")?.value === "light";
|
|||||||
<script>
|
<script>
|
||||||
import { H } from "highlight.run";
|
import { H } from "highlight.run";
|
||||||
|
|
||||||
H.init("1jdkoe52", {
|
if (import.meta.env.PROD) {
|
||||||
serviceName: "online-energieausweis",
|
H.init("1jdkoe52", {
|
||||||
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
serviceName: "online-energieausweis",
|
||||||
tracingOrigins: true,
|
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
||||||
networkRecording: {
|
tracingOrigins: true,
|
||||||
enabled: true,
|
networkRecording: {
|
||||||
recordHeadersAndBody: true
|
enabled: true,
|
||||||
|
recordHeadersAndBody: true
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -21,15 +21,17 @@ const { title } = Astro.props;
|
|||||||
<script>
|
<script>
|
||||||
import { H } from "highlight.run";
|
import { H } from "highlight.run";
|
||||||
|
|
||||||
H.init("1jdkoe52", {
|
if (import.meta.env.PROD) {
|
||||||
serviceName: "online-energieausweis",
|
H.init("1jdkoe52", {
|
||||||
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
serviceName: "online-energieausweis",
|
||||||
tracingOrigins: true,
|
backendUrl: "https://highlight-backend.ibcornelsen.de/public",
|
||||||
networkRecording: {
|
tracingOrigins: true,
|
||||||
enabled: true,
|
networkRecording: {
|
||||||
recordHeadersAndBody: true
|
enabled: true,
|
||||||
|
recordHeadersAndBody: true
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
window.addEventListener("scroll", (event) => {
|
window.addEventListener("scroll", (event) => {
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
import { AufnahmeClient, BenutzerClient, BildClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
|
import { AufnahmeClient, BenutzerClient, BildClient, ObjektClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
|
||||||
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016.js";
|
import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016.js";
|
||||||
import * as fs from "fs"
|
import * as fs from "fs"
|
||||||
import { PDFDocument, rgb, StandardFonts, TextAlignment } from "pdf-lib";
|
import { PDFDocument, StandardFonts } from "pdf-lib";
|
||||||
import { checkbox, flex, text } from "./elements/index.js";
|
|
||||||
import { xml2pdf } from "./elements/xml2pdf.js";
|
import { xml2pdf } from "./elements/xml2pdf.js";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { BilderKategorie, Enums, Heizungsstatus } from "#lib/server/prisma.js";
|
import { Enums, Heizungsstatus } from "#lib/server/prisma.js";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import { copyPage } from "./utils/copyPage.js";
|
import { copyPage } from "./utils/copyPage.js";
|
||||||
import { PERSISTENT_DIR } from "#lib/server/constants.js";
|
|
||||||
import { shortenUID } from "#server/lib/hash.js";
|
|
||||||
|
|
||||||
/* -------------------------------- Pdf Tools ------------------------------- */
|
/* -------------------------------- Pdf Tools ------------------------------- */
|
||||||
|
|
||||||
@@ -53,7 +49,7 @@ export async function pdfDatenblattVerbrauchsausweisWohnen(ausweis: Verbrauchsau
|
|||||||
|
|
||||||
const innerWidth = pages[0].getWidth() - marginX * 2;
|
const innerWidth = pages[0].getWidth() - marginX * 2;
|
||||||
|
|
||||||
const id = shortenUID(ausweis.uid);
|
const id = ausweis.id;
|
||||||
|
|
||||||
const layout = xml2pdf(`<layout height="${pages[0].getHeight()}" width="${pages[0].getWidth()}" marginTop="150" marginLeft="${marginX}" marginRight="${marginX}">
|
const layout = xml2pdf(`<layout height="${pages[0].getHeight()}" width="${pages[0].getWidth()}" marginTop="150" marginLeft="${marginX}" marginRight="${marginX}">
|
||||||
<text size="12" lineHeight="14">${benutzer.vorname} ${benutzer.name}</text>
|
<text size="12" lineHeight="14">${benutzer.vorname} ${benutzer.name}</text>
|
||||||
@@ -309,8 +305,8 @@ export async function pdfDatenblattVerbrauchsausweisWohnen(ausweis: Verbrauchsau
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bild.uid) {
|
if (bild.id) {
|
||||||
image = `<img src="${bild.uid}.jpg" width="${(pages[2].getWidth() - 120) / 3.1}" height="${(pages[2].getHeight() - marginY * 2) / 4}" />`
|
image = `<img src="${bild.id}.jpg" width="${(pages[2].getWidth() - 120) / 3.1}" height="${(pages[2].getHeight() - marginY * 2) / 4}" />`
|
||||||
}
|
}
|
||||||
|
|
||||||
if (images.length > 0) {
|
if (images.length > 0) {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { shortenUID } from "#server/lib/hash.js";
|
|
||||||
import { BedarfsausweisWohnen, Enums, Rechnung, VerbrauchsausweisGewerbe, VerbrauchsausweisWohnen } from "../prisma.js";
|
import { BedarfsausweisWohnen, Enums, Rechnung, VerbrauchsausweisGewerbe, VerbrauchsausweisWohnen } from "../prisma.js";
|
||||||
|
|
||||||
export function getPaymentSuccessSubject(ausweis: VerbrauchsausweisWohnen | VerbrauchsausweisGewerbe | BedarfsausweisWohnen, rechnung: Rechnung, ausweisart: Enums.Ausweisart) {
|
export function getPaymentSuccessSubject(ausweis: VerbrauchsausweisWohnen | VerbrauchsausweisGewerbe | BedarfsausweisWohnen, rechnung: Rechnung, ausweisart: Enums.Ausweisart) {
|
||||||
const id = shortenUID(ausweis.uid);
|
const id = ausweis.id;
|
||||||
|
|
||||||
let subject: string = "";
|
let subject: string = "";
|
||||||
|
|
||||||
@@ -33,7 +32,7 @@ export function getPaymentSuccessSubject(ausweis: VerbrauchsausweisWohnen | Verb
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getPaymentInvoiceBody(ausweis: VerbrauchsausweisWohnen | VerbrauchsausweisGewerbe | BedarfsausweisWohnen, rechnung: Rechnung, ausweisart: Enums.Ausweisart) {
|
export function getPaymentInvoiceBody(ausweis: VerbrauchsausweisWohnen | VerbrauchsausweisGewerbe | BedarfsausweisWohnen, rechnung: Rechnung, ausweisart: Enums.Ausweisart) {
|
||||||
const id = shortenUID(ausweis.uid);
|
const id = ausweis.id;
|
||||||
|
|
||||||
let body: string = "";
|
let body: string = "";
|
||||||
|
|
||||||
@@ -262,7 +261,7 @@ export function getPaymentInvoiceBody(ausweis: VerbrauchsausweisWohnen | Verbrau
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getPaymentSuccessBody(ausweis: VerbrauchsausweisWohnen | VerbrauchsausweisGewerbe | BedarfsausweisWohnen, rechnung: Rechnung, ausweisart: Enums.Ausweisart) {
|
export function getPaymentSuccessBody(ausweis: VerbrauchsausweisWohnen | VerbrauchsausweisGewerbe | BedarfsausweisWohnen, rechnung: Rechnung, ausweisart: Enums.Ausweisart) {
|
||||||
const id = shortenUID(ausweis.uid);
|
const id = ausweis.id;
|
||||||
|
|
||||||
let body: string = "";
|
let body: string = "";
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
import { prisma } from "#lib/server/prisma.js";
|
import { prisma } from "#lib/server/prisma.js";
|
||||||
import { getAnsichtsausweis } from "../ausweis.js";
|
import { getAnsichtsausweis } from "../ausweis.js";
|
||||||
import Mail from "nodemailer/lib/mailer/index.js";
|
import Mail from "nodemailer/lib/mailer/index.js";
|
||||||
import { shortenUID } from "#server/lib/hash.js";
|
|
||||||
import { getPaymentSuccessSubject } from "./helpers.js";
|
import { getPaymentSuccessSubject } from "./helpers.js";
|
||||||
import { getPaymentInvoiceBody } from "./helpers.js";
|
import { getPaymentInvoiceBody } from "./helpers.js";
|
||||||
|
|
||||||
@@ -33,7 +32,7 @@ export async function sendInvoiceMail(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ausweisart = getAusweisartFromUUID(ausweis.uid);
|
const ausweisart = getAusweisartFromUUID(ausweis.id);
|
||||||
|
|
||||||
if (!ausweisart) {
|
if (!ausweisart) {
|
||||||
return
|
return
|
||||||
@@ -41,8 +40,7 @@ export async function sendInvoiceMail(
|
|||||||
|
|
||||||
const attachments: Mail.Attachment[] = [];
|
const attachments: Mail.Attachment[] = [];
|
||||||
|
|
||||||
const id = shortenUID(ausweis.uid)
|
const id = ausweis.id;
|
||||||
|
|
||||||
|
|
||||||
if (ausweisart != Enums.Ausweisart.BedarfsausweisWohnen && ausweis.ausweistyp === Enums.AusweisTyp.Standard) {
|
if (ausweisart != Enums.Ausweisart.BedarfsausweisWohnen && ausweis.ausweistyp === Enums.AusweisTyp.Standard) {
|
||||||
const ansichtsausweis = await getAnsichtsausweis(
|
const ansichtsausweis = await getAnsichtsausweis(
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import {
|
|||||||
import { prisma } from "#lib/server/prisma.js";
|
import { prisma } from "#lib/server/prisma.js";
|
||||||
import { getAnsichtsausweis } from "../ausweis.js";
|
import { getAnsichtsausweis } from "../ausweis.js";
|
||||||
import Mail from "nodemailer/lib/mailer/index.js";
|
import Mail from "nodemailer/lib/mailer/index.js";
|
||||||
import { shortenUID } from "#server/lib/hash.js";
|
|
||||||
import { getPaymentSuccessSubject } from "./helpers.js";
|
import { getPaymentSuccessSubject } from "./helpers.js";
|
||||||
import { getPaymentSuccessBody } from "./helpers.js";
|
import { getPaymentSuccessBody } from "./helpers.js";
|
||||||
|
|
||||||
@@ -33,7 +32,7 @@ export async function sendPaymentSuccessMail(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let info: string = "";
|
let info: string = "";
|
||||||
const ausweisart = getAusweisartFromUUID(ausweis.uid);
|
const ausweisart = getAusweisartFromUUID(ausweis.id);
|
||||||
|
|
||||||
if (!ausweisart) {
|
if (!ausweisart) {
|
||||||
return;
|
return;
|
||||||
@@ -41,7 +40,7 @@ export async function sendPaymentSuccessMail(
|
|||||||
|
|
||||||
const attachments: Mail.Attachment[] = [];
|
const attachments: Mail.Attachment[] = [];
|
||||||
|
|
||||||
const id = shortenUID(ausweis.uid)
|
const id = ausweis.id
|
||||||
|
|
||||||
if (ausweisart != Enums.Ausweisart.BedarfsausweisWohnen && ausweis.ausweistyp === Enums.AusweisTyp.Standard) {
|
if (ausweisart != Enums.Ausweisart.BedarfsausweisWohnen && ausweis.ausweistyp === Enums.AusweisTyp.Standard) {
|
||||||
const ansichtsausweis = await getAnsichtsausweis(
|
const ansichtsausweis = await getAnsichtsausweis(
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { BASE_URI } from "#lib/constants";
|
|||||||
import { transport } from "#lib/mail";
|
import { transport } from "#lib/mail";
|
||||||
import { getPrismaAusweisAdapter } from "#lib/server/ausweis";
|
import { getPrismaAusweisAdapter } from "#lib/server/ausweis";
|
||||||
import { getCurrentUser } from "#lib/server/user";
|
import { getCurrentUser } from "#lib/server/user";
|
||||||
import { shortenUID } from "#server/lib/hash.js";
|
|
||||||
|
|
||||||
const user = await getCurrentUser(Astro)
|
const user = await getCurrentUser(Astro)
|
||||||
const uid = Astro.url.searchParams.get("uid");
|
const uid = Astro.url.searchParams.get("uid");
|
||||||
@@ -23,7 +22,7 @@ const ausweis = await adapter.findUnique({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const id = shortenUID(ausweis.uid);
|
const id = ausweis.id;
|
||||||
|
|
||||||
if (!ausweis) {
|
if (!ausweis) {
|
||||||
return Astro.redirect("/")
|
return Astro.redirect("/")
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* Kürzt eine UUID auf 6 Zeichen indem es die ersten 6 Zeichen dieser UUID benutzt.
|
|
||||||
* @param uid Die UID
|
|
||||||
* @returns Eine gekürzte Version der UID
|
|
||||||
*/
|
|
||||||
export function shortenUID(uid: string) {
|
|
||||||
return uid.split("-")[1].slice(0, 6).toUpperCase();
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user