feat: add bank account relation to PurchaseReceiptPayments and update related services
- Added bank account relation to PurchaseReceiptPayments model. - Updated BankAccount model to include purchaseReceiptPayments relation. - Modified PurchaseReceiptPayments service to handle bank account data during payment creation. - Enhanced SuppliersService to order suppliers by creation date. - Updated SupplierInvoicesService to include bank account details in invoice payments and order payments by payedAt. - Added foreign key constraint for bankAccountId in PurchaseReceiptPayments table.
This commit is contained in:
@@ -42,13 +42,13 @@ model PurchaseReceiptPayments {
|
||||
paymentMethod PaymentMethodType
|
||||
type PaymentType
|
||||
bankAccountId Int
|
||||
inventoryId Int
|
||||
receiptId Int
|
||||
payedAt DateTime @db.Timestamp(0)
|
||||
description String? @db.Text
|
||||
createdAt DateTime @default(now()) @db.Timestamp(0)
|
||||
|
||||
receipt PurchaseReceipt @relation(fields: [receiptId], references: [id])
|
||||
receipt PurchaseReceipt @relation(fields: [receiptId], references: [id])
|
||||
bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])
|
||||
|
||||
@@index([receiptId], map: "Purchase_Receipt_Payments_receiptId_fkey")
|
||||
@@map("Purchase_Receipt_Payments")
|
||||
|
||||
Reference in New Issue
Block a user