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.
This commit is contained in:
+121
-3
@@ -4940,6 +4940,120 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feedback/tender/{tender_id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Retrieve feedback details by tender ID. This endpoint provides basic feedback information for public users.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Feedback"
|
||||
],
|
||||
"summary": "Get feedback by tender ID",
|
||||
"parameters": [
|
||||
{
|
||||
"maxLength": 24,
|
||||
"minLength": 24,
|
||||
"type": "string",
|
||||
"description": "Tender ID (MongoDB ObjectID format)",
|
||||
"name": "tender_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Feedback retrieved successfully",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/feedback.FeedbackResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request - Invalid tender ID format",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Feedback not found",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feedback/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -5374,7 +5488,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/tenders/read/{id}": {
|
||||
"/api/v1/tenders/details/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@@ -6683,11 +6797,15 @@ const docTemplate = `{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"like",
|
||||
"dislike"
|
||||
"dislike",
|
||||
"unlike",
|
||||
"undislike"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"FeedbackTypeLike",
|
||||
"FeedbackTypeDislike"
|
||||
"FeedbackTypeDislike",
|
||||
"FeedbackTypeUnLike",
|
||||
"FeedbackTypeUnDislike"
|
||||
]
|
||||
},
|
||||
"feedback.ToggleFeedbackForm": {
|
||||
|
||||
+121
-3
@@ -4934,6 +4934,120 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feedback/tender/{tender_id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Retrieve feedback details by tender ID. This endpoint provides basic feedback information for public users.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Feedback"
|
||||
],
|
||||
"summary": "Get feedback by tender ID",
|
||||
"parameters": [
|
||||
{
|
||||
"maxLength": 24,
|
||||
"minLength": 24,
|
||||
"type": "string",
|
||||
"description": "Tender ID (MongoDB ObjectID format)",
|
||||
"name": "tender_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Feedback retrieved successfully",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/feedback.FeedbackResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request - Invalid tender ID format",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Feedback not found",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feedback/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -5368,7 +5482,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/tenders/read/{id}": {
|
||||
"/api/v1/tenders/details/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@@ -6677,11 +6791,15 @@
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"like",
|
||||
"dislike"
|
||||
"dislike",
|
||||
"unlike",
|
||||
"undislike"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"FeedbackTypeLike",
|
||||
"FeedbackTypeDislike"
|
||||
"FeedbackTypeDislike",
|
||||
"FeedbackTypeUnLike",
|
||||
"FeedbackTypeUnDislike"
|
||||
]
|
||||
},
|
||||
"feedback.ToggleFeedbackForm": {
|
||||
|
||||
Reference in New Issue
Block a user