diff --git a/backend/prisma/migrations/20260709100000_bankcard_description/migration.sql b/backend/prisma/migrations/20260709100000_bankcard_description/migration.sql new file mode 100644 index 00000000..7249639b --- /dev/null +++ b/backend/prisma/migrations/20260709100000_bankcard_description/migration.sql @@ -0,0 +1,6 @@ +-- Optionale Freitext-Beschreibung pro Bankkarte (z.B. "Geschäftskonto", +-- "gemeinsames Konto mit Partner"). TEXT statt VARCHAR, weil Notizen +-- gelegentlich länger werden dürfen. + +ALTER TABLE `BankCard` + ADD COLUMN IF NOT EXISTS `description` TEXT NULL; diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma index dd38756c..c09aa4ac 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema.prisma @@ -327,6 +327,7 @@ model BankCard { bankName String? expiryDate DateTime? documentPath String? // Pfad zur hochgeladenen PDF + description String? @db.Text // Freitext-Notiz (z.B. "Geschäftskonto", "gemeinsames Konto mit Partner") isActive Boolean @default(true) contracts Contract[] createdAt DateTime @default(now()) diff --git a/backend/src/services/customer.service.ts b/backend/src/services/customer.service.ts index 0ffe80ce..91961b81 100644 --- a/backend/src/services/customer.service.ts +++ b/backend/src/services/customer.service.ts @@ -317,6 +317,7 @@ export async function createBankCard( bic?: string; bankName?: string; expiryDate?: Date; + description?: string; } ) { return prisma.bankCard.create({ @@ -336,6 +337,7 @@ export async function updateBankCard( bic?: string; bankName?: string; expiryDate?: Date; + description?: string; isActive?: boolean; } ) { diff --git a/frontend/src/pages/customers/CustomerDetail.tsx b/frontend/src/pages/customers/CustomerDetail.tsx index 788c3d28..d5b31b84 100644 --- a/frontend/src/pages/customers/CustomerDetail.tsx +++ b/frontend/src/pages/customers/CustomerDetail.tsx @@ -961,6 +961,11 @@ function BankCardsTab({ Gültig bis: {formatDate(card.expiryDate)}
)} + {card.description && ( ++ {card.description} +
+ )} {/* Dokument-Upload Bereich */}