Refactor Feedback Module for Consistency and Clarity
- Updated feedback repository and service methods to use a consistent naming convention, changing `NewTenderRepository` and similar methods to `NewRepository`. - Refactored feedback handler methods to improve clarity by renaming methods such as `ListFeedback` to `Search` and `GetFeedback` to `Get`. - Enhanced feedback response structures to include detailed company and tender information, improving the clarity of feedback data returned to API consumers. - Updated Swagger documentation to reflect changes in feedback response structures and endpoint paths, ensuring accurate representation of the API for consumers.
This commit is contained in:
+102
-22
@@ -5026,7 +5026,7 @@ const docTemplate = `{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/feedback.CompanyFeedbackStatsResponse"
|
||||
"$ref": "#/definitions/feedback.StatsResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7675,27 +7675,6 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.CompanyFeedbackStatsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"company_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_updated": {
|
||||
"description": "Unix timestamp",
|
||||
"type": "integer"
|
||||
},
|
||||
"total_dislikes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_feedback": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_likes": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.FeedbackListResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -7713,6 +7692,9 @@ const docTemplate = `{
|
||||
"feedback.FeedbackResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"company": {
|
||||
"$ref": "#/definitions/feedback.companyResponse"
|
||||
},
|
||||
"company_id": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -7729,6 +7711,9 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
},
|
||||
"tender": {
|
||||
"$ref": "#/definitions/feedback.tenderResponse"
|
||||
},
|
||||
"tender_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
@@ -7747,6 +7732,29 @@ const docTemplate = `{
|
||||
"FeedbackTypeDislike"
|
||||
]
|
||||
},
|
||||
"feedback.StatsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"company": {
|
||||
"$ref": "#/definitions/feedback.companyResponse"
|
||||
},
|
||||
"company_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_updated": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_dislikes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_feedback": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_likes": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.ToggleFeedbackForm": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -7770,6 +7778,78 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.companyResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.organizationResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.tenderResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"buyer_organization": {
|
||||
"$ref": "#/definitions/feedback.organizationResponse"
|
||||
},
|
||||
"country_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"currency": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"duration": {
|
||||
"type": "string"
|
||||
},
|
||||
"duration_unit": {
|
||||
"type": "string"
|
||||
},
|
||||
"estimated_value": {
|
||||
"type": "number"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"notice_publication_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"procedure_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"procurement_type_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"publication_date": {
|
||||
"type": "integer"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"submission_deadline": {
|
||||
"type": "integer"
|
||||
},
|
||||
"tender_deadline": {
|
||||
"type": "integer"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"inquiry.CreateInquiryForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
+102
-22
@@ -5020,7 +5020,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/feedback.CompanyFeedbackStatsResponse"
|
||||
"$ref": "#/definitions/feedback.StatsResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7669,27 +7669,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.CompanyFeedbackStatsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"company_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_updated": {
|
||||
"description": "Unix timestamp",
|
||||
"type": "integer"
|
||||
},
|
||||
"total_dislikes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_feedback": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_likes": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.FeedbackListResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -7707,6 +7686,9 @@
|
||||
"feedback.FeedbackResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"company": {
|
||||
"$ref": "#/definitions/feedback.companyResponse"
|
||||
},
|
||||
"company_id": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -7723,6 +7705,9 @@
|
||||
"type": "string"
|
||||
},
|
||||
"tender": {
|
||||
"$ref": "#/definitions/feedback.tenderResponse"
|
||||
},
|
||||
"tender_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
@@ -7741,6 +7726,29 @@
|
||||
"FeedbackTypeDislike"
|
||||
]
|
||||
},
|
||||
"feedback.StatsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"company": {
|
||||
"$ref": "#/definitions/feedback.companyResponse"
|
||||
},
|
||||
"company_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_updated": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_dislikes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_feedback": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_likes": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.ToggleFeedbackForm": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -7764,6 +7772,78 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.companyResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.organizationResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"feedback.tenderResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"buyer_organization": {
|
||||
"$ref": "#/definitions/feedback.organizationResponse"
|
||||
},
|
||||
"country_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"currency": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"duration": {
|
||||
"type": "string"
|
||||
},
|
||||
"duration_unit": {
|
||||
"type": "string"
|
||||
},
|
||||
"estimated_value": {
|
||||
"type": "number"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"notice_publication_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"procedure_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"procurement_type_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"publication_date": {
|
||||
"type": "integer"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"submission_deadline": {
|
||||
"type": "integer"
|
||||
},
|
||||
"tender_deadline": {
|
||||
"type": "integer"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"inquiry.CreateInquiryForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
+67
-15
@@ -512,20 +512,6 @@ definitions:
|
||||
example: reset_token_here
|
||||
type: string
|
||||
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:
|
||||
@@ -537,6 +523,8 @@ definitions:
|
||||
type: object
|
||||
feedback.FeedbackResponse:
|
||||
properties:
|
||||
company:
|
||||
$ref: '#/definitions/feedback.companyResponse'
|
||||
company_id:
|
||||
type: string
|
||||
created_at:
|
||||
@@ -548,6 +536,8 @@ definitions:
|
||||
id:
|
||||
type: string
|
||||
tender:
|
||||
$ref: '#/definitions/feedback.tenderResponse'
|
||||
tender_id:
|
||||
type: string
|
||||
updated_at:
|
||||
type: integer
|
||||
@@ -560,6 +550,21 @@ definitions:
|
||||
x-enum-varnames:
|
||||
- FeedbackTypeLike
|
||||
- FeedbackTypeDislike
|
||||
feedback.StatsResponse:
|
||||
properties:
|
||||
company:
|
||||
$ref: '#/definitions/feedback.companyResponse'
|
||||
company_id:
|
||||
type: string
|
||||
last_updated:
|
||||
type: integer
|
||||
total_dislikes:
|
||||
type: integer
|
||||
total_feedback:
|
||||
type: integer
|
||||
total_likes:
|
||||
type: integer
|
||||
type: object
|
||||
feedback.ToggleFeedbackForm:
|
||||
properties:
|
||||
feedback_type:
|
||||
@@ -574,6 +579,53 @@ definitions:
|
||||
- feedback_type
|
||||
- tender_id
|
||||
type: object
|
||||
feedback.companyResponse:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
feedback.organizationResponse:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
feedback.tenderResponse:
|
||||
properties:
|
||||
buyer_organization:
|
||||
$ref: '#/definitions/feedback.organizationResponse'
|
||||
country_code:
|
||||
type: string
|
||||
currency:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
duration:
|
||||
type: string
|
||||
duration_unit:
|
||||
type: string
|
||||
estimated_value:
|
||||
type: number
|
||||
id:
|
||||
type: string
|
||||
notice_publication_id:
|
||||
type: string
|
||||
procedure_code:
|
||||
type: string
|
||||
procurement_type_code:
|
||||
type: string
|
||||
publication_date:
|
||||
type: integer
|
||||
status:
|
||||
type: string
|
||||
submission_deadline:
|
||||
type: integer
|
||||
tender_deadline:
|
||||
type: integer
|
||||
title:
|
||||
type: string
|
||||
type: object
|
||||
inquiry.CreateInquiryForm:
|
||||
properties:
|
||||
company_name:
|
||||
@@ -4508,7 +4560,7 @@ paths:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/feedback.CompanyFeedbackStatsResponse'
|
||||
$ref: '#/definitions/feedback.StatsResponse'
|
||||
type: object
|
||||
"400":
|
||||
description: Bad request - Missing company association
|
||||
|
||||
Reference in New Issue
Block a user