Login Popup zu Kundendaten bewegt

This commit is contained in:
Moritz Utcke
2025-02-20 21:25:38 +11:00
parent eac6f0c035
commit 927f0157be
35 changed files with 719 additions and 692 deletions

View File

@@ -9,7 +9,7 @@ import {
} from "#lib/middleware/authorization.js";
import { UUidWithPrefix } from "#components/Ausweis/types.js";
import { getPrismaAusweisAdapter } from "#lib/server/ausweis.js";
import { AusweisTyp, PRICES, SERVICES } from "#lib/constants.js";
import { PRICES, SERVICES } from "#lib/constants.js";
export const PUT = defineApiRoute({
meta: {
@@ -23,7 +23,7 @@ export const PUT = defineApiRoute({
.object({
ausweisart: z.nativeEnum(Enums.Ausweisart),
ausweis_uid: UUidWithPrefix,
ausweis_typ: z.nativeEnum(AusweisTyp)
ausweistyp: z.nativeEnum(Enums.AusweisTyp)
})
.merge(
RechnungSchema.omit({
@@ -49,8 +49,8 @@ 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, ausweis_typ } = input;
let betrag = PRICES[ausweisart][ausweis_typ]
const { ausweis_uid, ausweisart, bezahlmethode, services, ausweistyp } = input;
let betrag = PRICES[ausweisart][ausweistyp]
const servicePriceList = SERVICES[ausweisart]
for (const service of input.services) {
@@ -94,6 +94,8 @@ export const PUT = defineApiRoute({
bezahlmethode: bezahlmethode,
status: Enums.Rechnungsstatus.open,
aufnahme_id: ausweis.aufnahme_id,
services,
ausweistyp
},
select: {
uid: true,