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:
+76
-20
@@ -748,6 +748,20 @@ definitions:
|
||||
is_verified:
|
||||
type: boolean
|
||||
type: object
|
||||
feedback.CompanyFeedbackStatsResponse:
|
||||
properties:
|
||||
company_id:
|
||||
type: string
|
||||
last_updated:
|
||||
description: Unix timestamp
|
||||
type: integer
|
||||
total_dislikes:
|
||||
type: integer
|
||||
total_feedback:
|
||||
type: integer
|
||||
total_likes:
|
||||
type: integer
|
||||
type: object
|
||||
feedback.FeedbackListResponse:
|
||||
properties:
|
||||
feedback:
|
||||
@@ -860,6 +874,8 @@ definitions:
|
||||
type: object
|
||||
tender.TenderResponse:
|
||||
properties:
|
||||
application_deadline:
|
||||
type: integer
|
||||
buyer_organization:
|
||||
$ref: '#/definitions/tender.OrganizationResponse'
|
||||
country_code:
|
||||
@@ -888,8 +904,12 @@ definitions:
|
||||
$ref: '#/definitions/tender.TenderStatus'
|
||||
submission_deadline:
|
||||
type: integer
|
||||
submission_url:
|
||||
type: string
|
||||
tender_deadline:
|
||||
type: integer
|
||||
tender_id:
|
||||
type: string
|
||||
title:
|
||||
type: string
|
||||
type: object
|
||||
@@ -941,16 +961,6 @@ definitions:
|
||||
- ApprovalStatusRejected
|
||||
tender_approval.CompanyTenderApprovalStatsResponse:
|
||||
properties:
|
||||
approvals_by_status:
|
||||
additionalProperties:
|
||||
format: int64
|
||||
type: integer
|
||||
type: object
|
||||
approvals_by_submission:
|
||||
additionalProperties:
|
||||
format: int64
|
||||
type: integer
|
||||
type: object
|
||||
approved_tenders:
|
||||
type: integer
|
||||
company_id:
|
||||
@@ -1026,16 +1036,6 @@ definitions:
|
||||
type: object
|
||||
tender_approval.TenderApprovalStatsResponse:
|
||||
properties:
|
||||
approvals_by_status:
|
||||
additionalProperties:
|
||||
format: int64
|
||||
type: integer
|
||||
type: object
|
||||
approvals_by_submission:
|
||||
additionalProperties:
|
||||
format: int64
|
||||
type: integer
|
||||
type: object
|
||||
approved_tenders:
|
||||
type: integer
|
||||
last_updated:
|
||||
@@ -4786,6 +4786,62 @@ paths:
|
||||
summary: Get feedback by ID
|
||||
tags:
|
||||
- Feedback
|
||||
/api/v1/feedback/stats/company:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Retrieve comprehensive feedback statistics for the authenticated
|
||||
user's company including total likes, dislikes, and percentage calculations.
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Company feedback statistics retrieved successfully
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/feedback.CompanyFeedbackStatsResponse'
|
||||
type: object
|
||||
"400":
|
||||
description: Bad request - Missing company association
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
error:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
"401":
|
||||
description: Unauthorized - User not authenticated
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
error:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
error:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Get company feedback statistics
|
||||
tags:
|
||||
- Feedback
|
||||
/api/v1/feedback/tender/{tender_id}:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user