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:
+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