again updated
This commit is contained in:
@@ -135,10 +135,22 @@ model ServiceLine {
|
||||
toothNumber String?
|
||||
toothSurface String?
|
||||
billedAmount Float
|
||||
status ServiceLineStatus @default(UNPAID)
|
||||
|
||||
claim Claim @relation(fields: [claimId], references: [id], onDelete: Cascade)
|
||||
servicePayments ServiceLinePayment[]
|
||||
}
|
||||
|
||||
enum ServiceLineStatus {
|
||||
PENDING
|
||||
PARTIALLY_PAID
|
||||
PAID
|
||||
UNPAID
|
||||
ADJUSTED
|
||||
OVERPAID
|
||||
DENIED
|
||||
}
|
||||
|
||||
model InsuranceCredential {
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
@@ -201,7 +213,6 @@ model Payment {
|
||||
claim Claim @relation(fields: [claimId], references: [id], onDelete: Cascade)
|
||||
updatedBy User? @relation("PaymentUpdatedBy", fields: [updatedById], references: [id])
|
||||
transactions PaymentTransaction[]
|
||||
servicePayments ServiceLinePayment[]
|
||||
|
||||
@@index([id])
|
||||
@@index([claimId])
|
||||
@@ -219,19 +230,23 @@ model PaymentTransaction {
|
||||
notes String?
|
||||
createdAt DateTime @default(now())
|
||||
payment Payment @relation(fields: [paymentId], references: [id], onDelete: Cascade)
|
||||
serviceLinePayments ServiceLinePayment[]
|
||||
|
||||
@@index([paymentId])
|
||||
}
|
||||
|
||||
model ServiceLinePayment {
|
||||
id Int @id @default(autoincrement())
|
||||
paymentId Int
|
||||
transactionId Int
|
||||
serviceLineId Int
|
||||
paidAmount Decimal @db.Decimal(10, 2)
|
||||
adjustedAmount Decimal @default(0.00) @db.Decimal(10, 2)
|
||||
notes String?
|
||||
payment Payment @relation(fields: [paymentId], references: [id], onDelete: Cascade)
|
||||
|
||||
transaction PaymentTransaction @relation(fields: [transactionId], references: [id], onDelete: Cascade)
|
||||
serviceLine ServiceLine @relation(fields: [serviceLineId], references: [id], onDelete: Cascade)
|
||||
@@index([paymentId])
|
||||
|
||||
@@index([transactionId])
|
||||
@@index([serviceLineId])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user