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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user