Enhance Tender API with New Recommendation Endpoint and Route Updates

- Updated the tender API to include a new endpoint for recommending public tenders based on company profiles, enhancing user experience for mobile application users.
- Modified existing routes to reflect the new structure, changing the tender details route and adding a dedicated recommendation route.
- Improved Swagger documentation to accurately represent the new endpoint, including detailed descriptions, parameters, and response formats.
- Ensured adherence to Clean Architecture principles by maintaining clear separation of concerns in the service and handler layers.
This commit is contained in:
n.nakhostin
2025-08-17 08:40:28 +03:30
parent e986ee4135
commit 4663a9781e
8 changed files with 333 additions and 20 deletions
+83 -1
View File
@@ -5374,7 +5374,7 @@ const docTemplate = `{
}
}
},
"/api/v1/tenders/{id}": {
"/api/v1/tenders/read/{id}": {
"get": {
"security": [
{
@@ -5432,6 +5432,88 @@ const docTemplate = `{
}
}
}
},
"/api/v1/tenders/recommend": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Retrieve active tenders for mobile application users with automatic company-based matching from customer profile",
"produces": [
"application/json"
],
"tags": [
"Tenders"
],
"summary": "Get public tenders",
"parameters": [
{
"type": "integer",
"description": "Number of items per page (default: 20, max: 50)",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Number of items to skip (default: 0)",
"name": "offset",
"in": "query"
},
{
"type": "string",
"description": "Filter by country code",
"name": "country_code",
"in": "query"
},
{
"type": "number",
"description": "Minimum estimated value",
"name": "min_estimated_value",
"in": "query"
},
{
"type": "number",
"description": "Maximum estimated value",
"name": "max_estimated_value",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "object",
"additionalProperties": true
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
}
},
"definitions": {
+83 -1
View File
@@ -5368,7 +5368,7 @@
}
}
},
"/api/v1/tenders/{id}": {
"/api/v1/tenders/read/{id}": {
"get": {
"security": [
{
@@ -5426,6 +5426,88 @@
}
}
}
},
"/api/v1/tenders/recommend": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Retrieve active tenders for mobile application users with automatic company-based matching from customer profile",
"produces": [
"application/json"
],
"tags": [
"Tenders"
],
"summary": "Get public tenders",
"parameters": [
{
"type": "integer",
"description": "Number of items per page (default: 20, max: 50)",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Number of items to skip (default: 0)",
"name": "offset",
"in": "query"
},
{
"type": "string",
"description": "Filter by country code",
"name": "country_code",
"in": "query"
},
{
"type": "number",
"description": "Minimum estimated value",
"name": "min_estimated_value",
"in": "query"
},
{
"type": "number",
"description": "Maximum estimated value",
"name": "max_estimated_value",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "object",
"additionalProperties": true
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
}
},
"definitions": {
+52 -1
View File
@@ -4493,7 +4493,7 @@ paths:
summary: Get public tenders
tags:
- Tenders
/api/v1/tenders/{id}:
/api/v1/tenders/read/{id}:
get:
description: Retrieve detailed information about a specific tender for mobile
application users
@@ -4529,6 +4529,57 @@ paths:
summary: Get public tender details
tags:
- Tenders
/api/v1/tenders/recommend:
get:
description: Retrieve active tenders for mobile application users with automatic
company-based matching from customer profile
parameters:
- description: 'Number of items per page (default: 20, max: 50)'
in: query
name: limit
type: integer
- description: 'Number of items to skip (default: 0)'
in: query
name: offset
type: integer
- description: Filter by country code
in: query
name: country_code
type: string
- description: Minimum estimated value
in: query
name: min_estimated_value
type: number
- description: Maximum estimated value
in: query
name: max_estimated_value
type: number
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: Get public tenders
tags:
- Tenders
securityDefinitions:
BearerAuth:
description: 'Type "Bearer" followed by a space and JWT token. Example: "Bearer