Commit Graph

230 Commits

Author SHA1 Message Date
n.nakhostin 61a217cf09 Enhance Tender Approval Filtering with Created Date Parameters
- Added new query parameters `created_from` and `created_to` to the tender approval endpoints for filtering by creation date using Unix timestamps.
- Updated the `GetByCompanyID` method in the repository and service layers to support the new filtering options.
- Modified the handler methods to parse and pass the new parameters, improving the flexibility of tender approval retrieval.
- Updated API documentation to reflect the new query parameters, ensuring clarity for API consumers.
2025-09-03 10:23:47 +03:30
n.nakhostin 8d3a021fbf Refactor CORS Middleware Configuration in HTTP Server Initialization
- Removed the unused net/http import to clean up the code.
- Updated the CORS middleware configuration to use echo's constants for HTTP methods, enhancing clarity and consistency in the codebase.
- This change improves maintainability by aligning with the framework's conventions and reducing potential errors in method references.
2025-09-02 15:28:52 +03:30
n.nakhostin 9c13b3f27f Refactor ToggleTenderApproval Logic to Simplify Status Check
- Updated the ToggleTenderApproval method to remove the redundant check for SubmissionMode when determining if an existing tender approval should be deleted.
- This change enhances the clarity of the approval logic and improves maintainability by focusing solely on the Status comparison.
2025-09-02 11:56:07 +03:30
n.nakhostin fbf3165169 Refactor Tender Handler to Use ListTendersRequest Struct
- Updated the GetPublicTenders handler to utilize a new ListTendersRequest struct for improved clarity and organization of parameters.
- Changed the handling of `publication_from` and `publication_to` query parameters to use pointers for optional timestamp values.
- Enhanced the service call to ListTenders, aligning with the new request structure and improving the overall code maintainability.
2025-09-02 11:41:51 +03:30
n.nakhostin 8f909618d8 Refactor Feedback Service to Include Tender Information in Responses
- Updated the FeedbackService to include a new dependency on TenderService, allowing feedback responses to include associated tender details.
- Modified the ListFeedback method to return a new FeedbackListWithTenderResponse type, which includes feedback along with tender information.
- Enhanced the feedback entity and form structures to support the new response format, improving the API's capability to provide comprehensive feedback data.
- Adjusted the main application initialization to reflect the changes in the feedback service dependencies.
2025-09-02 11:31:59 +03:30
n.nakhostin c684a12155 Update API Documentation and Enhance Tender Query Parameters
- Changed references in API documentation from `main.HealthResponse` to `bootstrap.HealthResponse` for consistency.
- Added new query parameters `publication_from` and `publication_to` to the tender listing and recommendation endpoints to allow filtering by publication date.
- Updated the `ListTendersRequest` struct to include optional fields for `from` and `to` timestamps.
- Modified the `TenderRepository` and `TenderService` interfaces to support the new filtering parameters in the tender listing functionality.
- Enhanced the service and handler layers to process the new query parameters, improving the flexibility of tender retrieval.
2025-09-02 11:03:38 +03:30
n.nakhostin cbf45a812d Remove docker-compose.yml and update scraper Dockerfile entry point
- Deleted the docker-compose.yml file to streamline the project structure and reduce complexity in managing services.
- Updated the entry point in the scraper Dockerfile to use the correct path for the scraper binary, ensuring proper execution within the container.
2025-08-31 19:03:45 +03:30
n.nakhostin 06d0a9afb6 Update CI Configuration in .drone.yml to Reflect Build Process Changes
- Renamed the pipeline from 'web' to 'build' for clarity in the CI process.
- Updated the 'web tag' step to 'build tag' to better represent its purpose.
- Removed the 'scraper tag' step to streamline the configuration and focus on the build process.
- Ensured the CI configuration aligns with the current build requirements for the application.
2025-08-31 18:07:22 +03:30
n.nakhostin e6bf47a769 Refactor Dockerfile and Update CI Configuration
- Changed the working directory in the Dockerfile to /app for better organization.
- Removed the iat.yaml configuration file to simplify the container setup and reduce complexity.
- Adjusted the exposed port to 80, aligning with standard HTTP practices for the scraper application.
- Updated the CI configuration in .drone.yml to reflect these changes, ensuring a streamlined build process.
2025-08-31 17:13:57 +03:30
n.nakhostin 31cf9a4454 Refactor Dockerfile and Remove iat.yaml Configuration
- Updated the Dockerfile to change the working directory to /app and streamline the build process for the web application.
- Removed the iat.yaml configuration file, simplifying the configuration management and reducing complexity in the container setup.
- Adjusted the entry point and exposed port to align with standard practices, ensuring the application runs on port 80.
2025-08-31 16:48:08 +03:30
n.nakhostin e5e9ebee32 Update iat.yaml Configuration to Change Server Port
- Modified the server port in the iat.yaml configuration file from 8081 to 80, aligning with standard HTTP port usage.
- This change simplifies deployment and access to the web application, ensuring it listens on the default HTTP port.
2025-08-31 16:32:33 +03:30
n.nakhostin b1438870f0 Add Configuration Files for Scraper and Web Applications
- Introduced iat.yaml configuration files for both the scraper and web applications, defining essential settings such as database connections, logging configurations, and scraping parameters.
- Updated the Dockerfiles for both applications to include the new iat.yaml files, ensuring they are available in the container environment for runtime configuration.
- This enhancement improves the maintainability and configurability of both applications, allowing for easier adjustments to settings without code changes.
2025-08-31 16:30:58 +03:30
n.nakhostin ff44ded5f9 Update CI Configuration in .drone.yml to Enhance Build Process
- Renamed the existing 'tag' step to 'web tag' for clarity in the CI pipeline.
- Added a new 'scraper tag' step to generate application version tags based on the current git commit count and branch, improving versioning for the scraper application.
- This update streamlines the CI process and enhances the tagging mechanism for better tracking of application versions.
2025-08-31 14:25:43 +03:30
n.nakhostin 45d2e84fd7 Implement Scraper Dockerfile and Refactor CI Configuration
- Added a new Dockerfile for the scraper application located at cmd/scraper/Dockerfile to streamline the build process.
- Updated the CI configuration in .drone.yml to correctly build the scraper application with the new Dockerfile.
- Refactored the main application entry point to utilize a new bootstrap package for configuration, logging, and MongoDB initialization.
- Enhanced the scraper's configuration management by defining a dedicated Config struct for better organization and maintainability.
2025-08-31 14:23:01 +03:30
n.nakhostin 511155e0a7 Refactor Dockerfile and CI Configuration
- Updated the CI configuration in .drone.yml to use the new Dockerfile located at ./cmd/web/Dockerfile.
- Removed the old Dockerfile and Dockerfile-drone as they are no longer needed.
- Refactored the cmd/web/Dockerfile to streamline the build process and improve organization.
- Introduced a new bootstrap package to handle application initialization, including configuration, logging, MongoDB, Redis, and authorization service setup.
- Added a health check endpoint for monitoring the server status, enhancing the API's operational capabilities.
2025-08-31 14:16:37 +03:30
k.pirzargar 4b3172d058 rupdate 2025-08-30 23:47:36 +03:30
k.pirzargar ea52e87443 add cache 2025-08-30 23:34:15 +03:30
k.pirzargar 3034018ebd Update .drone.yml 2025-08-30 23:21:14 +03:30
k.pirzargar e835a6ac4e add build tow project 2025-08-30 23:18:19 +03:30
k.pirzargar 397121cec3 Add .drone.yml 2025-08-30 23:12:55 +03:30
k.pirzargar 8c7f5b13f8 Add Dockerfile-drone 2025-08-30 23:10:18 +03:30
k.pirzargar b9a54fd4f0 Add cmd/web/Dockerfile 2025-08-30 16:13:31 +03:30
n.nakhostin 3024998e7e Update Tender Approval Status to Include Submitted State and Revise API Documentation
- Changed the approval status from "approved" to "submitted" in various locations, including entity definitions, forms, and service methods, to accurately reflect the tender approval process.
- Updated API documentation in Swagger JSON, YAML, and Go files to describe the new status options ("submitted" and "rejected") and their corresponding descriptions.
- Enhanced the tender approval statistics structures to include a count for submitted tenders, improving the overall data model for tender management.
- These changes ensure clarity in the tender approval workflow and enhance the usability of the API for clients interacting with tender approvals.
2025-08-25 13:51:14 +03:30
n.nakhostin 0e14a11daf Add Company Feedback Statistics Endpoint and Update API Documentation
- Introduced a new endpoint to retrieve comprehensive feedback statistics for the authenticated user's company, including total likes, dislikes, and percentage calculations.
- Implemented the GetCompanyFeedbackStats method in the feedback handler to handle requests, ensuring proper authentication and error handling.
- Updated Swagger JSON, YAML, and Go documentation to accurately reflect the new endpoint, including detailed descriptions, parameters, and response formats for the CompanyFeedbackStatsResponse.
- Enhanced the feedback repository and service layers to support the new statistics functionality, improving the overall data handling capabilities of the tender management system.
- These changes enhance the usability and functionality of the API, providing valuable insights into company feedback statistics.
2025-08-25 13:39:35 +03:30
n.nakhostin 488d43380b Refactor Tender Approval Logic and Update Statistics Structure
- Modified the Reject method in the TenderApproval entity to reset the SubmissionMode field upon rejection, ensuring proper state management.
- Simplified the TenderApprovalStatsResponse and CompanyTenderApprovalStatsResponse structures by removing unnecessary fields related to submission modes, streamlining the data model for tender approval statistics.
- Updated the GetTenderApprovalStats and GetCompanyTenderApprovalStats methods in the repository to reflect the changes in the statistics structure, enhancing clarity and maintainability.
- These adjustments improve the overall functionality and data handling of the tender management system.
2025-08-25 13:39:28 +03:30
n.nakhostin 531f8e2baf Enhance TenderResponse Structure with TenderID Field
- Added a new field 'TenderID' to the TenderResponse structure, improving the data model for tender management.
- Updated the ToTenderResponse method to include the TenderID in the response, ensuring consistency in API outputs.
- This enhancement aligns with the ongoing improvements to the tender management system's data handling capabilities.
2025-08-25 13:23:47 +03:30
n.nakhostin f67e179ffc Update .gitignore, adjust TED scraper configuration, and enhance Tender entity structure
- Added 'ted_samples/' to .gitignore to exclude TED sample files from version control.
- Updated the TED scraper configuration to extend the cleanup duration from 24 hours to 72 hours, allowing for better resource management.
- Enhanced the Tender entity by adding new fields: TenderDeadline, SubmissionDeadline, ApplicationDeadline, and SubmissionURL, improving the data model for tender management.
- Updated the TenderResponse structure to include the new fields, ensuring consistency in API responses.
- Implemented logic in the TED scraper to calculate submission and application deadlines based on tender deadlines, enhancing the scraping functionality.
2025-08-25 13:13:40 +03:30
n.nakhostin b26d77b4cf Enhance Feedback and Tender Approval Services with Toggle Functionality
- Updated the ToggleFeedback method in the feedback service to change the FeedbackType to "unlike" or "undislike" based on the current state, improving user interaction with feedback.
- Modified the ToggleTenderApproval method in the tender approval service to update the Status to "unapproved" or "unrejected" depending on the current approval state, streamlining tender approval management.
- These enhancements improve the overall functionality and user experience of the tender management system.
2025-08-20 12:38:54 +03:30
n.nakhostin 1b27ad5304 Remove 'country' field from CompanyProfileResponse and update API documentation accordingly
- Eliminated the 'country' field from the CompanyProfileResponse structure in the entity, Swagger JSON, YAML, and Go documentation.
- This change streamlines the response format for company profiles, ensuring clarity and consistency in the API documentation.
- Updated relevant documentation files to reflect the removal, enhancing the overall usability of the API.
2025-08-20 12:32:34 +03:30
n.nakhostin ff3f5a9b8f Add Company Information Access to API Documentation
- Updated API documentation to include a new section for company information access, detailing operations related to company profiles and tenders.
- Enhanced Swagger JSON, YAML, and Go documentation to accurately reflect the new "Company" tag, ensuring clarity for mobile application users.
- This addition improves the overall usability of the API by providing comprehensive information on company-related functionalities.
2025-08-20 12:29:27 +03:30
n.nakhostin 843ae22515 Add Company Profile Retrieval Endpoint and Update API Documentation
- Introduced a new public API endpoint to retrieve the profile of the authenticated user's company, enhancing the functionality of the tender management system.
- Implemented the `MyCompany` method in the company handler to handle requests for the company profile, ensuring proper authentication and error handling.
- Updated Swagger and YAML documentation to accurately reflect the new endpoint, including detailed descriptions, parameters, and response formats for the `CompanyProfileResponse`.
- Modified the router to include the new company profile route, ensuring adherence to Clean Architecture principles and maintaining a clear separation of concerns in the handler layer.
- Enhanced the public routes registration to include the company handler, improving the overall API structure and usability.
2025-08-20 12:14:14 +03:30
n.nakhostin e292839732 Update API Documentation for Tender ID Parameter Location
- Changed the parameter location for `tender_id` from "query" to "path" in the API documentation across multiple files, including Swagger JSON, YAML, and Go documentation.
- Updated the handler method to retrieve `tender_id` from the path instead of the query parameters, ensuring consistency with the updated API structure.
- This change enhances the clarity of the API documentation and aligns with Clean Architecture principles by accurately reflecting the intended usage of the `tender_id` parameter.
2025-08-19 14:38:51 +03:30
n.nakhostin b3575bb5e6 Update Location Code in Tender ID Generation Logic
- Changed the location code in the `generateTenderID` method from "EURO" to "EU" to accurately reflect the country code.
- This modification enhances the clarity and correctness of the tender ID generation process, ensuring adherence to Clean Architecture principles.
2025-08-19 12:42:31 +03:30
n.nakhostin 2ffba3aa32 Refactor Tender ID Generation Logic in TED Scraper
- Updated the `generateTenderID` method to improve the structure and clarity of the tender ID generation process.
- Changed the source identifier from "TED" to "1" for consistency.
- Modified the handling of the Notice Publication ID, ensuring it is used correctly in the tender ID.
- Simplified the buyer code logic by commenting out the previous implementation, focusing on the essential components.
- Adjusted the date and location code handling to enhance clarity and maintainability, ensuring adherence to Clean Architecture principles.
2025-08-19 12:09:25 +03:30
n.nakhostin f4152ec8a0 Refactor MongoDB Repository Interface by Removing Bulk Operations
- Removed the BulkCreate, BulkUpdate, and BulkDelete methods from the Repository interface to streamline the data access layer.
- Updated the FindMany method to maintain functionality while adhering to Clean Architecture principles.
- This change simplifies the repository interface, focusing on essential operations and improving maintainability.
2025-08-19 11:40:02 +03:30
n.nakhostin 81914e2eeb Add Company Tender Approval Statistics Endpoint and Update API Documentation
- Introduced a new API endpoint to retrieve company-specific tender approval statistics, enhancing the analytics capabilities of the tender management system.
- Implemented the `GetCompanyTenderApprovalStats` method in the service layer to fetch detailed statistics, including total approvals, approved and rejected tenders, and submission counts.
- Updated Swagger documentation to accurately reflect the new endpoint, including detailed descriptions, parameters, and response formats for the `CompanyTenderApprovalStatsResponse`.
- Enhanced the router to include the new statistics route, ensuring adherence to Clean Architecture principles and maintaining a clear separation of concerns in the handler layer.
- Added necessary request and response forms to support the new functionality, improving the overall API structure and usability.
2025-08-19 11:27:40 +03:30
n.nakhostin 392b31626d Refactor Tender Approval Management and Update API Documentation
- Replaced the existing tender approval update and delete endpoints with a new toggle functionality, allowing for more streamlined management of tender approvals.
- Introduced the `ToggleTenderApproval` method in the service layer to handle both approval and rejection actions based on the current state of the tender approval.
- Updated the API documentation to reflect the new endpoint structure and response formats, including the `TenderApprovalWithTenderResponse`.
- Enhanced Swagger documentation to ensure accurate representation of the updated tender approval operations.
- Removed obsolete methods and routes to maintain a clean and efficient codebase, adhering to Clean Architecture principles.
2025-08-19 11:01:49 +03:30
n.nakhostin dd2573a308 Enhance Tender Approval Service with Tender Details Integration
- Updated the tender approval service to include methods for retrieving tender approvals with associated tender details, improving the response structure for API consumers.
- Modified the tender approval handler to utilize the new service methods, ensuring that tender details are included in the responses for created, updated, and retrieved tender approvals.
- Enhanced the API documentation to reflect the changes in response formats, including the new `TenderApprovalWithTenderResponse` structure.
- Ensured adherence to Clean Architecture principles by maintaining a clear separation of concerns in the service and handler layers.
2025-08-18 19:23:34 +03:30
n.nakhostin 94d0fbef38 Add Tender Approval Management Functionality and API Enhancements
- Introduced a new tender approval management system, including the creation of tender approval entities, services, and repositories.
- Implemented CRUD operations for tender approvals, allowing companies to approve or reject tenders.
- Developed administrative and public API endpoints for listing, retrieving, and updating tender approvals with comprehensive filtering options.
- Enhanced Swagger documentation to accurately reflect the new endpoints, including detailed descriptions, parameters, and response formats.
- Updated existing routes to include tender approval management, ensuring adherence to Clean Architecture principles and maintaining a clear separation of concerns in the handler layer.
2025-08-18 19:00:41 +03:30
n.nakhostin a8ef631e43 Add Feedback Retrieval Endpoint for Tender ID
- Introduced a new API endpoint to retrieve feedback details by tender ID, enhancing the feedback management system for public users.
- Updated Swagger documentation to accurately reflect the new endpoint, including detailed descriptions, parameters, and response formats.
- Implemented necessary service and repository methods to support the new functionality, ensuring adherence to Clean Architecture principles.
- Modified existing routes to include the new feedback retrieval functionality, maintaining a clear separation of concerns in the handler layer.
- Enhanced feedback types to include 'unlike' and 'undislike' options for better user interaction.
2025-08-17 13:29:44 +03:30
n.nakhostin 4663a9781e Enhance Tender API with New Recommendation Endpoint and Route Updates
- Updated the tender API to include a new endpoint for recommending public tenders based on company profiles, enhancing user experience for mobile application users.
- Modified existing routes to reflect the new structure, changing the tender details route and adding a dedicated recommendation route.
- Improved Swagger documentation to accurately represent the new endpoint, including detailed descriptions, parameters, and response formats.
- Ensured adherence to Clean Architecture principles by maintaining clear separation of concerns in the service and handler layers.
2025-08-17 08:40:28 +03:30
n.nakhostin e986ee4135 Refactor Tender Management System by Removing Scraping Functionality and Enhancing Tender API
- Removed all scraping-related functionality, including routes, handlers, services, and repository methods, to streamline the tender management system.
- Updated the tender API to focus solely on tender management, enhancing endpoints for listing, retrieving, and updating tenders.
- Improved Swagger documentation to reflect the removal of scraping endpoints and the addition of new tender-related features.
- Ensured adherence to Clean Architecture principles throughout the refactoring process, maintaining a clear separation of concerns.
2025-08-16 16:52:17 +03:30
n.nakhostin 21b736b55b Implement Feedback Management System with CRUD Operations and API Enhancements
- Introduced a new feedback management system, including the creation of feedback entities, services, and repositories.
- Implemented CRUD operations for feedback, allowing users to submit likes and dislikes on tenders.
- Developed administrative endpoints for listing and retrieving feedback with comprehensive filtering options.
- Enhanced public API to allow users to view feedback related to tenders.
- Updated Swagger documentation to reflect new feedback endpoints and their functionalities.
- Removed obsolete configuration file `config.yaml` as part of the transition to a modular configuration system.
- Ensured adherence to Clean Architecture principles throughout the implementation.
2025-08-16 16:00:03 +03:30
n.nakhostin 126913365f Update README with Phase 1 Implementation Status and TODO List
- Added detailed status of Phase 1 implementation, indicating current completion at 70-75%.
- Documented completed features, partially implemented features, and missing features to provide clarity on project progress.
- Included a comprehensive TODO list categorized by priority, outlining critical, medium, and low priority tasks for upcoming development phases.
- Enhanced project visibility and planning for future enhancements, particularly focusing on the feedback system and advanced mobile features.
2025-08-16 10:54:07 +03:30
n.nakhostin 05165c6587 Remove company_id field from user-related forms and documentation
- Deleted the company_id field from CreateUserForm, User entity, and related API documentation in Swagger and YAML files to streamline user creation process.
- Updated the CreateUser service method to reflect the removal of company_id, ensuring consistency across the user management functionality.
2025-08-16 10:52:45 +03:30
n.nakhostin 0a23ff985a Enhance Tender Management with Company-Based Matching and API Updates
- Updated the tender service to include company-based matching for tenders, allowing for more relevant results based on company CPV codes.
- Modified the ListTenders endpoint to accept a company ID parameter for calculating match percentages and sorting tenders accordingly.
- Refactored the tender response structure to include match percentage and days until deadline for better client-side handling.
- Updated API documentation to reflect changes in the tender listing functionality and added new endpoints for public tender access.
- Removed deprecated customer-related methods and streamlined customer listing functionality for improved clarity and performance.
2025-08-13 19:47:58 +03:30
n.nakhostin 96c21b8b78 Implement TED Scraper and Configuration Management
- Introduced a new TED scraper in `cmd/scraper` to handle downloading and parsing TED XML files.
- Added configuration management for the scraper, including a new `Config` struct and YAML configuration file.
- Created necessary handler, service, and repository layers for tender management, adhering to Clean Architecture principles.
- Implemented comprehensive logging and error handling throughout the scraper functionality.
- Updated API routes to include tender management operations, enhancing the overall system capabilities.
2025-08-13 16:52:24 +03:30
n.nakhostin b7fa012d13 Refactor configuration management by migrating to a modular config system
- Removed the old `infra.Config` structure and replaced it with a new modular configuration system in `pkg/config`.
- Introduced a `Config` struct in `cmd/web/config.go` to hold command-specific configurations.
- Updated configuration loading functions to utilize the new `LoadConfig` method with generics for type safety.
- Adjusted various initialization functions in `cmd/web/bootstrap.go` and `cmd/web/main.go` to reflect the new configuration structure.
- Cleaned up the `config.yaml` by removing obsolete fields and ensuring it aligns with the new configuration schema.
2025-08-13 12:51:36 +03:30
Hadi Barzegar e3a32e151f Merge pull request 'XML Parser' (#4) from feature/xml-parser into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_back/pulls/4
2025-08-12 13:06:22 +03:30
n.nakhostin 5322d3cd8e Add comprehensive tests for XML parser functionality
- Introduced benchmark tests for various XML parsing methods, including parsing from strings, bytes, and readers, to evaluate performance.
- Added unit tests for the parser interface and validation mechanisms, ensuring robust error handling and validation logic.
- Implemented tests for utility functions related to XML processing, enhancing overall test coverage and reliability.
- Created a test suite for the TED domain, validating the structure and functionality of contract notices and related entities.
- Developed a comprehensive test runner script to facilitate automated testing, coverage analysis, and performance benchmarking for the XML parser package.
2025-08-12 12:51:24 +03:30