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