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.
This commit is contained in:
n.nakhostin
2025-08-25 13:39:35 +03:30
parent 488d43380b
commit 0e14a11daf
8 changed files with 477 additions and 76 deletions
+9
View File
@@ -30,6 +30,15 @@ type FeedbackResponse struct {
CompanyId *string `json:"company_id"`
}
// CompanyFeedbackStatsResponse represents the response for company feedback statistics
type CompanyFeedbackStatsResponse struct {
CompanyID string `json:"company_id"`
TotalLikes int64 `json:"total_likes"`
TotalDislikes int64 `json:"total_dislikes"`
TotalFeedback int64 `json:"total_feedback"`
LastUpdated int64 `json:"last_updated"` // Unix timestamp
}
// GetDateFromTime returns the date_from as time.Time
func (f *ListFeedbackForm) GetDateFromTime() *time.Time {
if f.DateFrom == nil {