added payment page with invoice tracking

This commit is contained in:
Rajpreet0 2026-08-07 13:19:32 +02:00
parent 4e48871547
commit 9927b74781
21 changed files with 2568 additions and 4 deletions

View file

@ -0,0 +1,8 @@
-- AlterTable
ALTER TABLE "Business" ADD COLUMN "invoiceCounter" INTEGER NOT NULL DEFAULT 0;
-- AlterTable
ALTER TABLE "CourseBooking" ADD COLUMN "invoiceNumber" TEXT;
-- CreateIndex
CREATE UNIQUE INDEX "CourseBooking_invoiceNumber_key" ON "CourseBooking"("invoiceNumber");

View file

@ -101,6 +101,7 @@ model Business {
isPublic Boolean @default(false)
stripeAccountId String? @unique // Stripe Connect Account ID
stripeAccountStatus String? // "pending" | "active" | "restricted"
invoiceCounter Int @default(0) // Fortlaufender Zähler für Rechnungsnummern
manager Manager @relation(fields: [managerId], references: [id])
courses Course[]
createdAt DateTime @default(now())
@ -175,6 +176,7 @@ model CourseBooking {
stripePaymentIntentId String? @unique
amountPaid Int? // tatsächlich gezahlter Betrag in Cents
platformFee Int? // unsere Service-Fee in Cents
invoiceNumber String? @unique // Rechnungsnummer, wird lazy beim ersten PDF-Download vergeben
course Course @relation(fields: [courseId], references: [id], onDelete: Cascade)
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
guestLead GuestLead? @relation(fields: [guestLeadId], references: [id], onDelete: SetNull)