Adding a task generated from the account balance to products
This commit is contained in:
@@ -647,6 +647,7 @@ model Product {
|
||||
quoteLineItems QuoteLineItem[]
|
||||
invoiceLineItems InvoiceLineItem[]
|
||||
stockMovements StockMovement[]
|
||||
accountingLinks ProductAccountingLink[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@ -1316,6 +1317,7 @@ model AccountingConnection {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
personLinks PersonAccountingLink[]
|
||||
productLinks ProductAccountingLink[]
|
||||
documentLogs AccountingDocumentLog[]
|
||||
balanceCaches AccountingBalanceCache[]
|
||||
|
||||
@@ -1346,6 +1348,29 @@ model PersonAccountingLink {
|
||||
@@index([connectionId])
|
||||
}
|
||||
|
||||
/// لینک محصول CRM ↔ نام کارساخته (یا معادل) در تهحساب
|
||||
model ProductAccountingLink {
|
||||
id String @id @default(cuid())
|
||||
productId String
|
||||
product Product @relation(fields: [productId], references: [id], onDelete: Cascade)
|
||||
connectionId String
|
||||
connection AccountingConnection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
|
||||
/// نام کارساخته در تهحساب (DoListNameKarsakhte.Name)
|
||||
externalName String
|
||||
ayar Int?
|
||||
vaznSabet Float?
|
||||
/// import | manual
|
||||
matchMethod String @default("import")
|
||||
linkedAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([productId, connectionId])
|
||||
@@unique([connectionId, externalName])
|
||||
@@index([productId])
|
||||
@@index([connectionId])
|
||||
}
|
||||
|
||||
model AccountingDocumentLog {
|
||||
id String @id @default(cuid())
|
||||
connectionId String
|
||||
|
||||
Reference in New Issue
Block a user