feat(customer): add bank account details support

This commit is contained in:
DanielS
2026-07-03 09:46:47 +02:00
parent 250dd82847
commit f5f577ea73
10 changed files with 86 additions and 1 deletions

View File

@@ -174,6 +174,10 @@ export async function adminCreateEndCustomer(data: {
zip?: string
city?: string
email?: string
bank_iban?: string
bank_bic?: string
bank_name?: string
bank_owner?: string
}) {
const admin = createAdminClient()
const { data: dbData, error } = await admin
@@ -188,6 +192,10 @@ export async function adminCreateEndCustomer(data: {
zip: data.zip || null,
city: data.city || null,
email: data.email || null,
bank_iban: data.bank_iban || null,
bank_bic: data.bank_bic || null,
bank_name: data.bank_name || null,
bank_owner: data.bank_owner || null,
}])
.select()
.single()
@@ -205,6 +213,10 @@ export async function adminUpdateEndCustomer(id: string, data: {
zip?: string
city?: string
email?: string
bank_iban?: string
bank_bic?: string
bank_name?: string
bank_owner?: string
}) {
const admin = createAdminClient()
const { data: dbData, error } = await admin
@@ -219,6 +231,10 @@ export async function adminUpdateEndCustomer(id: string, data: {
zip: data.zip || null,
city: data.city || null,
email: data.email || null,
bank_iban: data.bank_iban || null,
bank_bic: data.bank_bic || null,
bank_name: data.bank_name || null,
bank_owner: data.bank_owner || null,
})
.eq('id', id)
.select()

View File

@@ -16,6 +16,10 @@ export type EndCustomerFormData = {
zip?: string
city?: string
email?: string
bank_iban?: string
bank_bic?: string
bank_name?: string
bank_owner?: string
}
// ─── Lesen ───────────────────────────────────────────────────────────────────
@@ -74,6 +78,10 @@ export async function createEndCustomer(formData: EndCustomerFormData): Promise<
zip: formData.zip || null,
city: formData.city || null,
email: formData.email || null,
bank_iban: formData.bank_iban || null,
bank_bic: formData.bank_bic || null,
bank_name: formData.bank_name || null,
bank_owner: formData.bank_owner || null,
}])
.select()
.single()
@@ -104,6 +112,10 @@ export async function updateEndCustomer(id: string, formData: EndCustomerFormDat
zip: formData.zip || null,
city: formData.city || null,
email: formData.email || null,
bank_iban: formData.bank_iban || null,
bank_bic: formData.bank_bic || null,
bank_name: formData.bank_name || null,
bank_owner: formData.bank_owner || null,
})
.eq('id', id)
@@ -138,6 +150,10 @@ export async function anonymizeEndCustomer(id: string): Promise<void> {
zip: null,
city: null,
email: null,
bank_iban: null,
bank_bic: null,
bank_name: null,
bank_owner: null,
is_anonymized: true,
})
.eq('id', id)