refactor(inventories): restructure inventory and pos account modules, remove deprecated DTOs and controllers

- Removed create and update DTOs for inventory.
- Deleted inventories controller and service.
- Introduced new inventory bank accounts module with controller and service.
- Added new pos accounts module with controller and service.
- Updated Prisma models to reflect changes in bank account relationships.
- Adjusted PosAccount and SalesInvoice models for stricter type definitions.
- Implemented new response mapping for inventory and pos account services.
This commit is contained in:
2025-12-26 01:20:03 +03:30
parent cbe51b9343
commit b4f226fb3a
29 changed files with 466 additions and 637 deletions
@@ -0,0 +1,18 @@
/*
Warnings:
- You are about to drop the column `bankAccountId` on the `Inventories` table. All the data in the column will be lost.
- You are about to drop the `_Bank_Accounts_inventoryId_fkey` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `_Bank_Accounts_inventoryId_fkey` DROP FOREIGN KEY `_Bank_Accounts_inventoryId_fkey_A_fkey`;
-- DropForeignKey
ALTER TABLE `_Bank_Accounts_inventoryId_fkey` DROP FOREIGN KEY `_Bank_Accounts_inventoryId_fkey_B_fkey`;
-- AlterTable
ALTER TABLE `Inventories` DROP COLUMN `bankAccountId`;
-- DropTable
DROP TABLE `_Bank_Accounts_inventoryId_fkey`;
+1 -2
View File
@@ -19,14 +19,13 @@ model BankAccount {
accountNumber String? @unique @db.VarChar(20)
cardNumber String? @unique @db.VarChar(16)
name String @db.VarChar(255)
iban String? @db.VarChar(34)
iban String? @unique @db.VarChar(34)
branchId Int
createdAt DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0)
deletedAt DateTime? @db.Timestamp(0)
branch BankBranch @relation("Bank_Accounts_branchId_fkey", fields: [branchId], references: [id])
inventories Inventory[] @relation("Bank_Accounts_inventoryId_fkey")
purchaseReceiptPayments PurchaseReceiptPayments[]
posAccounts PosAccount[]
inventoryBankAccounts InventoryBankAccount[] @relation("Inventory_Bank_Accounts_bankAccountId_fkey")
+1 -3
View File
@@ -16,8 +16,6 @@ model Inventory {
stockBalances StockBalance[] @relation("StockBalance_inventory")
counterStockMovements StockMovement[] @relation("StockMovement_CounterInventory")
stockMovements StockMovement[] @relation("StockMovement_Inventory")
bankAccountId Int?
bankAccounts BankAccount[] @relation("Bank_Accounts_inventoryId_fkey")
posAccounts PosAccount[] @relation("Inventory_PosAccounts")
inventoryBankAccounts InventoryBankAccount[] @relation("Inventory_Bank_Accounts_inventoryId_fkey")
@@ -71,7 +69,7 @@ model PosAccount {
name String @db.VarChar(255)
code String @unique() @db.VarChar(10)
description String? @db.VarChar(500)
bankAccountId Int?
bankAccountId Int
inventoryId Int
createdAt DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0)