Commit Graph

269 Commits

Author SHA1 Message Date
Mazyar 50c018af62 Enhance company context handling in customer middleware and routing
continuous-integration/drone/push Build is passing
- Introduced CompanyContextMiddleware to resolve the active company context for customer requests, ensuring that tender recommendations and company-scoped APIs remain in sync with the database.
- Updated public routes to utilize the new CompanyContextMiddleware alongside the existing AuthMiddleware, improving the handling of company-specific requests.
- Added unit tests for the pickActiveCompanyID function to validate the logic for selecting the appropriate company context based on customer assignments and requested company IDs.

This update enhances the accuracy and reliability of company context management in the application, improving user experience and data consistency.
2026-06-30 22:30:28 +03:30
Mazyar addd616d59 Enhance dashboard statistics loading with cold-cache handling
continuous-integration/drone/push Build is passing
- Introduced a new constant, statisticsColdLoadWait, to define the wait time for cold-cache requests before serving a placeholder response.
- Updated the Statistics method to initiate a background load for statistics while allowing for a brief wait for real data, improving responsiveness during cache warming.
- Implemented a channel to handle the result of the background loading process, ensuring that users receive timely feedback while the cache is being populated.

This update optimizes the dashboard's performance by ensuring that users are served quickly, even when the statistics are being freshly loaded from the backend.
2026-06-30 22:24:04 +03:30
Mazyar 12d1cabf7e Refactor dashboard statistics retrieval to improve performance
continuous-integration/drone/push Build is passing
- Updated the Statistics method in the dashboard service to initiate a background refresh for statistics while serving a placeholder report, enhancing responsiveness during cache warming.
- Removed blocking calls to load statistics directly, allowing for faster response times.
- Improved logging to indicate when placeholder statistics are served, providing better visibility into the caching process.

This update optimizes the dashboard's performance by ensuring that users receive immediate feedback while the system prepares accurate statistics in the background.
2026-06-30 22:10:30 +03:30
Mazyar 8dbd9927b0 Enhance dashboard service with Redis caching for statistics
continuous-integration/drone/push Build is passing
- Updated the dashboard service to integrate Redis caching for improved performance in statistics retrieval.
- Modified the NewService function to accept a Redis client, enabling caching of dashboard statistics.
- Implemented logic to retrieve statistics from Redis, falling back to the database if necessary, and introduced a background process to warm the cache.
- Enhanced error handling and logging for Redis operations to ensure robust statistics management.
- Increased cache duration for scraped documents and adjusted timeout settings for MongoDB queries to optimize performance.

This update significantly improves the responsiveness and efficiency of the dashboard by leveraging Redis for caching statistics.
2026-06-30 19:03:22 +03:30
Mazyar 3002935b76 Update dashboard statistics caching and retrieval logic
continuous-integration/drone/push Build is passing
- Increased the cache duration for dashboard statistics from 60 seconds to 5 minutes, improving data freshness and reducing load on the backend.
- Introduced a stale cache mechanism that allows retrieval of stale statistics while refreshing them in the background, enhancing user experience by providing quicker access to data.
- Updated the statistics repository to handle the new caching logic, ensuring accurate and timely statistics reporting.
- Added tests to validate the new caching behavior and ensure the integrity of statistics retrieval.

This update optimizes the dashboard's performance and responsiveness by improving the caching strategy for statistics.
2026-06-30 18:50:47 +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 20ce9c53ff Enhance Tender entity with PublicationSubmissionDeadline method and corresponding tests
continuous-integration/drone/push Build is passing
- Added the PublicationSubmissionDeadline method to the Tender entity, which calculates the submission deadline based on the publication date and stored submission deadline.
- Updated the IsRecommendable method to utilize the new PublicationSubmissionDeadline logic for determining recommendation eligibility.
- Introduced unit tests for the PublicationSubmissionDeadline method, ensuring accurate calculation and validation of submission deadlines.
- Enhanced existing tests for the IsRecommendable method to cover new scenarios related to submission deadlines.

This update improves the accuracy of submission deadline handling and enhances the recommendation logic for tenders based on publication dates.
2026-06-30 18:12:55 +03:30
Mazyar ff6bdfcb09 Add IsRecommendable method and corresponding tests for Tender entity
continuous-integration/drone/push Build is passing
- Implemented the IsRecommendable method in the Tender entity to determine if a tender should be included in AI recommendations based on its status and deadline.
- Added unit tests for the IsRecommendable method to cover various scenarios, ensuring accurate recommendation logic.
- Updated the Recommend method in the tender service to utilize the new IsRecommendable method for improved clarity and functionality.

This update enhances the recommendation logic for tenders, ensuring only appropriate tenders are considered for AI recommendations based on their status and deadlines.
2026-06-30 17:22:06 +03:30
Mazyar 241e3b5f2d Implement audit logging functionality across services and middleware
- Introduced a new `auditlog` package to handle audit logging for user actions, including creation, updates, deletions, and authentication events.
- Enhanced existing services (customer, user) to log relevant actions using the new audit logger, capturing details such as actor ID, action type, target type, and success status.
- Added middleware to enrich request context with metadata for audit logging, ensuring comprehensive tracking of user interactions.
- Integrated Elasticsearch for persistent storage of audit logs, with fallback to file-only logging if Elasticsearch is unavailable.
- Updated API documentation to include new audit log endpoints for administrative access.

This update significantly improves the system's ability to track and audit user actions, enhancing security and accountability within the application.
2026-06-29 21:11:33 +03:30
Mazyar 534213f10e Enhance notification search functionality with user ID filtering
continuous-integration/drone/push Build is passing
- Added a new `UserID` field to the `SearchForm` to allow filtering notifications by user ID.
- Implemented the `ResolvedRecipients` method to return user IDs based on the `user_id` or `recipient` query parameters, improving the flexibility of notification searches.
- Updated the `GetNotifications` method in the service layer to utilize the new recipient resolution logic, ensuring accurate retrieval of notifications based on user ID.

This update enhances the notification management capabilities, providing more granular control over notification searches.
2026-06-28 11:04:24 +03:30
Mazyar 39ac76e7b0 Add scrapedDocumentsScanner interface and enhance document scanning logic
continuous-integration/drone/push Build is passing
- Introduced the `scrapedDocumentsScanner` interface to facilitate scanning of scraped documents from MinIO, returning both procedure summaries and daily document counts.
- Updated the `ListProceduresWithDocuments` method to utilize the new scanning functionality, improving data retrieval efficiency.
- Enhanced the `scrapedDocumentsPerDay` method to filter daily counts based on a specified start date, ensuring accurate reporting of document statistics.
- Added unit tests for the new scanning logic and daily counts filtering, ensuring robust functionality and error handling.

This update enhances the dashboard's document management capabilities, providing better insights into scraped documents and their daily counts.
2026-06-28 00:28:45 +03:30
Mazyar 69445130ce Refactor AI recommendation fetching and caching in company service
continuous-integration/drone/push Build is passing
- Introduced retry logic for fetching AI recommendations after onboarding, enhancing reliability in recommendation retrieval.
- Updated logging levels for better observability, changing cache miss logs to Info level.
- Renamed methods for clarity, replacing `refreshAIRecommendationsCacheAsync` with `scheduleRecommendationRefreshAfterOnboarding` and `fetchAndCacheAIRecommendations` with `fetchAIRecommendations`.
- Implemented a mechanism to clear the cache if no recommendations are returned, improving cache management.

This update optimizes the AI recommendation process, ensuring more robust handling of recommendation fetching and caching during onboarding.
2026-06-23 13:54:54 +03:30
Mazyar 20518e7b64 Enhance AI recommendation caching and onboarding process in company service
continuous-integration/drone/push Build is passing
- Updated `AISummarizerConfig` to allow for a default `RecommendationCacheTTL` of 0, enabling persistent caching until company updates.
- Refactored `StartAIOnboarding` to include cache invalidation and asynchronous recommendation refresh, improving responsiveness during onboarding.
- Introduced `triggerAIOnboardingAsync` method for background processing of AI onboarding and cache refresh, enhancing user experience.
- Improved logging for AI onboarding and recommendation fetching processes, providing better observability and error tracking.

This update optimizes the AI recommendation caching mechanism and onboarding workflow, ensuring a smoother and more efficient experience for users.
2026-06-23 13:43:39 +03:30
Mazyar 326e49886b Implement asynchronous AI recommendation cache refresh in company service
continuous-integration/drone/push Build is passing
- Introduced `refreshAIRecommendationsCacheAsync` method to refresh AI recommendations in the background, improving responsiveness by serving the previous cache until the refresh completes.
- Updated `StartAIOnboarding` to call the new asynchronous cache refresh method instead of invalidating the cache directly.
- Added logging for cache refresh operations, including success and error handling, to enhance observability.

This update enhances the AI recommendation caching mechanism, providing a smoother onboarding experience and reducing latency in recommendation retrieval.
2026-06-23 13:33:33 +03:30
Mazyar a2661651c9 Enhance company service with AI recommendation caching and onboarding improvements
continuous-integration/drone/push Build is passing
- Updated the `companyService` to include Redis caching for AI recommendations, improving performance and reducing redundant AI calls.
- Introduced asynchronous AI onboarding triggered after company profile updates, enhancing user experience by offloading processing.
- Added configuration for recommendation cache TTL in the `AISummarizerConfig`, allowing for flexible cache management.
- Implemented methods for caching, retrieving, and invalidating AI recommendations in the `companyService`, ensuring efficient data handling.

This update enhances the company's AI recommendation capabilities, providing faster responses and a more efficient onboarding process.
2026-06-23 13:24:45 +03:30
Mazyar a7a49fc411 Enhance tender management with recommended tenders endpoint and search form update
continuous-integration/drone/push Build is passing
- Added a new endpoint in the `tender` handler for retrieving AI-ranked tender recommendations for a company, improving the functionality of the admin panel.
- Updated the `SearchForm` to include a query parameter for `only_active_deadlines`, allowing for more flexible search options.
- Enhanced API documentation for the new endpoint to provide clear usage instructions and expected parameters.

This update improves the tender management system by providing administrators with better tools for accessing relevant tender information.
2026-06-23 13:09:27 +03:30
Mazyar 8fad771b7a Update notification response message for clarity
continuous-integration/drone/push Build is passing
- Changed the response message in the `Send` method of the `NotificationHandler` from "Notification sent successfully" to "Notification created successfully" to better reflect the action performed.

This update improves the clarity of the notification response, ensuring users receive accurate feedback on their actions.
2026-06-22 23:46:56 +03:30
Mazyar 992d41374f Update company entity and repository for document file ID handling
continuous-integration/drone/push Build is passing
- Modified the `DocumentFileIDs` field in the `Company` struct to ensure it is always persisted in BSON format, enhancing data consistency.
- Implemented logic in the `Update` method of the `companyRepository` to clear document file IDs when the slice is empty, ensuring accurate database updates.
- Added logging for errors encountered while clearing document file IDs, improving error tracking and debugging capabilities.

This update enhances the management of document file IDs within the company domain, ensuring proper handling and persistence in the database.
2026-06-22 23:38:57 +03:30
Mazyar 3ba33459e8 Update employee count validation in SearchForm for company domain
continuous-integration/drone/push Build is passing
- Modified the `EmployeeCount` field validation in `SearchForm` to use a range of 1 to 100000, ensuring more accurate input constraints.
- Updated `EmployeeCountMin` and `EmployeeCountMax` fields to reflect the same range validation, enhancing the robustness of search queries.

This update improves the validation logic for employee count fields in the company search functionality, providing better input handling and user experience.
2026-06-22 22:42:01 +03:30
Mazyar 5fbfcd4149 Enhance company document management with file ID sanitization and detachment functionality
continuous-integration/drone/push Build is passing
- Updated the `UploadDocuments` method to sanitize document file IDs before saving, ensuring only valid references are stored.
- Introduced `DetachDocumentFileID` method in the `companyService` to remove file IDs from all companies referencing a deleted file, improving data integrity.
- Enhanced the `companyRepository` with a new method to handle the removal of document file IDs from the database.
- Updated the `filestore` handler to utilize the new detachment functionality when files are deleted, ensuring consistent state across domain entities.

This update improves the management of document file IDs within the company domain, enhancing data integrity and reference handling.
2026-06-22 22:37:50 +03:30
Mazyar 3bfed0dc74 Enhance company search functionality with additional filters
continuous-integration/drone/push Build is passing
- Updated the `SearchForm` to include optional filters for `name`, `email`, `phone`, and `employee_count`, allowing for more granular search capabilities.
- Modified the `Search` method in the `companyRepository` to handle the new filters, improving the search logic with regex support for `name`, `email`, and `phone`.
- Updated API documentation in the `company` handler to reflect the new query parameters for enhanced clarity.

This update improves the search functionality within the company domain, providing users with more flexible and precise search options.
2026-06-22 22:26:26 +03:30
Mazyar 2a9682aea2 Enhance company repository search functionality
continuous-integration/drone/push Build is passing
- Updated the `Search` method in the `companyRepository` to improve search capabilities by allowing regex-based filtering on `name`, `email`, and `phone` fields.
- Added logic to handle numeric search queries for `employee_count`, enhancing the search flexibility.
- Implemented input sanitization to trim whitespace from search queries, ensuring cleaner search inputs.

This update improves the search functionality within the company repository, providing more robust and flexible search options for users.
2026-06-22 22:16:36 +03:30
Mazyar ce8a18aa8b Add unit tests for UpdateUserForm JSON unmarshalling
continuous-integration/drone/push Build is passing
- Introduced `form_test.go` to validate the behavior of the `UpdateUserForm` struct's JSON unmarshalling, specifically for the `profile_image` field.
- Added tests to ensure omitted `profile_image` is not treated as an update, null values clear the image, and valid URLs are preserved.
- Enhanced the `UpdateUserForm` and `UpdateProfileForm` structs to include logic for distinguishing between omitted and explicitly null profile images during JSON unmarshalling.

This update improves the robustness of user profile updates by ensuring correct handling of profile image data in JSON requests, enhancing overall data integrity in the user management system.
2026-06-22 22:09:30 +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 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 2b6e25f979 Update rank field type in tender and onboarding response structures
continuous-integration/drone/push Build is passing
- Changed the `Rank` field type from `string` to `int` in the `RecommendedTenderResponse` struct within the `company` domain for better data representation.
- Updated the `Rank` field type from `string` to `int` in the `TenderResponse` struct within the `tender` domain to ensure consistency in ranking data.
- Modified the `Rank` field type from `string` to `int` in the `RecommendedTender` struct within the AI summarizer package to align with the updated data structure.

This update enhances the data integrity and consistency across the tender management system by standardizing the rank representation as an integer.
2026-06-21 15:24:19 +03:30
Mazyar b671dc3fd8 Enhance notification system with in-app delivery support
continuous-integration/drone/push Build is passing
- Added `DeliveryChannelInApp` to support in-app notifications.
- Introduced `EventTypeInApp` constant for identifying in-app notifications.
- Updated `AdminNotifications` and `CustomerNotifications` handlers to set the event type to `EventTypeInApp`.
- Modified the `GetByUserID` repository method to handle filtering for in-app notifications, allowing for more flexible retrieval options.
- Updated the `persistNotification` method to include in-app as a delivery method.

This update improves the notification system by enabling in-app notifications, enhancing user engagement and notification management capabilities.
2026-06-21 14:47:15 +03:30
Mazyar 2538747768 Enhance tender response structure and update recommendation handler
continuous-integration/drone/push Build is passing
- Added new fields `Rank` and `Analysis` to the `TenderResponse` struct for improved data representation.
- Updated the `RecommendTenders` handler to reflect changes in API documentation, including a new summary and description for AI-ranked tender recommendations.
- Improved error handling in the recommendation process, ensuring appropriate responses for missing company IDs and unavailable AI services.

This update enhances the tender response capabilities and improves the clarity of the recommendation API, aligning with the overall goal of providing better insights for users.
2026-06-21 12:29:37 +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 e31bccced6 Add unit tests for dashboard repository and enhance BSON handling
continuous-integration/drone/push Build is passing
2026-06-21 10:03:17 +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 ee5414bc10 Enhance procurement lot estimated value aggregation and add unit tests
- Updated the `AggregateProcurementLotEstimatedValue` function to reject mixed currencies and allow empty lot currencies, ensuring accurate aggregation of estimated values.
- Introduced new unit tests in `entity_test.go` to validate the behavior of the aggregation function under various scenarios, including mixed currencies and empty lot currencies.
- Refactored budget calculation in `budget_test.go` to utilize the new aggregation logic, improving consistency in budget retrieval.

This update improves the handling of estimated values in procurement lots, enhancing the reliability of the tender management system.
2026-06-21 09:41:33 +03:30
m.nazemi a04b3fe1ec Merge branch 'develop' into est-value 2026-06-21 09:37:00 +03:30
Mazyar dfab3e17d2 Enhance dashboard repository and service with caching and aggregation improvements
- Introduced caching mechanisms for summary and statistics in the dashboard service, improving performance by reducing redundant data retrieval.
- Refactored the Summary method to utilize MongoDB aggregation for more efficient data processing and retrieval.
- Added synchronization features using singleflight to prevent duplicate processing of requests for cached data.
- Updated the repository to include a cachedScrapedTendersScope method, enhancing the efficiency of scraped document statistics retrieval.

This update significantly optimizes the dashboard's performance and data handling capabilities, ensuring faster response times and reduced load on the database.
2026-06-21 09:36:12 +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 6fb57c41c1 Refactor ScrapePortalsResponse structure and update API documentation
continuous-integration/drone/push Build is passing
- Changed the ScrapePortalsResponse type to return a slice of strings representing portal identifiers instead of a structured object.
- Updated the Swagger documentation for the GetScrapePortals endpoint to reflect the new response format, ensuring clarity in API usage.

This update simplifies the response structure for the scraping portals, enhancing the API's usability and consistency.
2026-06-18 20:56:31 +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 8035118f44 Enhance dashboard statistics repository with scraped tenders scope resolution
- Introduced a new `scrapedTendersScope` type to encapsulate the MongoDB filter for tenders with scraped documents, improving clarity and maintainability.
- Updated the `Statistics` method to utilize the new scope resolution, allowing for more accurate data retrieval based on the presence of scraped documents.
- Implemented multiple tests for the `resolveScrapedTendersScope` method, ensuring correct behavior for various scenarios, including empty and fallback cases.

This update enhances the dashboard's ability to manage scraped document statistics, improving overall data accuracy and system performance.
2026-06-17 15:01:52 +03:30
Mazyar 9676f99304 Refactor dashboard repository to integrate ProcedureDocumentsLister
- Introduced the ProcedureDocumentsLister interface to list contract folders with scraped documents, enhancing the accuracy of document-scrape statistics.
- Updated the dashboard repository to accept ProcedureDocumentsLister as a dependency, allowing for improved data retrieval.
- Implemented tests for the new functionality, ensuring proper handling of scraped document folder IDs and error propagation.

This update enhances the dashboard's capability to manage and report on scraped documents, improving overall system efficiency and data integrity.
2026-06-17 14:17:41 +03:30
Mazyar 7f84746400 Refactor statistics repository to use created_at for historical data retrieval
- Updated the `Statistics` method to utilize `created_at` instead of `processing_metadata.scraped_at` for fetching daily counts, ensuring accurate historical data representation.
- Removed redundant conditions in the `scrapedDocumentsPerDay` method, streamlining the query logic for better performance and clarity.
- Added a new index on `source` and `created_at` to optimize database queries related to scraped documents.

This update enhances the accuracy of data retrieval in the dashboard statistics, improving the overall efficiency of the tender management system.
2026-06-15 23:39:32 +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 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
m.nazemi 416b040c2b Merge branch 'develop' into TM-616 2026-06-13 14:49:01 +03:30
Mazyar f16f9fb5a9 Enhance notification search functionality and update API documentation
- Added `search` and `q` query parameters to the `SearchForm` for improved notification searching capabilities.
- Implemented `ResolvedSearch` method to prioritize search term resolution from the new parameters.
- Updated `GetByUserID` repository method to support searching notifications by title and message using regex.
- Enhanced logging in the `GetNotifications` service method to include search parameters.
- Updated Swagger documentation to reflect the new search parameters for the notification API.

This update improves the user experience by allowing more flexible and efficient searching of notifications.
2026-06-11 01:33:47 +03:30
Mazyar 3b26c4f5e1 Implement AI onboarding and recommendation features in company service
- Added new AI onboarding and recommendation endpoints in the company handler for starting onboarding and retrieving ranked tender recommendations.
- Introduced `StartAIOnboarding` and `GetAIRecommendations` methods in the company service to handle AI interactions.
- Updated the company service constructor to include the AI recommendation client.
- Enhanced the AI summarizer client with methods for onboarding and fetching recommendations.
- Added response structures for onboarding and recommended tenders in the company form.

This update enhances the tender management system by integrating AI capabilities for onboarding and tender recommendations, improving user experience and operational efficiency.
2026-06-11 01:08:59 +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