Add Company Profile Retrieval Endpoint and Update API Documentation
- Introduced a new public API endpoint to retrieve the profile of the authenticated user's company, enhancing the functionality of the tender management system. - Implemented the `MyCompany` method in the company handler to handle requests for the company profile, ensuring proper authentication and error handling. - Updated Swagger and YAML documentation to accurately reflect the new endpoint, including detailed descriptions, parameters, and response formats for the `CompanyProfileResponse`. - Modified the router to include the new company profile route, ensuring adherence to Clean Architecture principles and maintaining a clear separation of concerns in the handler layer. - Enhanced the public routes registration to include the company handler, improving the overall API structure and usability.
This commit is contained in:
@@ -5069,6 +5069,58 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/companies": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Retrieve the profile of the company associated with the authenticated user",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Company"
|
||||
],
|
||||
"summary": "Get my company profile",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Company retrieved successfully",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/company.CompanyProfileResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized - User not authenticated",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feedback": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -6513,6 +6565,32 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"company.CompanyProfileResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"country": {
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "integer"
|
||||
},
|
||||
"founded_year": {
|
||||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"industry": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"registration_number": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"company.CompanyResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -5063,6 +5063,58 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/companies": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Retrieve the profile of the company associated with the authenticated user",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Company"
|
||||
],
|
||||
"summary": "Get my company profile",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Company retrieved successfully",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/company.CompanyProfileResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized - User not authenticated",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/feedback": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -6507,6 +6559,32 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"company.CompanyProfileResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"country": {
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "integer"
|
||||
},
|
||||
"founded_year": {
|
||||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"industry": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"registration_number": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"company.CompanyResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -78,6 +78,23 @@ definitions:
|
||||
total_pages:
|
||||
type: integer
|
||||
type: object
|
||||
company.CompanyProfileResponse:
|
||||
properties:
|
||||
country:
|
||||
type: string
|
||||
created_at:
|
||||
type: integer
|
||||
founded_year:
|
||||
type: integer
|
||||
id:
|
||||
type: string
|
||||
industry:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
registration_number:
|
||||
type: string
|
||||
type: object
|
||||
company.CompanyResponse:
|
||||
properties:
|
||||
address:
|
||||
@@ -4501,6 +4518,37 @@ paths:
|
||||
summary: Get users by role
|
||||
tags:
|
||||
- Admin-Users
|
||||
/api/v1/companies:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Retrieve the profile of the company associated with the authenticated
|
||||
user
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Company retrieved successfully
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/response.APIResponse'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/company.CompanyProfileResponse'
|
||||
type: object
|
||||
"401":
|
||||
description: Unauthorized - User not authenticated
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Get my company profile
|
||||
tags:
|
||||
- Company
|
||||
/api/v1/feedback:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user