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:
n.nakhostin
2025-08-19 11:27:40 +03:30
parent 392b31626d
commit 81914e2eeb
8 changed files with 432 additions and 0 deletions
+57
View File
@@ -924,6 +924,33 @@ definitions:
x-enum-varnames:
- ApprovalStatusApproved
- ApprovalStatusRejected
tender_approval.CompanyTenderApprovalStatsResponse:
properties:
approvals_by_status:
additionalProperties:
format: int64
type: integer
type: object
approvals_by_submission:
additionalProperties:
format: int64
type: integer
type: object
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
type: object
tender_approval.CreateTenderApprovalForm:
properties:
status:
@@ -5058,6 +5085,36 @@ paths:
summary: Get tender approval by ID
tags:
- TenderApprovals
/api/v1/tender-approvals/stats:
get:
consumes:
- application/json
description: Get comprehensive tender approval statistics for a specific company
produces:
- application/json
responses:
"200":
description: Company tender approval statistics retrieved successfully
schema:
allOf:
- $ref: '#/definitions/response.APIResponse'
- properties:
data:
$ref: '#/definitions/tender_approval.CompanyTenderApprovalStatsResponse'
type: object
"400":
description: Bad request - Invalid company ID
schema:
$ref: '#/definitions/response.APIResponse'
"500":
description: Internal server error
schema:
$ref: '#/definitions/response.APIResponse'
security:
- BearerAuth: []
summary: Get company tender approval statistics
tags:
- TenderApprovals
/api/v1/tender-approvals/tender/{tender_id}:
get:
consumes: