Commit Graph

44 Commits

Author SHA1 Message Date
Mazyar b28bc23975 Enhance tender reference handling with improved deduplication and test coverage
- Updated the `markResolvedRecommendedTenderSeen` function to accept an additional `tenderRef` parameter, allowing for better tracking of tender references and preventing duplicates.
- Refactored the `GetByProcedureReferences` method in the repository to combine indexed notice lookups with contract-folder candidates, ensuring older notice references resolve correctly after tender merges.
- Introduced a new `findTendersByContractFolderIDs` method to streamline the retrieval of tenders by contract folder IDs, enhancing performance and maintainability.
- Added unit tests for new functionality in `ai_reference_test.go` and `recommendation_filter_test.go`, ensuring robust validation of tender reference mapping and deduplication logic.

This update significantly improves the handling of tender references and enhances the overall test coverage, ensuring more reliable and efficient processing of tender data.
2026-07-08 01:55:33 +03:30
Mazyar f108733c2a Enhance tender recommendation service with improved caching and pagination
continuous-integration/drone/push Build is passing
- Introduced a context with a timeout for Redis cache retrieval in the `getCachedAIRecommendations` method, ensuring more robust handling of potential delays.
- Added a new file `recommendation_page.go` to encapsulate the logic for building recommendation pages, improving code organization and readability.
- Implemented a `buildRecommendationPage` method to handle pagination and batch processing of recommendations, enhancing performance and user experience.
- Created a new test file `recommendation_page_test.go` to validate the functionality of the recommendation page building process, ensuring correct pagination and batch resolution.

This update significantly improves the efficiency and maintainability of the tender recommendation service by optimizing caching and implementing structured pagination handling.
2026-07-08 01:32:27 +03:30
Mazyar 2980a3beb4 Refactor tender recommendation response handling and improve test coverage
continuous-integration/drone/push Build is passing
- Renamed the test function to `TestBuildRecommendedTenderListResponsesPreservesOrderWithoutStorage` for clarity and updated its logic to reflect changes in the recommendation response building process.
- Removed unnecessary sleep in the test to enhance performance.
- Refactored the `buildRecommendedTenderResponsesParallel` method to `buildRecommendedTenderListResponses`, simplifying the response building without relying on MinIO translation lookups.
- Updated the repository's `mapProcedureReferencesToTenders` function to improve efficiency by grouping candidates by their contract folder IDs, enhancing the mapping process.

This update streamlines the recommendation response handling and enhances the test suite for better maintainability and performance.
2026-07-08 01:23:21 +03:30
Mazyar 4c48e0bb3b Add unit test for mapping procedure references to tenders
continuous-integration/drone/push Build is passing
- Introduced a new test function `TestMapProcedureReferencesToTenders` to validate the mapping of procedure references to corresponding tenders.
- Enhanced the `GetByProcedureReferences` method in the tender repository to utilize a more efficient filtering mechanism based on unique contract folder IDs.
- Updated pagination logic to dynamically adjust limits based on the number of unique folders and references, ensuring optimal data retrieval.

This update improves the testing coverage for tender mapping functionality and optimizes the repository's data fetching strategy, enhancing overall performance and reliability.
2026-07-04 13:39:14 +03:30
Mazyar c46a8d54f4 Refactor document scraper to utilize active publication windows for tender retrieval
continuous-integration/drone/push Build is passing
- Updated the ListPendingTenders method to filter tenders based on their active publication submission window instead of just deadlines, enhancing the accuracy of tender listings.
- Introduced a new HasActivePublicationWindow method in the Tender entity to determine if the publication-based submission window is still open.
- Modified the GetTenderByNoticeID method to reflect the new logic for filtering tenders based on their publication status.
- Enhanced the documentation for relevant API endpoints to clarify the changes in tender retrieval criteria.

This update improves the precision of tender scraping by ensuring only relevant tenders with active submission windows are processed, contributing to better data management and scraping efficiency.
2026-07-01 19:22:45 +03:30
Mazyar 7aacb7dfc9 Enhance pagination and repository functionality for MongoDB
continuous-integration/drone/push Build is passing
- Updated the ListPaginationOptions struct to include SkipCount and IncludeCount fields, allowing for more flexible pagination behavior.
- Modified the BuildListPagination function to handle cursor pagination with count options, improving performance by running count queries in parallel with data retrieval.
- Enhanced the FindAll method in the repository to support concurrent counting of documents, reducing overall latency for list operations.
- Added tests for pagination behavior, ensuring accurate handling of count scenarios in both offset and cursor pagination.

This update improves the efficiency and flexibility of pagination in the MongoDB repository, enhancing the overall performance of list operations.
2026-06-30 18:35:34 +03:30
Mazyar db14bfe270 Enhance tender repository and service with AI procedure reference handling
continuous-integration/drone/push Build is passing
- Introduced `ProcedureReference` struct to encapsulate AI procedure coordinates for better data management.
- Added `GetByProcedureReferences` method in the `TenderRepository` to retrieve multiple tenders based on AI procedure references in a single query.
- Updated the `resolveRecommendedTenders` method in the service layer to utilize the new repository method, improving efficiency in fetching recommended tenders.
- Enhanced error handling and logging for the new repository method to ensure robust operation.

This update improves the handling of AI procedure references, streamlining tender retrieval processes and enhancing overall system performance.
2026-06-21 15:43:58 +03:30
Mazyar fa258020f1 Add AI procedure reference formatting and parsing functions with unit tests
continuous-integration/drone/push Build is passing
- Introduced `FormatAIProcedureRef` and `ParseAIProcedureRef` functions in the `tender` domain for handling AI service tender references.
- Added unit tests for these functions in `ai_reference_test.go` to ensure correct parsing and formatting behavior.
- Updated the `TenderResponse` struct to include a new `ProcedureRef` field for improved data representation.
- Enhanced the `GetByProcedureReference` method in the repository to retrieve tenders based on the new procedure reference format.
- Modified the `Recommend` method in the service layer to utilize the new procedure reference handling, improving the recommendation process.

This update enhances the handling of AI procedure references, ensuring better data integrity and usability in the tender management system.
2026-06-21 15:36:36 +03:30
Mazyar 45cfa24a72 Enhance document scraper service with AI portal integration and error handling
- Updated the document scraper service to include a new ScrapePortalsProvider interface, allowing for dynamic retrieval of supported scraping portals.
- Modified the ListPendingTenders and GetTenderByNoticeID methods to filter tenders based on document URLs that match the configured portals.
- Introduced new error handling for cases when the scrape portals provider is not configured, returning appropriate service unavailable responses.
- Enhanced API documentation to reflect changes in tender retrieval logic and added error response details for unsupported portal scenarios.

This update improves the document scraping functionality by integrating AI portal support, enhancing the overall reliability and flexibility of the tender management system.
2026-06-21 09:58:11 +03:30
Mazyar e5fa0dfe47 Add GetScrapePortals endpoint and related service functionality
continuous-integration/drone/push Build is passing
- Introduced the GetScrapePortals method in the AI pipeline handler to list document scraping portals supported by the Opplens AI service.
- Updated the service layer to include GetScrapePortals, which retrieves the portals from the client and handles errors appropriately.
- Enhanced the routes to register the new endpoint for retrieving scrape portals.
- Added a new error type for invalid date ranges in the document scraper, improving validation and error handling.

This update expands the AI pipeline capabilities, allowing for better management of document scraping portals within the tender management system.
2026-06-18 19:53:07 +03:30
Mazyar 31d8efef0b Enhance search functionality by adding NoticePublicationID to SearchForm and updating API documentation
continuous-integration/drone/push Build is passing
- Added `NoticePublicationID` field to the `SearchForm` for filtering tenders by TED notice publication ID.
- Updated Swagger documentation in the handler methods to include the new `notice_publication_id` parameter for relevant endpoints.
- Modified the repository's search filter to incorporate the new `NoticePublicationID` field, allowing for more precise search queries.

This update improves the search capabilities within the tender management system, enhancing user experience and data retrieval accuracy.
2026-06-15 11:22:41 +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 ca2a1b4425 Enhance AI pipeline service with document metadata synchronization
continuous-integration/drone/push Build is passing
- Updated the AI pipeline service to include a new `ScrapedDocumentMetadataSyncer` interface for persisting scraped document metadata onto tender records.
- Modified the `NewService` function to accept the new metadata syncer dependency.
- Implemented synchronization of scraped document metadata in the `ScrapeDocuments` and `Run` methods.
- Enhanced the tender service to enrich search filters based on scraped documents and added a new method for syncing scraped documents from storage.
- Updated the `SearchForm` to include `ContractFolderIDsWithDocuments` for better handling of scraped documents in queries.

This update improves the integration of scraped document handling within the AI pipeline, enhancing data consistency and operational efficiency in the tender management system.
2026-06-14 14:59:37 +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 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 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 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 e9ec33f0d4 cache translation in minio instead of mongo 2026-05-19 19:45:07 +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 70f581da09 cursor pagination 2026-05-16 15:51:18 +03:30
Mazyar f08982afb5 pagination optimization 2026-05-14 14:18:34 +03:30
Mazyar ba9e7483ad contractNoticeID duplication fix 2026-05-13 13:18:26 +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 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 2de7301d44 on the application side, get only the tenders with deadlines that have not passed 2026-05-04 06:14:25 +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 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 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
n.nakhostin c06ea278c0 Update CustomerResponse JSON Tags and Fix Comment in Tender Repository
- Changed BSON tags to JSON tags in the CustomerResponse struct to ensure proper serialization in API responses.
- Updated the comment in the buildSearchFilter method to correct a typo, enhancing clarity in the codebase.
2025-09-08 14:32:57 +03:30
n.nakhostin 3911180486 Refactor Tender Management API Endpoints and Update Documentation
- Renamed and restructured tender-related API endpoints for improved clarity and consistency, including changing the route from `/admin/tenders` to `/admin/v1/companies` and updating the associated methods.
- Introduced a new SearchForm structure for listing tenders with advanced filtering capabilities, enhancing the API's search functionality.
- Updated the service and repository layers to align with the new endpoint structure, ensuring proper handling of tender data.
- Enhanced Swagger and YAML documentation to reflect the changes in endpoint structure, including detailed descriptions and examples for the new search functionality.
- Improved error handling and response structures to provide clearer feedback to API consumers, ensuring a more robust and user-friendly experience.
2025-09-08 14:20:50 +03:30
n.nakhostin c684a12155 Update API Documentation and Enhance Tender Query Parameters
- Changed references in API documentation from `main.HealthResponse` to `bootstrap.HealthResponse` for consistency.
- Added new query parameters `publication_from` and `publication_to` to the tender listing and recommendation endpoints to allow filtering by publication date.
- Updated the `ListTendersRequest` struct to include optional fields for `from` and `to` timestamps.
- Modified the `TenderRepository` and `TenderService` interfaces to support the new filtering parameters in the tender listing functionality.
- Enhanced the service and handler layers to process the new query parameters, improving the flexibility of tender retrieval.
2025-09-02 11:03:38 +03:30
n.nakhostin 4663a9781e Enhance Tender API with New Recommendation Endpoint and Route Updates
- Updated the tender API to include a new endpoint for recommending public tenders based on company profiles, enhancing user experience for mobile application users.
- Modified existing routes to reflect the new structure, changing the tender details route and adding a dedicated recommendation route.
- Improved Swagger documentation to accurately represent the new endpoint, including detailed descriptions, parameters, and response formats.
- Ensured adherence to Clean Architecture principles by maintaining clear separation of concerns in the service and handler layers.
2025-08-17 08:40:28 +03:30
n.nakhostin e986ee4135 Refactor Tender Management System by Removing Scraping Functionality and Enhancing Tender API
- Removed all scraping-related functionality, including routes, handlers, services, and repository methods, to streamline the tender management system.
- Updated the tender API to focus solely on tender management, enhancing endpoints for listing, retrieving, and updating tenders.
- Improved Swagger documentation to reflect the removal of scraping endpoints and the addition of new tender-related features.
- Ensured adherence to Clean Architecture principles throughout the refactoring process, maintaining a clear separation of concerns.
2025-08-16 16:52:17 +03:30
n.nakhostin 0a23ff985a Enhance Tender Management with Company-Based Matching and API Updates
- Updated the tender service to include company-based matching for tenders, allowing for more relevant results based on company CPV codes.
- Modified the ListTenders endpoint to accept a company ID parameter for calculating match percentages and sorting tenders accordingly.
- Refactored the tender response structure to include match percentage and days until deadline for better client-side handling.
- Updated API documentation to reflect changes in the tender listing functionality and added new endpoints for public tender access.
- Removed deprecated customer-related methods and streamlined customer listing functionality for improved clarity and performance.
2025-08-13 19:47:58 +03:30
n.nakhostin 96c21b8b78 Implement TED Scraper and Configuration Management
- Introduced a new TED scraper in `cmd/scraper` to handle downloading and parsing TED XML files.
- Added configuration management for the scraper, including a new `Config` struct and YAML configuration file.
- Created necessary handler, service, and repository layers for tender management, adhering to Clean Architecture principles.
- Implemented comprehensive logging and error handling throughout the scraper functionality.
- Updated API routes to include tender management operations, enhancing the overall system capabilities.
2025-08-13 16:52:24 +03:30