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:
+81
-142
@@ -4264,7 +4264,7 @@ const docTemplate = `{
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"TenderApprovals"
|
||||
"Admin-TenderApprovals"
|
||||
],
|
||||
"summary": "Get tender approval by ID",
|
||||
"parameters": [
|
||||
@@ -5886,7 +5886,7 @@ const docTemplate = `{
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/tender_approval.TenderApprovalResponse"
|
||||
"$ref": "#/definitions/tender_approval.TenderApprovalWithTenderResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6114,139 +6114,6 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
@@ -7642,15 +7509,11 @@ const docTemplate = `{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"like",
|
||||
"dislike",
|
||||
"unlike",
|
||||
"undislike"
|
||||
"dislike"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"FeedbackTypeLike",
|
||||
"FeedbackTypeDislike",
|
||||
"FeedbackTypeUnLike",
|
||||
"FeedbackTypeUnDislike"
|
||||
"FeedbackTypeDislike"
|
||||
]
|
||||
},
|
||||
"feedback.ToggleFeedbackForm": {
|
||||
@@ -7896,6 +7759,14 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"tender_approval.OrganizationResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tender_approval.SubmissionMode": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -7992,14 +7863,82 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+81
-142
@@ -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"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+53
-90
@@ -763,14 +763,10 @@ definitions:
|
||||
enum:
|
||||
- like
|
||||
- dislike
|
||||
- unlike
|
||||
- undislike
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- FeedbackTypeLike
|
||||
- FeedbackTypeDislike
|
||||
- FeedbackTypeUnLike
|
||||
- FeedbackTypeUnDislike
|
||||
feedback.ToggleFeedbackForm:
|
||||
properties:
|
||||
feedback_type:
|
||||
@@ -937,6 +933,11 @@ definitions:
|
||||
tender_id:
|
||||
type: string
|
||||
type: object
|
||||
tender_approval.OrganizationResponse:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
tender_approval.SubmissionMode:
|
||||
enum:
|
||||
- self-apply
|
||||
@@ -1002,12 +1003,57 @@ definitions:
|
||||
total_approvals:
|
||||
type: integer
|
||||
type: object
|
||||
tender_approval.UpdateTenderApprovalForm:
|
||||
tender_approval.TenderApprovalWithTenderResponse:
|
||||
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
|
||||
type: object
|
||||
tender_approval.TenderDetails:
|
||||
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
|
||||
type: object
|
||||
user.AuthResponse:
|
||||
properties:
|
||||
@@ -3814,7 +3860,7 @@ paths:
|
||||
- BearerAuth: []
|
||||
summary: Get tender approval by ID
|
||||
tags:
|
||||
- TenderApprovals
|
||||
- Admin-TenderApprovals
|
||||
/admin/v1/tender-approvals/stats:
|
||||
get:
|
||||
consumes:
|
||||
@@ -4910,7 +4956,7 @@ paths:
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/tender_approval.TenderApprovalResponse'
|
||||
$ref: '#/definitions/tender_approval.TenderApprovalWithTenderResponse'
|
||||
type: array
|
||||
type: object
|
||||
"400":
|
||||
@@ -4973,40 +5019,6 @@ paths:
|
||||
tags:
|
||||
- TenderApprovals
|
||||
/api/v1/tender-approvals/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Delete a tender approval
|
||||
parameters:
|
||||
- description: Tender Approval ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
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'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Delete tender approval
|
||||
tags:
|
||||
- TenderApprovals
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@@ -5046,55 +5058,6 @@ paths:
|
||||
summary: Get tender approval by ID
|
||||
tags:
|
||||
- TenderApprovals
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Update tender approval information
|
||||
parameters:
|
||||
- description: Tender Approval ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Tender approval update information
|
||||
in: body
|
||||
name: tender_approval
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/tender_approval.UpdateTenderApprovalForm'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Tender approval updated successfully
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/tender_approval.TenderApprovalResponse'
|
||||
type: object
|
||||
"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'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Update tender approval
|
||||
tags:
|
||||
- TenderApprovals
|
||||
/api/v1/tender-approvals/tender/{tender_id}:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user