feat(bank-accounts): add transaction retrieval and update service logic

- Implemented a new endpoint to fetch transactions for a specific bank account.
- Refactored the bank account service to streamline transaction handling and balance calculations.
- Removed the bank account balance table and adjusted related logic in workflows and services.
- Enhanced transaction mapping to include references to sales and purchase records.
This commit is contained in:
2026-01-05 18:35:08 +03:30
parent fda190f902
commit b05048e62f
14 changed files with 147 additions and 1525 deletions
@@ -0,0 +1,11 @@
/*
Warnings:
- You are about to drop the `Bank_Account_Balance` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `Bank_Account_Balance` DROP FOREIGN KEY `Bank_Account_Balance_bankAccountId_fkey`;
-- DropTable
DROP TABLE `Bank_Account_Balance`;
-11
View File
@@ -29,7 +29,6 @@ model BankAccount {
inventoryBankAccounts InventoryBankAccount[]
purchaseReceiptPayments PurchaseReceiptPayments[]
bankAccountTransactions BankAccountTransaction[]
bankAccountBalances BankAccountBalance[]
@@map("Bank_Accounts")
}
@@ -50,13 +49,3 @@ model BankAccountTransaction {
@@index([bankAccountId])
@@map("Bank_Account_Transactions")
}
model BankAccountBalance {
bankAccountId Int @unique
balance Decimal @db.Decimal(15, 2)
updatedAt DateTime @updatedAt @db.Timestamp(0)
bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])
@@map("Bank_Account_Balance")
}