Commit Graph

220 Commits

Author SHA1 Message Date
Nima Nakhostin 00fabe8a30 Enhance Notice Repository with Additional Indexes
- Added new indexes for the notices collection in the notice repository to improve query performance.
- Introduced indexes for `processing_metadata.processed` and `main_classification`, optimizing data retrieval and management.
2025-11-30 12:43:51 +03:30
Mazyar b6546eb2bb tendsign scraper 2025-11-30 02:58:08 +03:30
Nima Nakhostin d57bf95c70 Update CMSForm Country Field Validation
- Modified the validation rule for the Country field in the CMSForm struct to ensure it requires exactly 3 characters, enhancing input validation consistency.
- This change improves the robustness of the form handling by enforcing stricter validation criteria.
2025-11-29 12:50:56 +03:30
Nima Nakhostin e2e9159ac3 Update GetUnProcessedNotices to filter by main_classification and change sort order
- Modified the GetUnProcessedNotices method in the notice repository to include a filter for main_classification set to "72000000".
- Changed the sort order from ascending to descending for the created_at field, improving the retrieval of unprocessed notices.
2025-11-29 10:11:51 +03:30
Mazyar 5062c19242 changed search inquiry response to grt meta outside of the data 2025-11-25 12:53:17 +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 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
Mazyar ba06595ab0 added UUID to card and form field 2025-11-15 10:51:04 +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 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 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 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 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 69d201479f Merge branch 'feature/ai-translator' into develop 2025-10-18 09:04:32 +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 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 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 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 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 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
n.nakhostin 7110e55cf5 Update API Documentation and Swagger Configuration for Opplens
- Changed API title and version in Swagger documentation from "Tender Management API" to "Opplens API" with version 1.0.0.
- Updated contact information and terms of service URLs to reflect the new branding for Opplens.
- Added a new "Notification" tag in the Swagger documentation for public notification management operations.
- Adjusted the Swagger endpoint path for documentation to improve routing consistency.
- Enhanced response structure in notification handlers to include metadata, improving clarity in API responses.
2025-09-27 10:57:30 +03:30
n.nakhostin 939f940499 Enhance Customer Module with Validation and Username Handling
- Introduced a new ValidationService for customer operations to ensure valid username formats.
- Updated customer service and handler to utilize the new validation service, enhancing input validation during registration and updates.
- Modified CreateCustomerForm and UpdateCustomerForm to enforce username validation rules.
- Adjusted repository indexing to improve search efficiency by refining the text index for customer data.
- Ensured consistent handling of usernames across the customer module, improving overall data integrity and user experience.
2025-09-24 12:57:23 +03:30
n.nakhostin 080c1d18e5 Normalize Username Handling in Customer and User Services
- Updated the Register, Update, and Login methods in both customer and user services to ensure usernames are consistently stored and processed in lowercase.
- Modified notification messages to reflect the lowercase username format, enhancing clarity and consistency in user communications.
- Improved username existence checks during registration and updates to prevent case-sensitive duplicates, ensuring a more robust user experience.
2025-09-24 12:29:49 +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 e1ae090ff9 Refactor Notification Routes for Improved Endpoint Structure
- Updated the notification routes to enhance clarity and usability by changing the endpoint for marking notifications as seen.
- Introduced a new route for marking all notifications as seen, improving the API's functionality and user experience.
- Updated Swagger documentation to reflect the changes in endpoint paths, ensuring accurate API documentation for consumers.
2025-09-23 10:33:17 +03:30
n.nakhostin c2531a005e Implement ObjectID Conversion in GetByIDs Method of Company Repository
- Enhanced the GetByIDs method to convert string IDs to BSON ObjectIDs before querying the database, ensuring proper data type handling.
- This change improves the robustness of the method by preventing potential errors related to ID format mismatches during database operations.
2025-09-22 14:04:15 +03:30
n.nakhostin fe70c7170b Add Notification Filters and AllMarkSeen Endpoint to API Documentation
- Introduced new query parameters for filtering notifications by 'seen' status and 'priority' in the API documentation, enhancing the flexibility of notification retrieval.
- Added a new endpoint to mark all notifications as seen for a user, including detailed Swagger documentation for the new functionality.
- Updated existing API documentation to reflect the changes, ensuring clarity for API consumers and improving overall documentation quality.
2025-09-22 13:05:10 +03:30
n.nakhostin ef9ad22841 Refactor Customer Repository Login Method to Simplify Device Token Handling
- Removed the use of the slices package for checking existing device tokens during customer login.
- Updated the Login method to directly assign the device token to the customer, ensuring a more straightforward approach to managing device tokens.
- Enhanced code readability by eliminating unnecessary checks, streamlining the login process for customers.
2025-09-22 11:57:19 +03:30
n.nakhostin ddf4d9abc4 Enhance Customer Service with Notification Response Structures
- Introduced CustomerNotificationResponse struct to provide a detailed response format for customer notifications, improving the clarity of notification data.
- Updated the Customer service interface to include methods for searching and retrieving customers with notification-specific responses, enhancing the flexibility of customer data retrieval.
- Modified the Login method to accept a device token, allowing for better tracking of customer devices during login.
- Refactored existing methods to utilize the new notification response structure, ensuring consistency across customer-related API responses.
- Enhanced error handling and logging in the service layer for improved traceability during customer searches and logins.
2025-09-22 11:47:31 +03:30
n.nakhostin 733d726df6 Add AllMarkSeen Functionality to Notification System
- Introduced the AllMarkSeen method in the notification service to mark all notifications as seen for a user, enhancing user experience by allowing bulk actions on notifications.
- Implemented the PublicAllMarkSeen handler to handle HTTP requests for marking all notifications as seen, ensuring proper request validation and response handling.
- Updated the notification client and SDK to support the new AllMarkSeen functionality, improving the overall API capabilities.
- Enhanced API documentation with Swagger comments for the new endpoint, ensuring clarity for API consumers.
2025-09-22 10:07:02 +03:30
n.nakhostin aef91b4711 Add Notification Filters for Seen and Priority
- Introduced new optional fields in the SearchForm for filtering notifications by 'seen' status and 'priority', enhancing the flexibility of notification retrieval.
- Updated the GetNotifications method in the notification service to accommodate the new filters, ensuring they are included in the query parameters.
- Enhanced the notification client to support the new filters in API requests, improving the overall functionality of the notification system.
- Updated API documentation with Swagger comments to reflect the new query parameters, ensuring clarity for API consumers.
2025-09-22 09:57:14 +03:30
n.nakhostin 4d7344421b Refactor Notification Sending Logic to Include Channel Checks
- Updated the Send method in the notification service to check for specified delivery channels (Push and Email) before sending notifications, enhancing the flexibility of the notification system.
- Utilized the slices package to streamline the channel checking process, improving code readability and maintainability.
- Ensured that notifications are only sent to recipients based on the selected channels, promoting more efficient notification delivery.
2025-09-21 15:05:01 +03:30
n.nakhostin 29bca402a4 Refactor Notification Sending Logic in Customer and User Services
- Updated the notification sending logic in the customer and user service layers to send emails synchronously instead of using goroutines, improving clarity and ensuring immediate feedback on notification processing.
- Ensured that all relevant service methods (Register, UpdateStatus, RequestResetPassword, ResetPassword) are updated to reflect these changes, promoting consistency in notification handling across services.
2025-09-21 14:59:40 +03:30
n.nakhostin 67b2058506 Refactor Notification Handler to Use Customer Context for User ID Retrieval
- Updated the CustomerNotifications and PublicMarkSeen methods in NotificationHandler to retrieve the customer ID from context instead of the user ID, aligning with the new customer-centric approach.
- This change enhances the integration between notifications and customer management, ensuring that notifications are correctly associated with customers.
- Maintained existing error handling for missing customer ID, ensuring robustness in the notification retrieval process.
2025-09-21 14:44:59 +03:30
n.nakhostin c22d98d4bb Integrate Notification SDK into Inquiry Service
- Updated the InquiryService to include a notification SDK for sending notifications upon inquiry creation, enhancing user engagement.
- Modified the NewInquiryService constructor to accept the notification SDK as a dependency, adhering to dependency injection principles.
- Refactored the Create method to send notifications with inquiry details, improving communication and response to inquiries.
- Cleaned up commented-out code related to duplicate inquiry checks for better readability and maintainability.
2025-09-21 12:23:26 +03:30
n.nakhostin 5906904caf Enhance Notification System with New API Endpoints and Response Structures
- Added new endpoints for marking notifications as seen and retrieving detailed notification information for both admin and user contexts, improving the flexibility of the notification system.
- Implemented the MarkSeen and ViewNotification methods in the NotificationHandler, ensuring proper handling of notification visibility and details retrieval.
- Updated the NotificationService interface to include methods for getting notification details and marking notifications as seen, enhancing service capabilities.
- Enhanced the notification response structures to include additional fields such as Image, Seen, and ScheduledAt, providing richer data in API responses.
- Updated API documentation with Swagger comments for the new endpoints and response formats, ensuring clarity for API consumers.
2025-09-21 11:26:54 +03:30
n.nakhostin fc687b116a Enhance Customer Service with Company Loading Logic
- Added functionality to load associated companies for customers during registration and updates, improving the completeness of customer responses.
- Implemented error logging for failures in loading companies, ensuring better traceability of issues.
- Updated the response structure to include company information in customer responses, enhancing the API's usability and data richness.
- Removed the unused GetProfile method to streamline the service layer and improve code maintainability.
2025-09-21 10:09:06 +03:30
n.nakhostin d76d764387 Remove Password Field from UpdateCustomerForm for Enhanced Security
- Eliminated the Password field from the UpdateCustomerForm to improve security practices and reduce the risk of exposing sensitive information.
- Ensured that the form continues to validate other necessary fields, maintaining the integrity of customer updates.
2025-09-21 10:00:16 +03:30
n.nakhostin 19cd346b1c Enhance Notification Management with New Endpoints and Response Structures
- Added new endpoints for retrieving notifications for both admins and users, improving the flexibility of the notification system.
- Implemented query parameters for filtering notifications by status, method, event type, type, and recipient, enhancing usability.
- Introduced new response structures for notifications, including pagination information, to provide better data handling in API responses.
- Updated API documentation with Swagger comments for the new endpoints and response formats, ensuring clarity for API consumers.
- Refactored notification handling logic to support the new features, promoting a more robust notification management system.
2025-09-20 17:41:21 +03:30