From b95af918d5d177f609d22c862d2dbc391d7c4eff Mon Sep 17 00:00:00 2001 From: Potenz Date: Sat, 9 Aug 2025 00:21:06 +0530 Subject: [PATCH] update 4 payment --- packages/db/prisma/schema.prisma | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index 46e328f..64dd63d 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -138,9 +138,10 @@ model ServiceLine { billedAmount Float totalPaid Decimal @default(0.00) @db.Decimal(10, 2) totalAdjusted Decimal @default(0.00) @db.Decimal(10, 2) + totalDue Decimal @default(0.00) @db.Decimal(10, 2) status ServiceLineStatus @default(UNPAID) - claim Claim @relation(fields: [claimId], references: [id], onDelete: Cascade) + claim Claim @relation(fields: [claimId], references: [id], onDelete: Cascade) serviceLineTransactions ServiceLineTransaction[] } @@ -198,22 +199,22 @@ enum PdfCategory { } model Payment { - id Int @id @default(autoincrement()) - claimId Int @unique - patientId Int - userId Int - updatedById Int? - totalBilled Decimal @db.Decimal(10, 2) - totalPaid Decimal @default(0.00) @db.Decimal(10, 2) - totalDue Decimal @db.Decimal(10, 2) - status PaymentStatus @default(PENDING) - notes String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + id Int @id @default(autoincrement()) + claimId Int @unique + patientId Int + userId Int + updatedById Int? + totalBilled Decimal @db.Decimal(10, 2) + totalPaid Decimal @default(0.00) @db.Decimal(10, 2) + totalDue Decimal @db.Decimal(10, 2) + status PaymentStatus @default(PENDING) + notes String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - claim Claim @relation(fields: [claimId], references: [id], onDelete: Cascade) - patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade) - updatedBy User? @relation("PaymentUpdatedBy", fields: [updatedById], references: [id]) + claim Claim @relation(fields: [claimId], references: [id], onDelete: Cascade) + patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade) + updatedBy User? @relation("PaymentUpdatedBy", fields: [updatedById], references: [id]) transactions ServiceLineTransaction[] @@index([id])