refactor: restructure suppliers module and update DTOs

- Removed old supplier DTOs and controller, replacing them with new implementations.
- Introduced new CreateSupplierDto and UpdateSupplierDto in the index directory.
- Updated SuppliersController to handle new routes and methods.
- Implemented SuppliersService with updated logic for creating, finding, updating, and removing suppliers.
- Added new invoices module with corresponding controller and service for handling invoice-related operations.
- Created new DTOs for handling receipt payments and updated the service to manage payment creation and retrieval.
- Updated Prisma migrations to reflect changes in the database schema, including dropping unnecessary columns.
This commit is contained in:
2025-12-27 20:34:00 +03:30
parent d98507fc1f
commit af9695e23c
27 changed files with 636 additions and 575 deletions
+5 -6
View File
@@ -24,10 +24,10 @@ model PurchaseReceiptItem {
count Decimal @db.Decimal(10, 0)
fee Decimal @db.Decimal(15, 2)
total Decimal @db.Decimal(15, 2)
description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0)
receiptId Int
productId Int
description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0)
product Product @relation("Product_PurchaseReceiptItems", fields: [productId], references: [id])
receipt PurchaseReceipt @relation("PurchaseReceipt_Items", fields: [receiptId], references: [id])
@@ -43,13 +43,12 @@ model PurchaseReceiptPayments {
type PaymentType
bankAccountId Int
inventoryId Int
description String? @db.Text
payedAt DateTime @db.Timestamp(0)
receiptId Int
payedAt DateTime @db.Timestamp(0)
description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0)
purchaseReceipt PurchaseReceipt @relation(fields: [receiptId], references: [id])
inventoryBankAccount InventoryBankAccount @relation(fields: [inventoryId, bankAccountId], references: [inventoryId, bankAccountId])
receipt PurchaseReceipt @relation(fields: [receiptId], references: [id])
@@index([receiptId], map: "Purchase_Receipt_Payments_receiptId_fkey")
@@map("Purchase_Receipt_Payments")