Merge origin/main into origin/dev-moritz

This commit is contained in:
Moritz Utcke
2025-01-12 14:25:35 +07:00
parent f16fb41db0
commit f8402a0136
54 changed files with 4907 additions and 130 deletions

View File

@@ -1,11 +1,7 @@
---
import { generate } from "@pdfme/generator";
import VerbrauchsausweisWohnen2016Template from "../../data/templates/verbrauchsausweis-wohnen-2016.json";
import { convertAusweisData } from "#lib/AusweisData";
import { variable } from "#lib/pdf/plugins/variables";
import { text, image } from "@pdfme/schemas"
import { VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
import { BenutzerClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
import { createCaller } from "#lib/caller";
import { pdfDatenblatt } from "#lib/pdf/pdfDatenblatt";
const base64 = Astro.url.searchParams.get("base64");
let ausweis: VerbrauchsausweisWohnenClient | null = null;
@@ -24,25 +20,11 @@ if (base64) {
ausweis = await caller.v1.verbrauchsausweisWohnen.get({
uid: uidAusweis
})
});
}
if (!ausweis) {
return Astro.redirect("/404");
}
const pdf = await pdfDatenblatt(ausweis);
const pdf = await generate({
template: VerbrauchsausweisWohnen2016Template,
plugins: { text, image, variable },
inputs: [convertAusweisData(ausweis)],
options: {
author: "IB Cornelsen",
creationDate: new Date(),
creator: "IB Cornelsen",
language: "de",
title: "Verbrauchsausweis Wohnen 2016",
},
});
return new Response(pdf, {
headers: {