Refactor Tender Approval Management and Update API Documentation

- Replaced the existing tender approval update and delete endpoints with a new toggle functionality, allowing for more streamlined management of tender approvals.
- Introduced the `ToggleTenderApproval` method in the service layer to handle both approval and rejection actions based on the current state of the tender approval.
- Updated the API documentation to reflect the new endpoint structure and response formats, including the `TenderApprovalWithTenderResponse`.
- Enhanced Swagger documentation to ensure accurate representation of the updated tender approval operations.
- Removed obsolete methods and routes to maintain a clean and efficient codebase, adhering to Clean Architecture principles.
This commit is contained in:
n.nakhostin
2025-08-19 11:01:49 +03:30
parent dd2573a308
commit 392b31626d
10 changed files with 298 additions and 532 deletions
+81 -142
View File
@@ -4258,7 +4258,7 @@
"application/json"
],
"tags": [
"TenderApprovals"
"Admin-TenderApprovals"
],
"summary": "Get tender approval by ID",
"parameters": [
@@ -5880,7 +5880,7 @@
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/tender_approval.TenderApprovalResponse"
"$ref": "#/definitions/tender_approval.TenderApprovalWithTenderResponse"
}
}
}
@@ -6108,139 +6108,6 @@
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update tender approval information",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenderApprovals"
],
"summary": "Update tender approval",
"parameters": [
{
"type": "string",
"description": "Tender Approval ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Tender approval update information",
"name": "tender_approval",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tender_approval.UpdateTenderApprovalForm"
}
}
],
"responses": {
"200": {
"description": "Tender approval updated successfully",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/tender_approval.TenderApprovalResponse"
}
}
}
]
}
},
"400": {
"description": "Bad request - Invalid input data",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Tender approval not found",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"422": {
"description": "Validation error - Invalid request data",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a tender approval",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenderApprovals"
],
"summary": "Delete tender approval",
"parameters": [
{
"type": "string",
"description": "Tender Approval ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Tender approval deleted successfully",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad request - Invalid tender approval ID",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Tender approval not found",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/tenders": {
@@ -7636,15 +7503,11 @@
"type": "string",
"enum": [
"like",
"dislike",
"unlike",
"undislike"
"dislike"
],
"x-enum-varnames": [
"FeedbackTypeLike",
"FeedbackTypeDislike",
"FeedbackTypeUnLike",
"FeedbackTypeUnDislike"
"FeedbackTypeDislike"
]
},
"feedback.ToggleFeedbackForm": {
@@ -7890,6 +7753,14 @@
}
}
},
"tender_approval.OrganizationResponse": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"tender_approval.SubmissionMode": {
"type": "string",
"enum": [
@@ -7986,14 +7857,82 @@
}
}
},
"tender_approval.UpdateTenderApprovalForm": {
"tender_approval.TenderApprovalWithTenderResponse": {
"type": "object",
"properties": {
"company_id": {
"type": "string"
},
"created_at": {
"type": "integer"
},
"id": {
"type": "string"
},
"status": {
"type": "string"
},
"submission_mode": {
"type": "string"
},
"tender": {
"$ref": "#/definitions/tender_approval.TenderDetails"
},
"tender_id": {
"type": "string"
}
}
},
"tender_approval.TenderDetails": {
"type": "object",
"properties": {
"buyer_organization": {
"$ref": "#/definitions/tender_approval.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"
}
}
},