model Supplier { id Int @id @default(autoincrement()) firstName String @db.VarChar(255) lastName String @db.VarChar(255) email String? @db.VarChar(255) mobileNumber String @unique @db.Char(11) address String? @db.Text city String? @db.VarChar(100) state String? @db.VarChar(100) country String? @db.VarChar(100) isActive Boolean @default(true) createdAt DateTime @default(now()) @db.Timestamp(0) updatedAt DateTime @updatedAt @db.Timestamp(0) deletedAt DateTime? @db.Timestamp(0) stockMovements StockMovement[] @relation("StockMovement_Supplier") receipts PurchaseReceipt[] ledger SupplierLedger[] @@map("Suppliers") } model SupplierLedger { id Int @id @default(autoincrement()) description String? @db.Text debit Decimal @default(0) @db.Decimal(15, 2) credit Decimal @default(0) @db.Decimal(15, 2) balance Decimal @db.Decimal(15, 2) sourceType LedgerSourceType sourceId Int createdAt DateTime @default(now()) @db.Timestamp(0) supplierId Int supplier Supplier @relation(fields: [supplierId], references: [id]) @@index([supplierId]) @@map("Supplier_Ledger") }