Add Company Tender Approval Statistics Endpoint and Update API Documentation
- Introduced a new API endpoint to retrieve company-specific tender approval statistics, enhancing the analytics capabilities of the tender management system. - Implemented the `GetCompanyTenderApprovalStats` method in the service layer to fetch detailed statistics, including total approvals, approved and rejected tenders, and submission counts. - Updated Swagger documentation to accurately reflect the new endpoint, including detailed descriptions, parameters, and response formats for the `CompanyTenderApprovalStatsResponse`. - Enhanced the router to include the new statistics route, ensuring adherence to Clean Architecture principles and maintaining a clear separation of concerns in the handler layer. - Added necessary request and response forms to support the new functionality, improving the overall API structure and usability.
This commit is contained in:
@@ -5976,6 +5976,58 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/tender-approvals/stats": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get comprehensive tender approval statistics for a specific company",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"TenderApprovals"
|
||||
],
|
||||
"summary": "Get company tender approval statistics",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Company tender approval statistics retrieved successfully",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/tender_approval.CompanyTenderApprovalStatsResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request - Invalid company ID",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/tender-approvals/tender/{tender_id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -7739,6 +7791,46 @@
|
||||
"ApprovalStatusRejected"
|
||||
]
|
||||
},
|
||||
"tender_approval.CompanyTenderApprovalStatsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"approvals_by_status": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
},
|
||||
"approvals_by_submission": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
},
|
||||
"approved_tenders": {
|
||||
"type": "integer"
|
||||
},
|
||||
"company_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_updated": {
|
||||
"type": "integer"
|
||||
},
|
||||
"partnership_count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"rejected_tenders": {
|
||||
"type": "integer"
|
||||
},
|
||||
"self_apply_count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_approvals": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tender_approval.CreateTenderApprovalForm": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user