Refactor Tender Management API Endpoints and Update Documentation
- Renamed and restructured tender-related API endpoints for improved clarity and consistency, including changing the route from `/admin/tenders` to `/admin/v1/companies` and updating the associated methods. - Introduced a new SearchForm structure for listing tenders with advanced filtering capabilities, enhancing the API's search functionality. - Updated the service and repository layers to align with the new endpoint structure, ensuring proper handling of tender data. - Enhanced Swagger and YAML documentation to reflect the changes in endpoint structure, including detailed descriptions and examples for the new search functionality. - Improved error handling and response structures to provide clearer feedback to API consumers, ensuring a more robust and user-friendly experience.
This commit is contained in:
+228
-193
@@ -1027,199 +1027,6 @@ info:
|
||||
title: Tender Management API
|
||||
version: 2.0.0
|
||||
paths:
|
||||
/admin/tenders:
|
||||
get:
|
||||
description: Retrieve tenders with pagination, filtering, and search capabilities
|
||||
with optional company-based matching
|
||||
parameters:
|
||||
- description: 'Number of items per page (default: 20, max: 100)'
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- description: 'Number of items to skip (default: 0)'
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
- description: Company ID for match percentage calculation and sorting
|
||||
in: query
|
||||
name: company_id
|
||||
type: string
|
||||
- description: Search query for title and description
|
||||
in: query
|
||||
name: query
|
||||
type: string
|
||||
- description: Filter by notice type code
|
||||
in: query
|
||||
name: notice_type
|
||||
type: string
|
||||
- description: Filter by procurement type code
|
||||
in: query
|
||||
name: procurement_type
|
||||
type: string
|
||||
- collectionFormat: csv
|
||||
description: Filter by country codes (comma-separated)
|
||||
in: query
|
||||
items:
|
||||
type: string
|
||||
name: country_codes
|
||||
type: array
|
||||
- collectionFormat: csv
|
||||
description: Filter by status (comma-separated)
|
||||
in: query
|
||||
items:
|
||||
type: string
|
||||
name: status
|
||||
type: array
|
||||
- collectionFormat: csv
|
||||
description: Filter by source (comma-separated)
|
||||
in: query
|
||||
items:
|
||||
type: string
|
||||
name: source
|
||||
type: array
|
||||
- description: Minimum estimated value
|
||||
in: query
|
||||
name: min_estimated_value
|
||||
type: number
|
||||
- description: Maximum estimated value
|
||||
in: query
|
||||
name: max_estimated_value
|
||||
type: number
|
||||
- description: Filter by currency
|
||||
in: query
|
||||
name: currency
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: List tenders
|
||||
tags:
|
||||
- Admin-Tenders
|
||||
/admin/tenders/{id}:
|
||||
delete:
|
||||
description: Delete a tender by its ID
|
||||
parameters:
|
||||
- description: Tender ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Delete tender
|
||||
tags:
|
||||
- Admin-Tenders
|
||||
get:
|
||||
description: Retrieve a specific tender by its ID
|
||||
parameters:
|
||||
- description: Tender ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/tender.TenderResponse'
|
||||
type: object
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Get tender by ID
|
||||
tags:
|
||||
- Admin-Tenders
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Update an existing tender with the provided information
|
||||
parameters:
|
||||
- description: Tender ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Updated tender information
|
||||
in: body
|
||||
name: tender
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/tender.UpdateTenderRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/tender.TenderResponse'
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Update tender
|
||||
tags:
|
||||
- Admin-Tenders
|
||||
/admin/v1/companies:
|
||||
get:
|
||||
consumes:
|
||||
@@ -3200,6 +3007,234 @@ paths:
|
||||
summary: Get tender approvals by submission mode
|
||||
tags:
|
||||
- Admin-TenderApprovals
|
||||
/admin/v1/tenders:
|
||||
get:
|
||||
description: Retrieve tenders with pagination, filtering, and search capabilities
|
||||
with optional company-based matching
|
||||
parameters:
|
||||
- description: Company ID for match percentage calculation and sorting
|
||||
in: query
|
||||
name: company_id
|
||||
type: string
|
||||
- description: Search query for title and description
|
||||
in: query
|
||||
name: q
|
||||
type: string
|
||||
- description: Filter by notice type code
|
||||
in: query
|
||||
name: notice_type
|
||||
type: string
|
||||
- description: Filter by procurement type code
|
||||
in: query
|
||||
name: procurement_type
|
||||
type: string
|
||||
- collectionFormat: csv
|
||||
description: Filter by country codes (comma-separated)
|
||||
in: query
|
||||
items:
|
||||
type: string
|
||||
name: country_codes
|
||||
type: array
|
||||
- collectionFormat: csv
|
||||
description: Filter by status (comma-separated)
|
||||
in: query
|
||||
items:
|
||||
type: string
|
||||
name: status
|
||||
type: array
|
||||
- collectionFormat: csv
|
||||
description: Filter by source (comma-separated)
|
||||
in: query
|
||||
items:
|
||||
type: string
|
||||
name: source
|
||||
type: array
|
||||
- description: Minimum estimated value
|
||||
in: query
|
||||
name: min_estimated_value
|
||||
type: number
|
||||
- description: Maximum estimated value
|
||||
in: query
|
||||
name: max_estimated_value
|
||||
type: number
|
||||
- description: Filter by currency
|
||||
in: query
|
||||
name: currency
|
||||
type: string
|
||||
- description: Deadline from
|
||||
in: query
|
||||
name: deadline_from
|
||||
type: number
|
||||
- description: Deadline to
|
||||
in: query
|
||||
name: deadline_to
|
||||
type: number
|
||||
- description: Publication date from
|
||||
in: query
|
||||
name: publication_date_from
|
||||
type: number
|
||||
- description: Publication date to
|
||||
in: query
|
||||
name: publication_date_to
|
||||
type: number
|
||||
- collectionFormat: csv
|
||||
description: Filter by languages (comma-separated)
|
||||
in: query
|
||||
items:
|
||||
type: string
|
||||
name: languages
|
||||
type: array
|
||||
- description: Filter by buyer organization ID
|
||||
in: query
|
||||
name: buyer_organization_id
|
||||
type: string
|
||||
- description: 'Number of items per page (default: 20, max: 100)'
|
||||
in: query
|
||||
name: limit
|
||||
type: integer
|
||||
- description: 'Number of items to skip (default: 0)'
|
||||
in: query
|
||||
name: offset
|
||||
type: integer
|
||||
- description: Sort by field
|
||||
in: query
|
||||
name: sort_by
|
||||
type: string
|
||||
- description: Sort order (asc or desc)
|
||||
in: query
|
||||
name: sort_order
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: List tenders
|
||||
tags:
|
||||
- Admin-Tenders
|
||||
/admin/v1/tenders/{id}:
|
||||
delete:
|
||||
description: Delete a tender by its ID
|
||||
parameters:
|
||||
- description: Tender ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Delete tender
|
||||
tags:
|
||||
- Admin-Tenders
|
||||
get:
|
||||
description: Retrieve a specific tender by its ID
|
||||
parameters:
|
||||
- description: Tender ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/tender.TenderResponse'
|
||||
type: object
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Get tender by ID
|
||||
tags:
|
||||
- Admin-Tenders
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Update an existing tender with the provided information
|
||||
parameters:
|
||||
- description: Tender ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Updated tender information
|
||||
in: body
|
||||
name: tender
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/tender.UpdateTenderRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/tender.TenderResponse'
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Update tender
|
||||
tags:
|
||||
- Admin-Tenders
|
||||
/admin/v1/users:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user