Commit Graph

136 Commits

Author SHA1 Message Date
m.nazemi 3d651f8596 worker notice default limit 2026-04-15 04:28:51 +03:30
Mazyar e0e8b9cf04 ted one-time api 2026-02-23 15:40:20 +03:30
Mazyar e6005ee0ee kanban dashboard 2026-01-05 15:36:20 +03:30
Mazyar 8dcda0e031 added AI auto-generated keywords to customer profile 2026-01-04 13:44:45 +03:30
Nima Nakhsotin 91e92675aa Merge branch 'develop' into integration 2025-12-27 16:03:24 +03:30
Mazyar f6bdcc6d7c Implemented the integration with scraper python server, tenders summarise, and some fixes. 2025-12-27 12:47:08 +03:30
Mazyar 6b387e2973 tender email confirmation template 2025-12-14 13:45:47 +03:30
Nima Nakhsotin 8969152f0d Merge branch 'develop' into TM-295 2025-12-10 14:28:04 +03:30
Mazyar 90e4624342 error message for duplication 2025-12-09 13:06:45 +03:30
Mazyar ec3737e341 Merge branch 'develop' into TM-309 2025-12-08 12:08:44 +03:30
Nima Nakhsotin 03ea86ca6a Merge branch 'develop' into TM-316 2025-12-08 10:16:23 +03:30
Mazyar 7fb182f180 xss validation 2025-12-07 23:52:17 +03:30
Mazyar fbf99177a9 send confirmation email after form submission 2025-12-07 10:52:31 +03:30
Mazyar b01c0f9368 added hcaptcha 2025-12-05 18:10:05 +03:30
Mazyar 5e777ceec8 scraper sdk 2025-12-01 11:06:09 +03:30
Nima Nakhsotin d94fa34941 Merge branch 'develop' into scraper 2025-11-30 12:48:31 +03:30
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