Commit Graph

65 Commits

Author SHA1 Message Date
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
m.nazemi a75e4743f0 Merge pull request 'Refactor AI summarizer client initialization to include MongoDB manager and add statistics endpoint' (#36) from TM-602 into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_back/pulls/36
2026-06-07 14:32:37 +03:30
Mazyar c91b525e7e Refactor MongoDB index creation to use NonEmptyStringPartialFilter for improved clarity and consistency. Update GetOJS function to utilize context and user agent for HTTP requests, enhancing error handling and response management. 2026-06-06 21:36:43 +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 48340d961d Improve error handling for tender retrieval by adding specific checks for "tender not found" in handler and service layers. 2026-06-02 12:24:48 +03:30
Mazyar 4beb57f42e Refactor document scraper service to support multiple country codes for pending tenders retrieval. 2026-06-01 11:14:18 +03:30
Mazyar 51defd9438 company feedback performance update 2026-05-25 11:27:55 +03:30
Mazyar 6a74b34809 country filter fix 2026-05-23 21:14:21 +03:30
Mazyar 68e188a3e8 tender single document download 2026-05-23 12:14:44 +03:30
Mazyar 4390d7e1a6 tenders document filter 2026-05-20 16:03:30 +03:30
Mazyar 06ab5830e2 get scraped documents list performance update 2026-05-20 11:43:14 +03:30
Mazyar 2d5df8556f ai translation refactor 2026-05-19 21:58:44 +03:30
Mazyar e9ec33f0d4 cache translation in minio instead of mongo 2026-05-19 19:45:07 +03:30
Mazyar f7763cf997 get all tenders with documeents scraped API 2026-05-19 19:23:18 +03:30
Mazyar 515d118158 get pending tenders slow request fix 2026-05-19 13:39:56 +03:30
Mazyar 6dac5b482a hybrid pagination 2026-05-17 17:21:36 +03:30
Mazyar 42d0a47226 tender summary response fix 2026-05-17 17:02:12 +03:30
Mazyar 0fbcc74377 overall summary respose 2026-05-16 17:44:27 +03:30
Mazyar 70f581da09 cursor pagination 2026-05-16 15:51:18 +03:30
Mazyar bcb345103f minio connection log 2026-05-16 14:08:58 +03:30
Mazyar 6701428b09 AI translate refactor 2026-05-16 12:56:10 +03:30
Mazyar f08982afb5 pagination optimization 2026-05-14 14:18:34 +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 5e8d4f67b2 tender duplication fix 2026-05-12 17:02:39 +03:30
Mazyar 29b4aa50bd no empty document error for client 2026-05-12 14:35:45 +03:30
Mazyar 0a7fdd1328 overalSummary nil response 2026-05-12 12:25:09 +03:30
Mazyar 7c42b343ce document scraper logic and API refactor 2026-05-11 15:52:32 +03:30
Mazyar b4efb97f47 merge tenders which have the same procedure id - worker performance fix 2026-05-11 15:10:01 +03:30
Mazyar 8ba667e4f4 Advanced search 2026-05-11 11:25:41 +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 567e20b19c Get tender timeout fix 2026-05-09 12:32:38 +03:30
Mazyar b480ed2371 Integrated AI translation 2026-05-08 16:17:33 +03:30
Mazyar 65a19d1514 Integrated AI summary 2026-05-05 17:47:31 +03:30
Mazyar 35de23f5a3 added CreatedAt to tender response 2026-05-04 07:26:20 +03:30
Mazyar 2de7301d44 on the application side, get only the tenders with deadlines that have not passed 2026-05-04 06:14:25 +03:30
m.nazemi 870f6758e0 profile keyword manual update and recommended tenders 2026-04-22 18:39:40 +03:30
Mazyar 8dcda0e031 added AI auto-generated keywords to customer profile 2026-01-04 13:44:45 +03:30
Nima Nakhsotin 91e92675aa Merge branch 'develop' into integration 2025-12-27 16:03:24 +03:30
Mazyar f6bdcc6d7c Implemented the integration with scraper python server, tenders summarise, and some fixes. 2025-12-27 12:47:08 +03:30
Mazyar 6b387e2973 tender email confirmation template 2025-12-14 13:45:47 +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 0dd877a46d Refactor TED Repository and Introduce TED Mapping Functionality
- Updated the tender repository to create a unique index on tender_id, enhancing database query performance.
- Introduced new TED mapping functions to convert parsed TED documents into tender entities, improving integration with the tender management system.
- Added error handling for contract notice processing in the TED scraper, ensuring robust logging and error management.
- Removed deprecated eform structures to streamline the codebase and focus on essential components.
2025-10-04 12:34:37 +03:30
n.nakhostin 96d3b4fb9c Refactor Tender Entity and TED Parser for Clarity and Consistency
- Updated the Tender entity to remove redundant comments on Unix timestamp fields, enhancing code readability.
- Renamed the AwardedEntity type to Awarded for improved clarity and consistency in naming conventions.
- Removed the transformPriorInformationNoticeToContractNotice method from TEDParser, streamlining the parser's functionality and reducing legacy code.
2025-09-28 11:59:24 +03:30
n.nakhostin f57e53bd9b Enhance Tender Entity and TED Parser with Status Management and Upsert Logic
- Added new fields to the Tender entity for handling cancellation, award, and suspension details, improving the entity's capability to manage tender statuses.
- Implemented a DetectNoticeStatus method in the TEDParser to identify the status of TED notices from XML data, enhancing the parser's functionality.
- Updated the ParseXML method to include notice status detection, ensuring accurate status representation in parsed documents.
- Introduced upsert logic in the TED scraper to handle tender records more effectively, allowing for updates or creation based on existing ContractIDs.
- Enhanced logging and error handling throughout the scraping process to improve traceability and robustness.
- Added a comprehensive usage example document to illustrate the new features and usage patterns for the TED XML parser and scraper.
2025-09-28 10:27:20 +03:30
n.nakhostin b40615ec99 Update TenderResponse Structure to Handle BuyerOrganization Safely
- Modified the ToResponse method in the Tender entity to create an OrganizationResponse instance for BuyerOrganization, ensuring safe access to its Name field.
- This change improves the robustness of the response structure by preventing potential nil dereference errors when BuyerOrganization is not set.
2025-09-27 13:24:33 +03:30
n.nakhostin a342da193e Refactor Feedback Module for Consistency and Clarity
- Updated feedback repository and service methods to use a consistent naming convention, changing `NewTenderRepository` and similar methods to `NewRepository`.
- Refactored feedback handler methods to improve clarity by renaming methods such as `ListFeedback` to `Search` and `GetFeedback` to `Get`.
- Enhanced feedback response structures to include detailed company and tender information, improving the clarity of feedback data returned to API consumers.
- Updated Swagger documentation to reflect changes in feedback response structures and endpoint paths, ensuring accurate representation of the API for consumers.
2025-09-24 12:20:19 +03:30
n.nakhostin 5d721705b7 Update MongoDB Driver and Configuration for Company Entities
- Updated the MongoDB driver from v1.17.4 to v2.3.0, ensuring compatibility with the latest features and improvements.
- Refactored company-related entity and repository files to utilize the new driver, replacing `primitive.ObjectID` with `bson.ObjectID` for ID handling.
- Adjusted the configuration in `.drone.yml` to include the `main` branch in the trigger settings, enhancing CI/CD pipeline flexibility.
2025-09-09 18:53:39 +03:30