Commit Graph

342 Commits

Author SHA1 Message Date
Mazyar 5062c19242 changed search inquiry response to grt meta outside of the data 2025-11-25 12:53:17 +03:30
Nima Nakhostin c8efa2c068 Refactor Scraper Dockerfile and Remove Entrypoint Script
- Removed the entrypoint.sh script from the scraper Dockerfile to streamline the build process.
- Updated the Dockerfile to directly set the ENTRYPOINT to the scraper build executable, simplifying the container startup.
- This change enhances maintainability by reducing the number of files and improving clarity in the Docker configuration.
2025-11-23 14:20:01 +03:30
Nima Nakhostin 10fd53af41 Refactor Scraper Configuration and Command Line Handling
- Removed command line flag parsing for date range scraping in the scraper's main function.
- Introduced configuration fields for one-time scraping and date range (FromDate, ToDate) in the ScraperConfig struct.
- Updated the main function to utilize the new configuration fields, improving the clarity and maintainability of the scraping logic.
- This change enhances the scraper's functionality by centralizing configuration management and reducing command line complexity.
2025-11-23 14:17:45 +03:30
Nima Nakhostin afb32a9fa3 Enhance CMS Entity with JSON Tags
- Added JSON tags to all fields in the CMS entity and its related sections (heroSection, chartSection, cardSection, contactSection, footerSection) to ensure proper serialization and deserialization in API responses.
- This change improves the API's usability by providing clear JSON representations of the CMS data structure.
2025-11-23 14:07:10 +03:30
Nima Nakhostin f1bdacdc98 Refactor Scraper Dockerfile and Add Entrypoint Script
- Replaced inline entrypoint script creation in the Dockerfile with a separate entrypoint.sh file for better maintainability and clarity.
- The new entrypoint script handles one-time scraping with date range support, improving the scraper's functionality and usability.
2025-11-23 13:48:27 +03:30
Nima Nakhostin 1f6d3fd1cb Enhance Scraper Dockerfile and Notice Entity
- Added an entrypoint script to the scraper Dockerfile to handle one-time scraping with date range support.
- Introduced a new ContentXML field in the Notice entity to store XML content, improving data structure for notices.
- Updated the scraper logic to map XML content to the tender entity, enhancing data processing capabilities.
2025-11-23 13:27:04 +03:30
m.nazemi 61a4465f50 Merge pull request 'added UUID to card and form field' (#6) from TM-290 into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_back/pulls/6
2025-11-15 10:52:36 +03:30
Mazyar ba06595ab0 added UUID to card and form field 2025-11-15 10:51:04 +03:30
Nima Nakhostin a3472f432d Fix Middleware Usage in CMS Routes
- Corrected the middleware usage in the CMS routes by ensuring the AuthMiddleware is applied correctly.
- This change enhances the security of the CMS endpoints by enforcing authentication for all CMS-related operations.
2025-11-09 10:28:09 +03:30
Nima Nakhostin 265ea4a7c6 Enhance Swagger Documentation for CMS API
- Updated Swagger documentation to include new fields: CompanyName, Country, and Language, improving clarity and usability for API consumers.
- Added a new Type field with enumerations for Company and Organization, enhancing data categorization in the CMS API.
- Reflected changes in the definitions for CMS entities, ensuring accurate representation of the API structure and expected inputs/outputs.
- Improved examples in the documentation to provide better guidance for developers integrating with the CMS API.
2025-11-09 10:21:41 +03:30
Nima Nakhostin a363078d6f Enhance CMS Entity and Forms with Type Field
- Added a new Type field to the CMS entity to differentiate between Company and Organization types, improving data categorization.
- Updated the CMSForm to include validation for the Type field, ensuring proper input handling.
- Modified the ToResponse method to include the Type field in the CMSResponse, enhancing the API response structure.
- Adjusted the copyFormToEntity method in the CMS service to handle the new Type field, maintaining data integrity based on the selected type.
- Enhanced Swagger documentation to reflect the changes in the CMS API, providing clear examples for the new Type field.
2025-11-09 10:21:25 +03:30
Nima Nakhostin 1a56070556 Add MinIO Package for Object Storage Management
- Introduced a comprehensive MinIO package for managing object storage, including support for hierarchical document storage and general file management.
- Implemented core components such as Config, ConnectionManager, and Service, following Clean Architecture principles.
- Added functionality for file uploads, downloads, bucket management, and structured logging, enhancing usability and maintainability.
- Included detailed error handling and validation for configuration and operations, ensuring robustness.
- Updated documentation with usage examples and configuration guidelines to facilitate integration and understanding of the package's functionality.
2025-11-09 09:52:09 +03:30
Nima Nakhostin 9fe86d4f8e Update CMS Entity and Forms to Include New Fields
- Added new fields to the CMS entity: CompanyName, Country, and Language, enhancing the data structure for better content management.
- Updated the CMSForm to include validation and examples for the new fields, ensuring proper input handling.
- Modified the copyFormToEntity method in the CMS service to map the new fields from the form to the entity, maintaining data integrity.
- Enhanced Swagger documentation to reflect the changes in the CMS API, providing clear examples for the new fields.
2025-11-09 09:24:23 +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 08116981f4 Enhance Scraper with One-Time Date Range Functionality
- Added command line flags for specifying a date range and a one-time scraping mode in the scraper's main function.
- Implemented validation for the date inputs to ensure both dates are provided and correctly formatted.
- Introduced a new RunOneTimeScraping function to handle the one-time scraping logic, including context management and error handling.
- Updated the TED scraper initialization to support both scheduled and one-time scraping modes, improving flexibility in data retrieval.
- Enhanced logging to provide clear feedback on the scraping process and any errors encountered.
2025-11-04 16:53:31 +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 a5d3a94c97 Add GLM SDK Implementation
- Introduced a new GLM SDK for interacting with the GLM (Zhipu AI) API, designed for chat completions and text generation tasks.
- Implemented core components including Client, Service, and SDK layers following Clean Architecture principles.
- Added configuration management, error handling, and structured logging for improved usability and maintainability.
- Included comprehensive documentation and usage examples to facilitate integration and understanding of the SDK's functionality.
- Enhanced the API with features such as chat completion, streaming responses, and model management, ensuring robust interaction with the GLM service.
2025-11-04 16:09:44 +03:30
n.nakhostin dae8eb44e2 Add Documentation Copy Step in Dockerfile
- Added a step in the Dockerfile to copy the documentation files from the build stage to the final image.
- This change ensures that the documentation is included in the Docker image, improving accessibility for users and developers.
2025-11-04 11:55:37 +03:30
n.nakhostin cdd636485d Update Swagger Documentation for CMS Endpoints
- Refactored API paths to replace "companies" with "cms" for better alignment with CMS management functionality.
- Updated descriptions, parameters, and responses for CMS-related endpoints to reflect new functionality, including search, create, retrieve, update, and delete operations.
- Enhanced the Swagger documentation to include detailed definitions for CMS entities, forms, and responses, ensuring comprehensive API specifications.
- Improved consistency in naming conventions and descriptions across the CMS API endpoints.
2025-11-04 11:15:48 +03:30
n.nakhostin 9a444a1e7d Add CMS Management Functionality
- Introduced a new CMS management feature, including the ability to create, retrieve, update, search, and delete CMS entries.
- Implemented the CMS entity, repository, service, and handler layers following Clean Architecture principles.
- Added API endpoints for CMS operations in Swagger documentation, ensuring comprehensive API specifications.
- Enhanced error handling and validation for CMS data, improving robustness and user experience.
- Updated the main application to initialize the CMS repository and service, integrating them into the existing system.
2025-11-03 13:20:58 +03:30
n.nakhostin 875447ac58 Add Contact Management Functionality
- Introduced a new contact management feature, including the ability to create, retrieve, search, update, and delete contact messages.
- Implemented the Contact entity, repository, service, and handler layers following Clean Architecture principles.
- Added API endpoints for contact operations in Swagger documentation, ensuring comprehensive API specifications.
- Enhanced error handling and validation for contact data, improving robustness and user experience.
- Updated the main application to initialize the contact repository and service, integrating them into the existing system.
2025-10-25 18:15:39 +03:30
n.nakhostin 889a56a9f9 Update Notification Handler to Send Notifications Asynchronously
- Modified the Send method in the NotificationHandler to dispatch notifications asynchronously by using a goroutine, improving responsiveness and allowing the handler to return immediately after initiating the send process.
- This change enhances the user experience by not blocking the request while the notification is being sent, ensuring smoother operation of the API.
2025-10-20 11:57:37 +03:30
n.nakhostin 7b09291271 Improve Error Handling in GetOJS Function
- Enhanced the GetOJS function to include error handling for reading the response body and parsing CSV records, ensuring that errors are properly returned instead of being ignored.
- Added a check to ensure that the CSV records contain data, returning a meaningful error if the calendar is empty, which improves robustness and clarity in error reporting.
2025-10-20 11:42:08 +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 729c73a8af Refactor Notification Service to Handle Optional Image and Link Fields
- Updated the Send method in the notification service to handle optional image and link fields more gracefully by using local variables.
- Improved logging to ensure that the correct values are sent in the notification context, enhancing clarity and maintainability of the notification process.
- This change ensures that nil values for image and link do not cause dereferencing issues, improving overall robustness of the notification sending logic.
2025-10-20 09:38:13 +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 69d201479f Merge branch 'feature/ai-translator' into develop 2025-10-18 09:04:32 +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 952986331a Enhance Notification and User Models with New Fields and Update Swagger Documentation
- Added 'image' and 'link' fields to the NotificationRequest and NotificationResponse structures, improving the flexibility of notification content.
- Updated the 'created_at', 'updated_at', and 'schedule_at' fields to use integer types for Unix timestamps, ensuring consistency in time handling.
- Expanded the tender status enumeration to include 'closed', 'modified', 'suspended', and 'published', enhancing the representation of tender states.
- Reflected these changes in the Swagger documentation, ensuring accurate API specifications for clients.
2025-10-16 16:47:36 +03:30
n.nakhostin fe3ed00a24 Update SearchForm in Feedback Module to Use Query Parameters
- Modified the SearchForm struct to utilize query parameters for feedback search criteria, enhancing API consistency and usability.
- Updated validation tags accordingly to reflect the new query parameter structure, ensuring proper validation during request handling.
2025-10-16 16:20:47 +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
n.nakhostin 02157693af Refactor TED Scraper Initialization in Main Application
- Moved the initialization of the notification service to follow the MongoDB connection setup for better organization.
- Added comments to clarify the initialization sequence of services, including the TED scraper.
- Removed commented-out code related to stopping the scheduler to clean up the main function.
- Enhanced the overall readability and structure of the main application entry point.
2025-10-04 15:25:40 +03:30
n.nakhostin cc3d6163ed Refactor Tender Management to Introduce Notice Entity and Repository
- Replaced the tender repository with a new notice repository, encapsulating notice-related data access methods.
- Introduced the Notice entity to represent tender/contract notices, including relevant fields and methods for managing notice data.
- Updated the TED scraper to utilize the new notice repository for creating and managing notices, enhancing the integration with the tender management system.
- Implemented Ollama SDK initialization in the web bootstrap process, allowing for improved AI interactions.
- Enhanced the tender service to include Ollama SDK for additional functionality, ensuring a more robust service layer.
2025-10-04 15:22:49 +03:30
n.nakhostin 154610e2a0 Add Ollama SDK with Core Functionality and Documentation
- Introduced the Ollama SDK, providing a comprehensive interface for interacting with Ollama AI models, including text generation, chat conversations, embeddings, and model management.
- Implemented core components such as Client, Config, and various request/response entities to facilitate API interactions.
- Added structured error handling with specific error types for improved clarity and debugging.
- Included a README and usage guide to assist developers in integrating the SDK into their applications, ensuring a smooth onboarding experience.
- Established a fluent API for chat interactions and streaming responses, enhancing usability and flexibility for developers.
2025-10-04 15:21:35 +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 366f7290a7 Merge branch 'develop' into feature/ted 2025-10-01 13:32:21 +03:30
n.nakhostin fdcf04abfb Enhance Customer Update Functionality with Asynchronous Username Change Notification
- Added logic to send an asynchronous email notification when a customer's username is updated, improving user communication regarding account changes.
- Introduced a flag to track if the username has changed, ensuring notifications are only sent when necessary.
- Enhanced error handling and logging for successful customer updates, maintaining clarity in operational logs.
2025-10-01 13:23:16 +03:30
n.nakhostin 20aee91467 Refactor Customer and User Repository Methods for ObjectID Handling
- Updated GetByIDs methods in customer and user repositories to convert string IDs to bson.ObjectID, ensuring proper handling of MongoDB object IDs.
- Enhanced error handling for ID conversion to provide clearer feedback when invalid IDs are provided.
- Modified notification service calls in customer and user services to use context.Background() for asynchronous email sending, improving concurrency management.
- Ensured consistent handling of company IDs in the customer repository for retrieving customers by companies.
2025-10-01 13:19:34 +03:30
n.nakhostin 735a808038 Enhance Customer Logout Functionality with Improved Error Handling and Device Token Management
- Updated the Logout method in customer service to retrieve the customer by ID before invalidating the access token, enhancing error logging for failed retrievals.
- Added error handling for the access token invalidation process, ensuring a clear error message is returned if it fails.
- Implemented logic to clear the device token upon logout, updating the customer record accordingly and logging any errors during the update process.
- Improved logging for successful and failed logout operations to enhance traceability.
2025-10-01 13:01:52 +03:30
n.nakhostin 309e0d2523 Update Drone CI Configuration to Include New Feature Branch
- Added 'feature/ted' branch to the Drone CI configuration, allowing for automated builds and tests on this new feature branch.
- This change enhances the CI/CD pipeline by ensuring that developments on the feature branch are properly integrated and tested.
2025-09-30 16:52:55 +03:30
n.nakhostin 44f266189c Refactor TED Calendar and EForm Structure for Enhanced Functionality
- Updated the GetOJS function to accept a base URL parameter, improving flexibility in constructing the calendar URL.
- Removed the deprecated eform.go file, streamlining the codebase by eliminating unused components.
- Introduced new eform structures for BusinessRegistrationInformationNotice, ContractNotice, ContractAwardNotice, and PriorInformationNotice, enhancing the handling of TED XML data.
- Implemented mapping functions to convert eform notices to the Tender entity, improving integration with the tender management system.
- Added a service layer to encapsulate business logic related to eform processing, adhering to Clean Architecture principles.
2025-09-30 16:51:40 +03:30
n.nakhostin 05c7eae8a2 Add TED Scraper Configuration and Cron Scheduler Implementation
- Introduced a new configuration file for the TED scraper, defining database connection settings, logging preferences, and scraping parameters.
- Implemented a CronScheduler to manage scheduled tasks for TED operations, utilizing the robfig/cron library for scheduling.
- Added new entities and structures for handling TED XML data, including eForms and tender-related information, enhancing the scraper's functionality.
- Updated the main application to initialize the TED scraper with the new configuration and set up graceful shutdown handling.
- Removed the deprecated scraping implementation to streamline the codebase and focus on the new architecture.
2025-09-30 16:03:53 +03:30
n.nakhostin 0c50935c42 Remove TED XML Parser and Scraper Implementation
- Deleted the TED XML parser and scraper implementation files, including parser.go, scraper.go, and ted.go, to streamline the codebase and eliminate unused components.
- Commented out the initialization code in main.go to prevent execution while maintaining the structure for future reference.
- Removed the README.md for the TED package, which contained documentation for the now-deleted parser and scraper functionalities.
2025-09-28 14:12:27 +03:30
n.nakhostin fa288fb3fa Refactor Awarded Entity in TED Scraper for Consistency
- Renamed the AwardedEntity type to Awarded in the TED scraper to align with recent naming conventions and improve clarity in the codebase.
2025-09-28 14:01:54 +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 ac7eb0385d Enhance Notification and User Services with Improved Error Handling and Data Consistency
- Updated GetByID methods in user and customer services to return specific "not found" errors for better clarity in error responses.
- Modified NotificationResponse structure to include a new Recipient field, allowing for more flexible recipient handling.
- Changed CreatedAt and UpdatedAt fields in NotificationResponse to use Unix timestamps (int64) for consistency across the application.
- Improved notification retrieval logic to handle potential nil values for user and customer lookups, ensuring robust data handling.
2025-09-27 11:40:17 +03:30