Commit Graph

26 Commits

Author SHA1 Message Date
ahasani c7cd7cd855 refactor: remove console logs, update SaleInvoicePayload interface, and enhance GoodCategoriesService response mapping 2026-02-17 20:16:36 +03:30
ahasani 55b96d4f79 feat: update validation and exception handling, refactor controller routes, and enhance sales invoice item DTO
- Removed global validation pipe and added a new ValidationExceptionFilter for better error handling.
- Refactored controller routes to use underscores instead of hyphens for consistency.
- Updated CreateSalesInvoiceItemDto to include new fields: quantity, unit_type, and payload.
- Modified CreateSalesInvoiceDto to enforce items as an array with a minimum size.
- Added Enums module to provide gold karat values through a dedicated endpoint.
- Introduced new columns in the database schema for sales invoice items and goods.
2026-02-16 20:51:34 +03:30
ahasani a073af76fe feat: add config module with controller and service
- Implemented ConfigController for handling config-related requests.
- Created ConfigService for business logic related to configurations.
- Added CreateConfigDto for validating configuration data.

feat: add good categories module with controller and service

- Implemented GoodCategoriesController for managing good categories.
- Created GoodCategoriesService for business logic related to good categories.
- Added CreateGoodCategoryDto for validating good category data.

feat: add goods module with controller and service

- Implemented GoodsController for managing goods.
- Created GoodsService for business logic related to goods.
- Added CreateGoodDto for validating good data.

feat: add profile module with controller and service

- Implemented ProfileController for managing user profiles.
- Created ProfileService for business logic related to profiles.
- Added CreateProfileDto for profile data structure.

feat: add sales invoice payments module with controller and service

- Implemented SalesInvoicePaymentsController for managing invoice payments.
- Created SalesInvoicePaymentsService for business logic related to payments.
- Added CreateSalesInvoicePaymentDto for validating payment data.

feat: add service categories module with controller and service

- Implemented ServiceCategoriesController for managing service categories.
- Created ServiceCategoriesService for business logic related to service categories.
- Added CreateServiceCategoryDto for validating service category data.

feat: add services module with controller and service

- Implemented ServicesController for managing services.
- Created ServicesService for business logic related to services.
- Added CreateServiceDto for validating service data.

feat: add trigger logs module with controller and service

- Implemented TriggerLogsController for managing trigger logs.
- Created TriggerLogsService for business logic related to trigger logs.
- Added CreateTriggerLogDto for validating trigger log data.

feat: add uploaders module for handling file uploads

- Implemented UploadersController for managing file uploads.
- Created ImageUploaderService for image upload logic.
- Created UploaderService for file handling and storage.
2026-02-12 20:31:04 +03:30
ahasani de14d531e1 init 2026-02-04 13:49:07 +03:30
ahasani 5fd6611aca feat: implement POS order management system
- Added CreateOrderDto and CreateOrderItemDto for order creation.
- Developed PosOrdersController to handle order-related endpoints.
- Created PosOrdersService for business logic related to orders.
- Implemented PosOrdersWorkflow for order processing workflows.
- Established Prisma integration for database operations in orders.
- Introduced SalesInvoicesModule and related DTOs for sales invoice management.
- Enhanced SalesInvoicesService and SalesInvoicesWorkflow for invoice processing.
2026-01-07 15:25:59 +03:30
ahasani b05048e62f 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.
2026-01-05 18:35:08 +03:30
ahasani fda190f902 refactor: restructure purchase receipts module and related workflows
- Removed old DTOs for creating and updating purchase receipts.
- Updated purchase receipts controller and service to use new DTOs and workflows.
- Introduced transaction helper for managing database transactions.
- Added new workflows for handling purchase receipt payments and supplier ledgers.
- Implemented new logic for managing purchase receipt items and payments.
- Enhanced error handling for payment processing in workflows.
- Updated supplier ledger management to reflect changes in purchase receipts.
2026-01-05 10:07:23 +03:30
ahasani a2db2daa70 feat(statistics): implement top alert stocks, top last sales, top supplier debts, and top selling products endpoints with SQL queries 2026-01-04 13:45:26 +03:30
ahasani eb6e0e7a0d feat(inventories): add cardex retrieval for inventory and product
feat(pos): update sale invoice creation to include customer and item details
feat(pos): enhance POS account service to include today's sales information
feat(pos): refactor order DTO to create sale invoice with detailed item structure
feat(products): add minimum stock alert level to product creation and update DTOs
fix(triggers): implement stock validation and movement logging for sales invoice items
refactor(database): update sales invoices schema to include posAccountId and remove inventoryId
2025-12-30 21:04:01 +03:30
ahasani 1bb206a608 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.
2025-12-29 10:14:56 +03:30
ahasani b35a3633ed feat(pos): update createOrder method to accept posId and retrieve inventoryId 2025-12-28 17:52:07 +03:30
ahasani af9695e23c 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.
2025-12-27 20:34:00 +03:30
ahasani d98507fc1f fix: update SupplierLedger model to use correct enum casing and adjust types
feat: enhance PosAccountsService to include inventoryBankAccount details in responses

refactor: modify PosService to return structured inventory and bank account data

chore: remove isSettled field from CreatePurchaseReceiptDto and adjust related logic

feat: add payments selection in SuppliersService for better payment tracking

chore: apply database migrations to adjust decimal types and enforce constraints

chore: create index on Pos_Accounts for improved query performance

feat: define Supplier and SupplierLedger models in Prisma schema for better data management
2025-12-26 22:09:46 +03:30
ahasani d59be5995d feat(pos): update POS controller and service to handle posId for stock and product categories 2025-12-26 16:47:34 +03:30
ahasani b4f226fb3a 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.
2025-12-26 01:20:03 +03:30
ahasani cbe51b9343 feat: implement bank accounts, branches, and banks modules with CRUD operations
- Added BankAccountsController, BankAccountsService, and related DTOs for managing bank accounts.
- Implemented BankBranchesController, BankBranchesService, and related DTOs for managing bank branches.
- Created BanksController and BanksService for retrieving bank information.
- Integrated Prisma for database operations across all modules.
- Added response mapping for consistent API responses.
2025-12-24 21:24:59 +03:30
ahasani 89c57a69c1 feat(cardex): enhance stock movement retrieval with additional fields and optimized mapping
refactor(migration): update Stock_Movements table to include counterInventoryId and customerId, add foreign key constraints, and implement triggers for inventory management
2025-12-23 20:35:44 +03:30
ahasani c6a86719dd feat(cardex): implement cardex controller, service, and DTO for stock movements
feat(pos): add POS controller and service for order creation and stock retrieval
refactor(pos): enhance stock and product category retrieval with pagination and mapping
2025-12-21 19:09:41 +03:30
ahasani d514267f58 feat: add inventoryId to SalesInvoice and related models; implement createOrder functionality in POS service 2025-12-16 10:03:49 +03:30
ahasani 687c89c3e1 feat: add salePrice field to Product model and update related files
- Added salePrice field to Product model in Prisma schema and generated files.
- Updated Product scalar field enums in both TypeScript files.
- Modified aggregate output types to include salePrice.
- Enhanced input types for creating and updating products to support salePrice.
- Updated migration file to add salePrice column to Products table.
- Created DTOs for inventory management in POS module.
- Implemented POS controller and service with methods for stock and product categories.
2025-12-14 20:34:07 +03:30
ahasani 9d7d94b5f8 Add SQL query for average cost retrieval and generate TriggerLog model 2025-12-14 10:15:57 +03:30
ahasani 41d7dd8802 feat(database): initialize database schema and triggers
- Created initial database schema with tables for Users, Roles, Products, and related entities.
- Added foreign key constraints to maintain data integrity across tables.
- Implemented triggers for managing stock movements on insert, update, and delete operations.
- Developed scripts to dump existing triggers and pull trigger definitions from the database.
2025-12-10 16:54:08 +03:30
ahasani 807f6c2087 feat: implement purchase receipt items management with create, update, find, and delete functionalities
feat: add purchase receipts management with create, update, find, and delete functionalities

feat: implement sales invoice items management with create, update, find, and delete functionalities

feat: add sales invoices management with create, update, find, and delete functionalities

feat: implement stock adjustments management with create, update, find, and delete functionalities

feat: add stock balance retrieval functionality

feat: implement stock movements management with create, update, find, and delete functionalities
2025-12-09 13:59:07 +03:30
ahasani a782d61890 feat: add product variant management functionality
- Implemented CreateProductVariantDto and UpdateProductVariantDto for product variant data transfer.
- Developed ProductVariantsController to handle CRUD operations for product variants.
- Created ProductVariantsService to interact with the database using Prisma.
- Added ProductVariantsModule to encapsulate the product variant feature.
- Included response mapping for consistent API responses.
2025-12-06 17:48:10 +03:30
ahasani 7cb9d7d037 feat: implement supplier management module with create, update, find, and delete functionalities
- Added CreateSupplierDto for supplier creation
- Added UpdateSupplierDto for supplier updates
- Implemented SuppliersController to handle HTTP requests for suppliers
- Created SuppliersService to manage supplier data using Prisma
- Integrated SuppliersModule to encapsulate suppliers-related components
2025-12-05 00:01:44 +03:30
ahasani 621e15dd02 feat: implement inventory, product brand, product category, product info, product, role, store, user, and vendor modules with CRUD operations
- Added Create and Update DTOs for Inventory, Product Brand, Product Category, Product Info, Product, Role, Store, User, and Vendor.
- Implemented InventoriesController, ProductBrandsController, ProductCategoriesController, ProductInfoController, ProductsController, RolesController, StoresController, UsersController, and VendorsController with respective CRUD endpoints.
- Developed InventoriesService, ProductBrandsService, ProductCategoriesService, ProductInfoService, ProductsService, RolesService, StoresService, UsersService, and VendorsService to handle business logic.
- Created PrismaModule and PrismaService for database interactions using Prisma with MariaDB adapter.
- Configured application with Swagger for API documentation and added global interceptors for logging and response mapping.
- Established e2e testing setup with Jest for the application.
2025-12-04 21:05:57 +03:30