Bedarfsausweis gewerbe

This commit is contained in:
Moritz Utcke
2025-03-12 18:14:13 -03:00
parent 5f5cdc5728
commit 00015b30cd
32 changed files with 1182 additions and 108 deletions

View File

@@ -10,7 +10,7 @@ import {
import { prisma } from "#lib/server/prisma.js";
import { getAnsichtsausweis } from "../ausweis.js";
import Mail from "nodemailer/lib/mailer/index.js";
import { sqids } from "#client/lib/helpers.js";
import { shortenUID } from "#server/lib/hash.js";
export async function sendInvoiceMail(
ausweis: VerbrauchsausweisWohnen,
@@ -35,6 +35,9 @@ export async function sendInvoiceMail(
const attachments: Mail.Attachment[] = [];
const id = shortenUID(ausweis.uid)
if (ausweisart != Enums.Ausweisart.BedarfsausweisWohnen) {
const ansichtsausweis = await getAnsichtsausweis(
ausweis,
@@ -48,7 +51,7 @@ export async function sendInvoiceMail(
if (ansichtsausweis) {
attachments.push(
{
filename: `ID_${ausweis.id}_Ansichtsausweis.pdf`,
filename: `ID_${id}_Ansichtsausweis.pdf`,
encoding: "binary",
content: Buffer.from(ansichtsausweis),
contentType: "application/pdf",
@@ -62,7 +65,7 @@ export async function sendInvoiceMail(
attachments,
from: `"IBCornelsen" <info@online-energieausweis.org>`,
to: user.email,
subject: `Bestellbestätigung vom IBCornelsen (ID: ${ausweis.id})`,
subject: `Bestellbestätigung vom IBCornelsen (ID: ${id})`,
cc: {
address: rechnung.email || "",
name: rechnung.empfaenger || "",