Commit Graph

46 Commits

Author SHA1 Message Date
Mazyar 0e4fadaf29 Enhance company recommendation caching and pipeline integration
continuous-integration/drone/push Build is passing
- Updated the company service to include a new method for scheduling the refresh of cached AI recommendations after the AI pipeline execution.
- Introduced a new interface for managing cached recommendation refreshes, improving the separation of concerns within the service layer.
- Enhanced the worker initialization to include Redis client support, allowing for better management of recommendation caching.
- Added functionality to list company IDs with existing recommendation caches, ensuring efficient updates post-pipeline runs.
- Implemented unit tests to validate the new recommendation refresh logic and ensure proper handling of various scenarios.

This update significantly improves the handling of AI recommendations by integrating caching mechanisms with the AI pipeline, enhancing overall system performance and responsiveness.
2026-07-08 00:45:53 +03:30
Mazyar 1ad0206e61 Refactor AI pipeline handling to support daily runs
continuous-integration/drone/push Build is passing
- Renamed and refactored the AI pipeline auto run functionality to a daily run, enhancing clarity and purpose.
- Introduced a new `AIPipelineDailyWorker` to manage the daily execution of the AI pipeline, replacing the previous auto run implementation.
- Updated configuration fields and logging messages to reflect the change from auto to daily run, ensuring consistent terminology throughout the codebase.
- Removed the obsolete `ai_pipeline_auto.go` file to streamline the worker structure.

This update improves the maintainability and readability of the AI pipeline management by clearly distinguishing between auto and daily run functionalities.
2026-07-07 12:17:03 +03:30
Mazyar 492f9ba3c8 Implement AI pipeline auto worker functionality
continuous-integration/drone/push Build is passing
- Introduced AIPipelineAutoWorker to manage the execution of the AI pipeline auto run, including startup catch-up and scheduled tasks.
- Enhanced WorkerConfig to include AIPipelineAutoEnabled and AIPipelineAutoInterval settings for better control over AI pipeline execution.
- Added logging for AI pipeline auto run status, including success and error handling, to improve observability.
- Updated daily job tracker to include AIPipelineAutoJobName for tracking AI pipeline job completions.

This update enhances the system's capability to automate AI pipeline executions, improving efficiency and reliability in processing AI tasks.
2026-07-01 19:42:36 +03:30
Mazyar 582f8b5c02 Enhance TED scraper and worker initialization with startup catch-up logic
continuous-integration/drone/push Build is passing
- Introduced a mutex to ensure only one TED scraper run executes at a time, preventing concurrent executions during startup and scheduled runs.
- Implemented a mechanism to check if today's TED scrape has already been completed during startup, logging appropriate messages for both completed and new runs.
- Added startup catch-up logic for tender translations and unprocessed notices, ensuring that any missed tasks are executed without blocking the application startup.

This update improves the reliability and efficiency of the TED scraper and worker processes, ensuring that all necessary tasks are completed after a server restart.
2026-06-28 00:05:10 +03:30
Mazyar d486a5e44f Enhance notification delivery system with scheduled processing
continuous-integration/drone/push Build is passing
- Introduced a new `NotificationWorker` to promote due scheduled notifications from pending to sent, improving notification management.
- Added `NotificationInterval` configuration to schedule the notification delivery worker, with a default value for flexibility.
- Implemented `MarkDueScheduledAsSent` method in the notification repository to update the status of notifications based on their delivery time.
- Updated the notification service to process due scheduled notifications during relevant operations, ensuring timely delivery.

This update enhances the notification system by automating the delivery of scheduled notifications, improving user engagement and operational efficiency.
2026-06-22 12:53:22 +03:30
Mazyar e04cdd1d10 Refactor AI summarization functionality by removing document summarization worker
continuous-integration/drone/push Build is passing
- Removed the DocumentSummarizationWorker and its related scheduling logic from the worker bootstrap.
- Updated the AI summarizer client initialization comment for clarity.
- Added a new error type for cases when tender documents have not been scraped yet, enhancing error handling in the tender service.
- Modified API documentation to reflect changes in AI summary retrieval logic, ensuring accurate descriptions of on-demand summarization behavior.

This update streamlines the AI summarization process by eliminating the document summarization worker, improving overall system efficiency and clarity in error handling.
2026-06-21 11:20:28 +03:30
Mazyar 4cfca5aa55 Enhance tender estimated value resolution and add unit tests
- Updated the `ResolvedEstimatedValueAndCurrency` method to aggregate procurement lot values when the tender-level estimated value is not set, improving accuracy in value retrieval.
- Introduced the `AggregateProcurementLotEstimatedValue` function to sum estimated values from procurement lots and return the first found currency.
- Modified the `ToResponseWithLanguage` method to utilize the new estimated value resolution logic.
- Added unit tests for the new functionality, ensuring correct behavior for various scenarios in the `entity_test.go` and `budget_test.go` files.

This update improves the handling of estimated values in tenders, enhancing the overall reliability of the tender management system.
2026-06-20 12:29:47 +03:30
Mazyar 2e112fe08c Update MinIO bucket configuration and enhance dashboard service caching
continuous-integration/drone/push Build is passing
- Changed the default MinIO bucket name from "opplens-documents" to "opplens" across multiple configuration files.
- Introduced caching for dashboard statistics in the service layer to improve performance and reduce redundant data fetching.
- Implemented a mutex for thread-safe access to cached statistics, ensuring data integrity during concurrent requests.

This update streamlines the configuration for the AI summarizer and optimizes the dashboard service, enhancing overall system efficiency.
2026-06-14 15:14:02 +03:30
Mazyar ca35eb5f15 Enhance worker configuration and error handling for AI summarizer
continuous-integration/drone/push Build is passing
- Added `TranslationEnabled` and `TranslationInterval` fields to the worker configuration to manage automatic translation scheduling.
- Updated the worker initialization to log when the translation worker is disabled.
- Improved error handling in the AI summarizer client by introducing `APIStatusError` for better context on API failures, replacing direct error messages with structured error responses.

This update enhances the configurability of the worker and improves error reporting for AI service interactions, contributing to better maintainability and user experience.
2026-06-14 14:02:35 +03:30
Mazyar dcf19b91cd Implement AI pipeline operations in the admin API
- Added new routes and handlers for AI pipeline operations, including scraping documents, batch summarization, translation, and syncing with the Opplens AI service.
- Introduced request forms for handling tender references and batch operations.
- Enhanced the AI service with methods for triggering batch operations and managing pipeline runs.
- Updated Swagger documentation to reflect the new AI pipeline endpoints and their functionalities.

This update integrates comprehensive AI pipeline capabilities into the tender management system, improving operational efficiency and user experience.
2026-06-14 12:54:13 +03:30
Mazyar 9cd22c24b6 Refactor queue management by removing deprecated components and updating configuration
- Removed the QueueConfig structure and related queue management files as they are no longer in use.
- Updated the worker initialization to reflect the removal of queue-related configurations.
- Cleaned up the bootstrap process by eliminating deprecated logging related to the queue system.

This update streamlines the worker's configuration and prepares the codebase for future enhancements without the legacy queue management components.
2026-06-08 23:49:51 +03:30
Mazyar d07e1c9cf0 Fix summarizer worker infinite loop and map AI trigger errors to safe HTTP responses.
Paginate un-summarized tenders and mark rows missing notice/folder IDs as handled so the worker cannot spin forever. Return 400/404 for validation and not-found cases on AI summarize/analyze triggers instead of leaking internal errors as 500.
2026-06-08 20:24:02 +03:30
Mazyar 7d383c36c3 Implement AI analysis trigger endpoint and refactor related components
- Added a new endpoint to trigger on-demand agentic analysis for tenders via the AI service.
- Introduced `TriggerAIAnalyze` method in the `TenderHandler` to handle requests and responses for AI analysis.
- Updated the `tenderService` to include `TriggerAIAnalyze` method, which validates input and interacts with the AI summarizer client.
- Enhanced the `AIAnalyzeResponse` and `AIAnalyzeDocument` structures to support the new analysis feature.
- Refactored the `DocumentSummarizationWorker` and `TranslationWorker` to remove deprecated MinIO dependencies, streamlining the AI service interactions.

This update improves the functionality of the tender management system by allowing users to trigger AI analysis on-demand, enhancing the overall user experience and system capabilities.
2026-06-08 18:01:15 +03:30
Mazyar 68b170126d Refactor AI summarizer client initialization to include MongoDB manager and add statistics endpoint
- Updated `InitAISummarizerClient` to accept `mongoManager` for tracking translation success.
- Introduced new `Statistics` endpoint in the dashboard to fetch scraping and translation statistics.
- Enhanced `TranslationWorker` to utilize the new success counter for tracking successful translations.
- Added necessary data structures and query forms for statistics reporting.

This refactor improves the tracking of AI translation success and provides new insights through the dashboard statistics.
2026-06-06 21:20:53 +03:30
Mazyar e9ec33f0d4 cache translation in minio instead of mongo 2026-05-19 19:45:07 +03:30
Mazyar 42d0a47226 tender summary response fix 2026-05-17 17:02:12 +03:30
Mazyar 6701428b09 AI translate refactor 2026-05-16 12:56:10 +03:30
Mazyar 5ab6b2714e AI scraper prefix 2026-05-13 17:32:37 +03:30
Mazyar 584992f0b6 translation body update 2026-05-13 14:50:37 +03:30
Mazyar ba9e7483ad contractNoticeID duplication fix 2026-05-13 13:18:26 +03:30
Mazyar 83c8ece91f added missing tender data to response 2026-05-13 01:07:43 +03:30
Mazyar be53fa8054 worker concurrency config 2026-05-12 23:56:10 +03:30
Mazyar 5e8d4f67b2 tender duplication fix 2026-05-12 17:02:39 +03:30
Mazyar b4efb97f47 merge tenders which have the same procedure id - worker performance fix 2026-05-11 15:10:01 +03:30
Mazyar eb6706e061 Added missing fields - scraper and worker fixes 2026-05-11 00:09:37 +03:30
Mazyar e136f0eaa7 List and download tender documents - worker auto translation to english job 2026-05-10 02:14:53 +03:30
Mazyar 086fe0ffd5 removed filter to get all tenders - bug fix 2026-05-04 05:28:56 +03:30
m.nazemi 446c11dfbf Removed old document scraper service 2026-05-03 13:46:38 +03:30
m.nazemi 4c5355ddf8 worker bug fix 2026-04-26 19:17:10 +03:30
hadi barzegar 6c76b7bcac enhance tender mapping with additional notice fields and processing metadata 2026-04-16 11:56:01 +03:30
m.nazemi 3d651f8596 worker notice default limit 2026-04-15 04:28:51 +03:30
m.nazemi a6a1ad51b1 worker notice limit config 2026-04-12 21:03:34 +03:30
m.nazemi bf3f21fb51 agent SDK fix 2026-04-12 12:29:35 +03:30
Karim Pirzargar 2ab001bc70 updat epush 2026-03-09 20:16:14 +03:30
Mazyar 9d1060d8f4 worker log 2025-12-28 16:43:30 +03:30
Mazyar a95944d4c6 fixed glm panic 2025-12-28 15:58:33 +03:30
Mazyar f6bdcc6d7c Implemented the integration with scraper python server, tenders summarise, and some fixes. 2025-12-27 12:47:08 +03:30
n.nakhostin 7fc6568d02 Implement Tender ID and Project Name Generation in Notice Worker
- Refactored the NoticeWorker to generate unique tender IDs using the PBL naming convention (SCDYYNNN format) and project names based on client and opportunity details.
- Introduced methods for generating tender IDs and project names, including logic for extracting client and opportunity names, ensuring consistency and clarity in naming.
- Updated the Tender entity to include a new ProjectName field, enhancing the data structure for better project identification.
- Added MongoDB indexing for the new project_name field to optimize query performance.
- Improved error handling and logging during the tender ID generation process, ensuring robustness in the worker's functionality.
2025-11-04 17:17:46 +03:30
n.nakhostin fafccd0d74 Refactor Worker Initialization to Integrate GLM SDK
- Updated the worker initialization process to include the new GLM SDK, enhancing the worker's capabilities for translation tasks.
- Modified the InitWorker function and NewNoticeWorker constructor to accept the GLM service, ensuring a cohesive integration.
- Implemented the GLM service initialization and logging for successful setup, improving maintainability and usability.
- Updated the NoticeWorker to utilize the GLM SDK for translating notice titles and descriptions, enhancing functionality and user experience.
2025-11-04 16:51:45 +03:30
n.nakhostin eead4b05d8 Refactor Worker Initialization to Remove Ollama SDK Dependency
- Removed the Ollama SDK from the worker initialization process, simplifying the worker's dependencies and enhancing maintainability.
- Updated the InitWorker function and NewNoticeWorker constructor to reflect the removal of the Ollama SDK, ensuring a cleaner and more focused implementation.
- Commented out the Ollama model listing logic for potential future use, maintaining clarity in the main function while reducing unnecessary complexity.
2025-10-20 11:32:50 +03:30
n.nakhostin 01d3826003 Remove assets copy step from Dockerfile for worker service to streamline build process 2025-10-18 10:20:04 +03:30
n.nakhostin 10a9081c68 Add Worker Build Step and Dockerfile for Background Processing
- Introduced a new build step in the Drone CI configuration for the worker service, enabling automated Docker image creation.
- Added a Dockerfile for the worker service, defining the build process and dependencies, ensuring a streamlined deployment for background tasks.
- Enhanced the overall CI/CD pipeline to support the new worker service, improving the project's build and deployment capabilities.
2025-10-18 09:07:46 +03:30
n.nakhostin 8e5308b70b Refactor NoticeWorker to Enhance Tender Creation Logic
- Updated the ToTender method to accept a tender instance, allowing for direct population of tender fields from the notice entity.
- Simplified the tender creation and update process by checking if the tender ID is zero, streamlining the logic for handling tender entities.
- Removed the commented-out code related to AI translation, improving code clarity and maintainability.
- Enhanced error logging for tender creation and update failures, ensuring better visibility into potential issues during processing.
2025-10-18 09:02:11 +03:30
n.nakhostin 0747908873 Add AlertMail Configuration and Enhance TED Scraper Notification Logic
- Introduced AlertMail configuration in both scraper and worker bootstrap files, allowing for customizable email notifications.
- Updated the TED scraper to utilize the AlertMail configuration for sending completion notifications, improving flexibility in notification management.
- Enhanced error logging in the worker's main function to capture issues when listing Ollama models, ensuring better visibility into potential failures.
- Refactored notification sending logic to check for a valid AlertMail before dispatching emails, ensuring notifications are only sent when configured.
- Improved overall structure and readability of the bootstrap configuration files, aligning with best practices for maintainability.
2025-10-16 16:20:23 +03:30
n.nakhostin 1c3ad648c1 Implement Worker Service and Refactor Tender Initialization
- Introduced a new worker service with a dedicated main entry point for handling background tasks, including MongoDB connection management and notification service initialization.
- Added a bootstrap package to manage application configuration, logging, and service initialization for the worker.
- Implemented a NoticeWorker to process unprocessed notices and create corresponding tender entities, enhancing the integration of notice management within the tender system.
- Refactored the tender service to remove the Ollama SDK dependency, streamlining the service initialization in the main application.
- Enhanced the notice repository with a method to retrieve unprocessed notices, improving data handling capabilities.
2025-10-05 16:17:41 +03:30
hdbar ad9db7bcce Initialize base 2025-07-27 16:20:21 +03:30