Commit Graph

108 Commits

Author SHA1 Message Date
ahasani f94a108948 feat: update activation expiration handling and enhance payload structure in transaction services 2026-06-15 21:35:53 +03:30
ahasani d51b677f26 feat: update invoice processing to use last_tsp_status for status mapping 2026-06-15 19:34:21 +03:30
ahasani 9170d8cd5a feat: enhance sales invoice processing with correction and return functionalities 2026-06-15 17:14:54 +03:30
ahasani 5f70b95589 feat: refactor sales invoice services and introduce pagination and filtering
- Added SharedSaleInvoicePaginationService for handling pagination logic.
- Introduced SharedSaleInvoiceFilterService to centralize filtering logic for sales invoices.
- Updated SalesInvoicesService to utilize the new pagination and filtering services.
- Refactored findAll methods in SalesInvoicesService, CustomerSaleInvoicesService, and other related services to support pagination and filtering.
- Enhanced DTOs for sales invoice filtering to extend shared filter properties.
- Updated module imports to include new services.
- Cleaned up redundant code related to filtering and pagination across various services.
2026-06-14 16:34:00 +03:30
ahasani d2bd576277 feat(pos): enhance password update process with current password validation 2026-06-11 17:53:08 +03:30
ahasani 23bfe1ecbe Refactor: Remove stored procedures and replace with direct database operations
feat: Add economic code and guild information to sales invoice selection

fix: Update error messages for invoice access and creation to use "صورت‌حساب"

fix: Change error messages in SaleInvoicesService to use "صورت‌حساب" instead of "فاکتور"

fix: Update error messages in SalesInvoicesService for not found cases to use "صورت‌حساب"

fix: Modify TSP service to handle invoice updates and error messages consistently with "صورت‌حساب"

fix: Update common DTO descriptions to refer to "صورت‌حساب" instead of "فاکتور"

fix: Adjust utility functions to handle invoice references and error messages with "صورت‌حساب"
2026-06-11 16:13:17 +03:30
ahasani 47a27fb54f feat: enhance consumer and partner middleware with Redis caching
- Added Redis caching to ConsumerMiddleware and PartnerMiddleware to improve performance by reducing database calls for consumer and partner data.
- Implemented logic to check for cached data before querying the database.
- Updated the InvoicesService to include settlement_type in the selected fields.
- Removed unnecessary console logs from CustomersService.
- Modified SalesInvoicesService to optimize query logic and improve performance.
- Updated StatisticsService to streamline data retrieval and processing.
- Created a new migration to add last_attempt_no and last_tsp_status columns to sales_invoices for better tracking of TSP attempts.
2026-06-09 13:31:58 +03:30
ahasani f61100bf25 feat: enhance CustomerIndividual and CustomerLegal models with new unique input types
feat: add cache invalidation method for POS middleware

feat: implement Redis caching in POS middleware for improved performance

feat: refactor sales invoice DTOs for POS to include correction functionality

feat: extend SalesInvoicesController to handle invoice corrections and returns

feat: update SalesInvoicesService to support invoice correction and return operations

feat: enhance TSP provider correction functionality with new DTOs and utility methods

fix: improve error handling and logging in Nama provider switch adapter

refactor: streamline invoice payload building in TSP provider utilities
2026-06-06 19:53:00 +03:30
ahasani 25e589551b refactor(accounts): rename account DTOs for clarity and consistency 2026-06-05 01:33:30 +03:30
ahasani 5ce560ce97 feat(customers): enhance customer retrieval with filtering options
- Updated `findAll` method in `CustomersController` to accept filtering parameters.
- Implemented filtering logic in `CustomersService` to retrieve customers based on type and search query.
- Added `PosCustomerFilterDto` for query validation.
- Updated customer-related DTOs to make fields optional and added length validation where necessary.
- Modified customer-related logic in `sales-invoice-tsp.utils.ts` to accommodate new DTO structure.
- Added unique constraints to `customer_individuals` and `customer_legal` tables in the database migration.
- Removed commented-out code in `PosMiddleware` for cleaner codebase.
- Set default value for `is_default_guild_good` to false in `OwnedGoodsService`.
2026-06-03 18:00:06 +03:30
ahasani b2d8fdc8a0 some updates 2026-06-01 16:22:35 +03:30
ahasani c11166b365 some update 2026-05-30 19:05:56 +03:30
ahasani 7ae027633b update migrations and create base migration. set discount and tax to sale invoices 2026-05-28 18:27:21 +03:30
ahasani a975f9d02a update migrations and create base migration. set discount and tax to sale invoices 2026-05-28 16:39:07 +03:30
ahasani cd3492d625 update get status of tsp provider 2026-05-27 22:44:01 +03:30
ahasani 816c5ebb50 update switch providers and nama provider. fix original send 2026-05-27 21:55:02 +03:30
ahasani 4836ee4d01 feat: include settlement_type in buildCorrectionPayload and buildPayload functions 2026-05-24 20:16:04 +03:30
ahasani ea6f1bfdd0 feat: add settlement_type to SalesInvoice model and related DTOs
- Added settlement_type field to SalesInvoice model with ENUM values (CASH, CREDIT, MIXED).
- Updated SalesInvoice aggregate types, input types, and where filters to include settlement_type.
- Modified StatisticsService to calculate credit amounts based on settlement_type.
- Enhanced TspProviderOriginalSendPayloadDto to include settlement_type.
- Updated NamaProvider DTOs and utility functions to handle new settlement_type logic.
- Created migration to add settlement_type column to sales_invoices table and backfill existing records.
2026-05-24 19:40:04 +03:30
ahasani b53b7d3ed3 feat(pos): add update password functionality with DTO and service method 2026-05-24 10:44:47 +03:30
ahasani 6f65123816 update enum service 2026-05-23 19:00:25 +03:30
ahasani 2c97b7302d feat(statistics): implement statistics module with controller and service for POS invoices 2026-05-23 18:09:41 +03:30
ahasani 2dc9480170 feat(invoices): add public invoices module with controller and service
refactor: remove unused trigger logs module and related files
refactor: simplify good snapshot handling in sale invoice creation
2026-05-21 21:35:36 +03:30
ahasani 9aa12184a1 refactor: streamline Redis caching logic across services
- Implemented a unified `getAndSet` method in RedisService to handle caching for single, list, and paginated responses.
- Removed redundant cache checks and writes in various services, simplifying the code and improving readability.
- Updated GoodsService, StockKeepingUnitsService, PartnerActivatedLicensesService, and others to utilize the new caching mechanism.
- Adjusted Prisma connection limit for better resource management.
2026-05-21 17:27:37 +03:30
ahasani 1d47fb1a1d refactor(goods): streamline goods service and controller, remove favorites module
- Removed the PosGoodFavorite module, controller, and service to simplify the codebase.
- Updated goods service to handle cache invalidation directly.
- Refactored goods controller to remove commented-out code and improve clarity.
- Introduced OwnedGoods module for better organization of owned goods functionality.
- Updated DTOs to extend from existing structures for consistency.
- Enhanced cache invalidation logic in goods service and owned goods service.
2026-05-20 20:22:00 +03:30
ahasani fc27b9d616 feat(pos): add favorite functionality for goods
- Implemented PosGoodFavoriteController to handle attaching and detaching favorites for goods.
- Created PosGoodFavoriteService to manage the business logic for favorites, including database operations and cache invalidation.
- Added PosGoodFavoriteModule to encapsulate the controller and service.
2026-05-20 11:42:59 +03:30
ahasani 98099e97e7 feat: add field validators for username and password, and integrate them into DTOs 2026-05-19 20:34:05 +03:30
ahasani d526f6ed2c feat: enhance consumer selection to include partner details for individual and legal types 2026-05-19 16:11:59 +03:30
ahasani 62b659246f feat: implement Redis caching for business activities and consumers
- Added Redis caching to BusinessActivitiesService for findAll and findOne methods.
- Integrated Redis caching in BusinessActivityComplexesService for findAll and findOne methods.
- Enhanced ConsumersService with Redis caching for findAll and findOne methods.
- Introduced cache invalidation for partner consumers and business activities.
- Created RedisKeyMaker utility for generating cache keys for consumers, partners, and POS.
- Implemented cache invalidation services for partners and POS.
- Added Redis service methods for JSON handling and key deletion by patterns.
- Updated goods service to include caching and invalidation for goods list.
- Introduced DTO for updating goods.
2026-05-19 15:40:45 +03:30
ahasani c5c522f69c set redis 2026-05-19 09:14:30 +03:30
ahasani 758bb03a26 feat: add update password functionality and DTO for partner service 2026-05-18 13:20:33 +03:30
ahasani 23ae3556de feat: implement consumer info update and password change functionality with DTOs 2026-05-18 10:53:58 +03:30
ahasani 12b11cc238 set vat to sku 2026-05-17 12:04:30 +03:30
ahasani 2d13a8bd9c update 2026-05-16 23:58:59 +03:30
ahasani 2a2c020627 refactor: update Dockerfile cache identifiers and clean up console logs across multiple services 2026-05-16 18:00:08 +03:30
ahasani ba3c544ff8 feat: enhance sale invoices filtering with additional fields and refactor findAll method 2026-05-16 16:12:19 +03:30
ahasani 5baf5bfea6 feat: enhance business activities and sale invoices handling with new query constants and pagination support 2026-05-16 14:49:23 +03:30
ahasani 83e7c26133 update 2026-05-11 20:18:03 +03:30
ahasani 1b26c515c0 update 2026-05-11 20:15:31 +03:30
ahasani 2a4e778c31 feat: enhance authentication flow with device info and optional POS flag in login DTO 2026-05-11 19:09:04 +03:30
ahasani 5e6bd33cdd feat: implement inquiry, send, retry, and revoke actions for sales invoices; enhance query constants and service structure 2026-05-10 19:56:05 +03:30
ahasani 9a76880b1d update dockerfile 2026-05-10 15:15:56 +03:30
ahasani c53eb2dba3 fix: update pnpm install commands to include only-built-dependencies option 2026-05-10 15:07:05 +03:30
ahasani 578e445917 update docker file 2026-05-10 14:56:00 +03:30
ahasani a1e8f40417 feat: enhance sales invoice functionality with inquiry, send, retry, and revoke actions 2026-05-10 14:14:01 +03:30
ahasani afa83895a2 Refactor code structure for improved readability and maintainability 2026-05-10 09:44:49 +03:30
ahasani 4e61ff618e refactor: remove SalesInvoiceItemsService and update sales invoice handling
- Deleted SalesInvoiceItemsService as it was not implemented.
- Changed variable declaration from `const` to `let` in SalesInvoicesService for sales invoice creation.
- Updated response handling after sending to TSP provider in SalesInvoicesService.
- Renamed payload properties in TspProvider DTOs for clarity.
- Enhanced error handling in SalesInvoiceTspSwitchService for unsupported providers.
- Refactored SalesInvoiceTspService to utilize utility functions for payload building and sending.
- Updated PrismaService to increase connection limit and utilize dynamic options.
- Added new migration scripts to update database schema for sale_invoice_tsp_attempts.
- Introduced utility functions for building payloads and handling responses in sales invoice processing.
2026-05-08 18:09:13 +03:30
ahasani fbe7230865 feat: add stock keeping units management
- Created migration to drop `type` column from `stock_keeping_units` table.
- Added `Guild` model to Prisma schema.
- Implemented `BusinessActivitiesQueryService` for querying business activities.
- Developed `GoodsSharedService` for handling goods creation and updates.
- Introduced DTOs for creating and updating stock keeping units.
- Created controller and service for managing stock keeping units.
- Implemented response DTOs for stock keeping units service.
- Established module for stock keeping units management.
2026-05-07 20:30:24 +03:30
ahasani 658496320b feat: implement correction and original send functionality for Nama provider
- Added new DTOs for correction requests and responses in `nama-provider.dto.ts`.
- Updated `nama-provider.adapter.ts` to include `originalSend` and `correctionSend` methods.
- Enhanced `nama-provider.util.ts` with mapping functions for correction requests.
- Created operational guidelines for agents in `AGENT.md`.
- Updated Prisma migrations to support new invoice types and relationships.
- Introduced new service and DTO for creating sales invoices in `sale-invoice-create.service.ts` and `sale-invoice-create.dto.ts`.
- Added utility for handling Prisma errors in `prisma-error.util.ts`.
2026-05-05 22:42:09 +03:30
ahasani 4af07fe3e8 update revoke 2026-05-05 10:14:48 +03:30
ahasani 6a48f203a9 set invoke in nama 2026-05-04 11:21:49 +03:30