e3ee3d64ce
- Deleted the `/admin/v1/customers/{id}/with-companies` endpoint from the API documentation and Swagger files to streamline the API structure.
- Updated the router to remove the corresponding route registration for the deprecated endpoint.
- Enhanced the company repository and service to support batch retrieval of companies by IDs, improving efficiency in data handling.
- Adjusted customer service methods to utilize the new batch retrieval functionality for loading companies associated with customers.
- Improved logging practices to provide better traceability for company retrieval operations.
5878 lines
214 KiB
JSON
5878 lines
214 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "This is a comprehensive API for the Tender Management System built with Clean Architecture principles and Domain-Driven Design (DDD) patterns. The API provides endpoints for user management, customer management, company management, and authentication for both web panel administration and mobile application access.",
|
|
"title": "Tender Management API",
|
|
"termsOfService": "https://tender-management.com/terms",
|
|
"contact": {
|
|
"name": "Tender Management API Support",
|
|
"url": "https://tender-management.com/support",
|
|
"email": "api-support@tender-management.com"
|
|
},
|
|
"license": {
|
|
"name": "MIT",
|
|
"url": "https://opensource.org/licenses/MIT"
|
|
},
|
|
"version": "2.0.0"
|
|
},
|
|
"host": "localhost:8081",
|
|
"basePath": "/",
|
|
"paths": {
|
|
"/admin/v1/companies": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve a paginated list of companies with advanced filtering options including search, type, status, industry, verification status, tags, and business criteria. Supports sorting and pagination.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "List companies with filters and pagination",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Search term to filter companies by name, description, or industry",
|
|
"name": "search",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"private",
|
|
"public",
|
|
"government",
|
|
"ngo",
|
|
"startup"
|
|
],
|
|
"type": "string",
|
|
"description": "Filter by company type",
|
|
"name": "type",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"active",
|
|
"inactive",
|
|
"suspended",
|
|
"pending"
|
|
],
|
|
"type": "string",
|
|
"description": "Filter by company status",
|
|
"name": "status",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by industry",
|
|
"name": "industry",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Filter by verification status",
|
|
"name": "is_verified",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Filter by compliance status",
|
|
"name": "is_compliant",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"description": "Filter by CPV codes",
|
|
"name": "cpv_codes",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"description": "Filter by categories",
|
|
"name": "categories",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"description": "Filter by keywords",
|
|
"name": "keywords",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"description": "Filter by specializations",
|
|
"name": "specializations",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Minimum employee count",
|
|
"name": "employee_count_min",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Maximum employee count",
|
|
"name": "employee_count_max",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"description": "Minimum annual revenue",
|
|
"name": "annual_revenue_min",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"description": "Maximum annual revenue",
|
|
"name": "annual_revenue_max",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Minimum founded year",
|
|
"name": "founded_year_min",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Maximum founded year",
|
|
"name": "founded_year_max",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Number of companies per page (1-100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Number of companies to skip for pagination",
|
|
"name": "offset",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"name",
|
|
"type",
|
|
"industry",
|
|
"created_at",
|
|
"updated_at",
|
|
"status",
|
|
"employee_count",
|
|
"annual_revenue"
|
|
],
|
|
"type": "string",
|
|
"default": "created_at",
|
|
"description": "Field to sort by",
|
|
"name": "sort_by",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"asc",
|
|
"desc"
|
|
],
|
|
"type": "string",
|
|
"default": "desc",
|
|
"description": "Sort order",
|
|
"name": "sort_order",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Companies retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/company.CompanyListResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid query parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid query parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Create a new company with comprehensive information including business details, address, tags, and customer assignment. This endpoint is used by the web panel for full company registration.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Create a new company",
|
|
"parameters": [
|
|
{
|
|
"description": "Company information including type, business details, address, tags, and optional customer assignment",
|
|
"name": "company",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/company.CreateCompanyForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Company created successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/company.CompanyResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict - Company with this name/registration/tax ID already exists",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/industry/{industry}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve companies filtered by their industry",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Get companies by industry",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Industry",
|
|
"name": "industry",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Number of companies per page (1-100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Number of companies to skip for pagination",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Companies retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/company.CompanyResponse"
|
|
}
|
|
},
|
|
"meta": {
|
|
"$ref": "#/definitions/response.Meta"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid industry",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/search": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Search companies with advanced filtering capabilities including tags, business criteria, and location",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Advanced search for companies",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Search query",
|
|
"name": "q",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"description": "CPV codes filter",
|
|
"name": "cpv_codes",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"description": "Categories filter",
|
|
"name": "categories",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"description": "Keywords filter",
|
|
"name": "keywords",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"description": "Specializations filter",
|
|
"name": "specializations",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Industry filter",
|
|
"name": "industry",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Location filter",
|
|
"name": "location",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Minimum employees",
|
|
"name": "min_employees",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Maximum employees",
|
|
"name": "max_employees",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"description": "Minimum revenue",
|
|
"name": "min_revenue",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"description": "Maximum revenue",
|
|
"name": "max_revenue",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Verification status",
|
|
"name": "is_verified",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Compliance status",
|
|
"name": "is_compliant",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Limit",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Offset",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Companies search completed",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/company.CompanyListResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid query parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid query parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/stats": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Get comprehensive company statistics for dashboard",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Get company statistics",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company statistics retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/company.CompanyStatsResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/status/{status}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve companies filtered by their status (active, inactive, suspended, pending)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Get companies by status",
|
|
"parameters": [
|
|
{
|
|
"enum": [
|
|
"active",
|
|
"inactive",
|
|
"suspended",
|
|
"pending"
|
|
],
|
|
"type": "string",
|
|
"description": "Company status",
|
|
"name": "status",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Number of companies per page (1-100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Number of companies to skip for pagination",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Companies retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/company.CompanyResponse"
|
|
}
|
|
},
|
|
"meta": {
|
|
"$ref": "#/definitions/response.Meta"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid company status",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/type/{type}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve companies filtered by their type (private, public, government, ngo, startup)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Get companies by type",
|
|
"parameters": [
|
|
{
|
|
"enum": [
|
|
"private",
|
|
"public",
|
|
"government",
|
|
"ngo",
|
|
"startup"
|
|
],
|
|
"type": "string",
|
|
"description": "Company type",
|
|
"name": "type",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Number of companies per page (1-100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Number of companies to skip for pagination",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Companies retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/company.CompanyResponse"
|
|
}
|
|
},
|
|
"meta": {
|
|
"$ref": "#/definitions/response.Meta"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid company type",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve detailed company information by company ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Get company by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/company.CompanyResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid company ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update company information including business details, address, tags, and customer assignment",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Update company information",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Company update information",
|
|
"name": "company",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/company.UpdateCompanyForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company updated successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/company.CompanyResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict - Company with this name/registration/tax ID already exists",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Soft delete a company by setting status to inactive",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Delete company",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company deleted successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid company ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}/activate": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Activate a suspended company account",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Activate company",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company activated successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid company ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}/status": {
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update company account status (active, inactive, suspended, pending)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Update company status",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "New company status",
|
|
"name": "status",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/company.UpdateCompanyStatusForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company status updated successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}/suspend": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Suspend a company account with reason",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Suspend company",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Suspension information",
|
|
"name": "suspension",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/company.SuspendCompanyForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company suspended successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}/tags": {
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update company tags (CPV, categories, keywords, specializations, certifications)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Update company tags",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Tags update information",
|
|
"name": "tags",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/company.UpdateCompanyTagsForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company tags updated successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}/tags/add": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Add specific tags to a company",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Add tags to company",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Tags to add",
|
|
"name": "tags",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/company.AddTagsForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Tags added successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}/tags/remove": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Remove specific tags from a company",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Remove tags from company",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Tags to remove",
|
|
"name": "tags",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/company.RemoveTagsForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Tags removed successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}/verification": {
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update company verification and compliance status",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Update company verification status",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Verification status update",
|
|
"name": "verification",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/company.UpdateCompanyVerificationForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company verification updated successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/companies/{id}/verify": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Mark a company as verified",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Companies"
|
|
],
|
|
"summary": "Verify company",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company verified successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid company ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Company not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve a paginated list of customers with advanced filtering options including search, type, status, company, industry, verification status, and compliance status. Supports sorting and pagination.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "List customers with filters and pagination",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Search term to filter customers by name, email, or company name",
|
|
"name": "search",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"individual",
|
|
"company",
|
|
"government"
|
|
],
|
|
"type": "string",
|
|
"description": "Filter by customer type",
|
|
"name": "type",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"active",
|
|
"inactive",
|
|
"suspended",
|
|
"pending"
|
|
],
|
|
"type": "string",
|
|
"description": "Filter by customer status",
|
|
"name": "status",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Filter by company ID",
|
|
"name": "company_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by industry",
|
|
"name": "industry",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Filter by verification status",
|
|
"name": "is_verified",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Filter by compliance status",
|
|
"name": "is_compliant",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by preferred language",
|
|
"name": "language",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by preferred currency",
|
|
"name": "currency",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Number of customers per page (1-100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Number of customers to skip for pagination",
|
|
"name": "offset",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"email",
|
|
"company_name",
|
|
"created_at",
|
|
"updated_at",
|
|
"status"
|
|
],
|
|
"type": "string",
|
|
"default": "created_at",
|
|
"description": "Field to sort by",
|
|
"name": "sort_by",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"asc",
|
|
"desc"
|
|
],
|
|
"type": "string",
|
|
"default": "desc",
|
|
"description": "Sort order",
|
|
"name": "sort_order",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customers retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.CustomerListResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid query parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid query parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Create a new customer with comprehensive information including personal details, company information, address, and business details. This endpoint is used by the web panel for full customer registration.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Create a new customer",
|
|
"parameters": [
|
|
{
|
|
"description": "Customer information including type (individual|company|government), personal details, company info, address, and business details",
|
|
"name": "customer",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.CreateCustomerForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Customer created successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict - Customer with this email/company already exists",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/company/{companyId}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve all customers associated with a specific company",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Get customers by company ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "companyId",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Number of customers to return (default: 10, max: 100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Number of customers to skip (default: 0)",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customers retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid company ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/status/{status}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve customers filtered by their account status (active, inactive, suspended, or pending). Useful for administrative monitoring and management.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Get customers by status",
|
|
"parameters": [
|
|
{
|
|
"enum": [
|
|
"active",
|
|
"inactive",
|
|
"suspended",
|
|
"pending"
|
|
],
|
|
"type": "string",
|
|
"description": "Customer status",
|
|
"name": "status",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Number of customers per page (1-100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Number of customers to skip for pagination",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customers retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
},
|
|
"meta": {
|
|
"$ref": "#/definitions/response.Meta"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid customer status",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/type/{type}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve customers filtered by their type (individual, company, or government). Useful for administrative reporting and management.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Get customers by type",
|
|
"parameters": [
|
|
{
|
|
"enum": [
|
|
"individual",
|
|
"company",
|
|
"government"
|
|
],
|
|
"type": "string",
|
|
"description": "Customer type",
|
|
"name": "type",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Number of customers per page (1-100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Number of customers to skip for pagination",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customers retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
},
|
|
"meta": {
|
|
"$ref": "#/definitions/response.Meta"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid customer type",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/with-companies": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve a paginated list of customers with their assigned companies and advanced filtering options including search, type, status, company, industry, verification status, and compliance status. Supports sorting and pagination.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "List customers with companies and filters",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Search term to filter customers by name, email, or company name",
|
|
"name": "search",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"individual",
|
|
"company",
|
|
"government"
|
|
],
|
|
"type": "string",
|
|
"description": "Filter by customer type",
|
|
"name": "type",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"active",
|
|
"inactive",
|
|
"suspended",
|
|
"pending"
|
|
],
|
|
"type": "string",
|
|
"description": "Filter by customer status",
|
|
"name": "status",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Filter by company ID",
|
|
"name": "company_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by industry",
|
|
"name": "industry",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Filter by verification status",
|
|
"name": "is_verified",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Filter by compliance status",
|
|
"name": "is_compliant",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by preferred language",
|
|
"name": "language",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by preferred currency",
|
|
"name": "currency",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Number of customers per page (1-100)",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 0,
|
|
"description": "Number of customers to skip for pagination",
|
|
"name": "offset",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"email",
|
|
"company_name",
|
|
"created_at",
|
|
"updated_at",
|
|
"status"
|
|
],
|
|
"type": "string",
|
|
"default": "created_at",
|
|
"description": "Field to sort by",
|
|
"name": "sort_by",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"asc",
|
|
"desc"
|
|
],
|
|
"type": "string",
|
|
"default": "desc",
|
|
"description": "Sort order",
|
|
"name": "sort_order",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customers with companies retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.CustomerListResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid query parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid query parameters",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve detailed customer information by customer ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Get customer by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customer retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid customer ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update customer information including personal details, company information, address, and business details",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Update customer information",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Updated customer information",
|
|
"name": "customer",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.UpdateCustomerForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customer updated successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict - Customer with this email/company already exists",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Soft delete a customer by setting status to inactive",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Delete customer",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customer deleted successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid customer ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/{id}/activate": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Activate a suspended customer account",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Activate customer",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customer activated successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid customer ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/{id}/companies/assign": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Assign one or more companies to a specific customer.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Assign companies to a customer",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "List of company IDs to assign",
|
|
"name": "companies",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.AssignCompaniesForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Companies assigned successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/{id}/companies/remove": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Remove one or more companies from a specific customer.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Remove companies from a customer",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "List of company IDs to remove",
|
|
"name": "companies",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.RemoveCompaniesForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Companies removed successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/{id}/status": {
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update customer account status (active, inactive, suspended, pending)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Update customer status",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "New customer status",
|
|
"name": "status",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.UpdateCustomerStatusForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customer status updated successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/{id}/suspend": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Suspend a customer account with optional reason",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Suspend customer",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Suspension information",
|
|
"name": "suspension",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.SuspendCustomerForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customer suspended successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/{id}/verification": {
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update customer verification and compliance status",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Update customer verification status",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Verification status update",
|
|
"name": "verification",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.UpdateCustomerVerificationForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customer verification updated successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/customers/{id}/verify": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Mark a customer as verified",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Customers"
|
|
],
|
|
"summary": "Verify customer",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Customer ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Customer verified successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid customer ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/health": {
|
|
"get": {
|
|
"description": "Get comprehensive server health status including system information, dependencies status, and performance metrics. This endpoint is used for monitoring and load balancer health checks.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Health"
|
|
],
|
|
"summary": "Health check endpoint",
|
|
"responses": {
|
|
"200": {
|
|
"description": "System is healthy and operational",
|
|
"schema": {
|
|
"$ref": "#/definitions/main.HealthResponse"
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "System is unhealthy or experiencing issues",
|
|
"schema": {
|
|
"$ref": "#/definitions/main.HealthResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/profile": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve complete profile information for the currently authenticated user including personal details, role information, permissions, and account status. This endpoint requires valid authentication token.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Get authenticated user profile",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Profile retrieved successfully with user details",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/user.UserResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or expired authentication token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - User profile not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update profile information for the currently authenticated user including personal details, contact information, and preferences. Only the authenticated user can update their own profile.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Update authenticated user profile",
|
|
"parameters": [
|
|
{
|
|
"description": "Profile update data including name, email, phone, and other personal information",
|
|
"name": "profile",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.UpdateUserForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Profile updated successfully with updated user details",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/user.UserResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid request format or missing required fields",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or expired authentication token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict - Email address already exists for another user",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid input data format",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/profile/change-password": {
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Change password for the currently authenticated user. Requires current password verification and enforces password policy. This operation invalidates all existing sessions and requires re-authentication.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Change user password",
|
|
"parameters": [
|
|
{
|
|
"description": "Password change data including current password and new password",
|
|
"name": "password",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.ChangePasswordForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Password changed successfully - user must re-authenticate",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid request format or password policy violation",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid authentication token or incorrect current password",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid password format or policy requirements not met",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/profile/login": {
|
|
"post": {
|
|
"description": "Authenticate user with username/email and password to obtain access and refresh tokens for web panel administration. This endpoint validates credentials and returns JWT tokens for subsequent API calls.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Authorization"
|
|
],
|
|
"summary": "Authenticate user login",
|
|
"parameters": [
|
|
{
|
|
"description": "User login credentials including username/email and password",
|
|
"name": "login",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.LoginForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Login successful with access and refresh tokens",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/user.AuthResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid request format or missing fields",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid credentials or account locked",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid input data format",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"429": {
|
|
"description": "Too many requests - Rate limit exceeded",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/profile/logout": {
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Logout the currently authenticated user by invalidating their access and refresh tokens. This endpoint ensures secure session termination and prevents further use of the user's tokens.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Authorization"
|
|
],
|
|
"summary": "Logout authenticated user",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Logout successful - all tokens invalidated",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or expired authentication token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error - Failed to invalidate tokens",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/profile/refresh-token": {
|
|
"post": {
|
|
"description": "Generate a new access token using a valid refresh token. This endpoint allows clients to obtain fresh access tokens without re-authentication, maintaining session continuity.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Authorization"
|
|
],
|
|
"summary": "Refresh access token",
|
|
"parameters": [
|
|
{
|
|
"description": "Refresh token for generating new access token",
|
|
"name": "refresh",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.RefreshTokenForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Token refreshed successfully with new access token",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/user.AuthResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid request format",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or expired refresh token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid token format",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/profile/reset-password": {
|
|
"post": {
|
|
"description": "Send password reset email to user with reset token. This endpoint validates the email address and sends a secure reset link to the user's registered email address.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Authorization"
|
|
],
|
|
"summary": "Initiate password reset process",
|
|
"parameters": [
|
|
{
|
|
"description": "Email address for password reset request",
|
|
"name": "reset",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.ResetPasswordForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Password reset email sent successfully",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid request format or email address",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Email address not registered",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid email format",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"429": {
|
|
"description": "Too many requests - Rate limit for reset emails exceeded",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error - Failed to send email",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/users": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "List users with search and filters (admin only)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "List users",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Search term",
|
|
"name": "search",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "User status filter",
|
|
"name": "status",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "User role filter",
|
|
"name": "role",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID filter",
|
|
"name": "company_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Limit results",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Offset results",
|
|
"name": "offset",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Sort field",
|
|
"name": "sort_by",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Sort order",
|
|
"name": "sort_order",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/user.UserListResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Create a new user account with specified role and permissions. This endpoint is restricted to administrators only and allows creation of various user types including admins, managers, and operators with appropriate access levels.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Create new user account",
|
|
"parameters": [
|
|
{
|
|
"description": "User creation data including username, email, password, role, and profile information",
|
|
"name": "user",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.CreateUserForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "User created successfully with assigned role and permissions",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/user.UserResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data or missing required fields",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or expired authentication token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden - Insufficient privileges to create users",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict - Username or email already exists",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid data format or password policy violation",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/users/company/{company_id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Get users belonging to a specific company (admin only)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Get users by company ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "company_id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Limit results",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Offset results",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Users with pagination metadata",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/users/role/{role}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Get users with a specific role (admin only)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Get users by role",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User role",
|
|
"name": "role",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Limit results",
|
|
"name": "limit",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Offset results",
|
|
"name": "offset",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Users with pagination metadata",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/users/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Get user details by ID (admin only)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Get user by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/user.UserResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update user information (admin only)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Update user",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "User update data",
|
|
"name": "user",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.UpdateUserForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/user.UserResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Delete a user (admin only)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Delete user",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/users/{id}/role": {
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update user role (admin only)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Update user role",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Role update data",
|
|
"name": "role",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.UpdateUserRoleForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/users/{id}/status": {
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update user account status (admin only)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Admin-Users"
|
|
],
|
|
"summary": "Update user status",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Status update data",
|
|
"name": "status",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/user.UpdateUserStatusForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/profile": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve current customer profile information",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Authorization"
|
|
],
|
|
"summary": "Get customer profile",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Profile retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or missing token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/profile/login": {
|
|
"post": {
|
|
"description": "Authenticate customer with username (email) and password. Returns access token, refresh token, and customer information upon successful authentication.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Authorization"
|
|
],
|
|
"summary": "Customer login",
|
|
"parameters": [
|
|
{
|
|
"description": "Login credentials (username/email and password)",
|
|
"name": "login",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.LoginForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Login successful",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.AuthResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid input data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid credentials or inactive account",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/profile/logout": {
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Logout customer and invalidate access token",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Authorization"
|
|
],
|
|
"summary": "Customer logout",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Logout successful",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or missing token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/profile/refresh-token": {
|
|
"post": {
|
|
"description": "Refresh access token using a valid refresh token. This allows customers to maintain their session without re-authentication.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Authorization"
|
|
],
|
|
"summary": "Refresh customer access token",
|
|
"parameters": [
|
|
{
|
|
"description": "Refresh token for generating new access token",
|
|
"name": "refresh",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/customer.RefreshTokenForm"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Token refreshed successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.AuthResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request - Invalid refresh token or feature not implemented",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or expired refresh token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation error - Invalid request data",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/profile/with-companies": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve current customer profile information along with their assigned companies.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Authorization"
|
|
],
|
|
"summary": "Get customer profile with companies",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Profile retrieved successfully",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized - Invalid or missing token",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not found - Customer not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.APIResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"company.AddTagsForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"categories": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"certifications": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"cpv_codes": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"keywords": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"specializations": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"company.Address": {
|
|
"type": "object",
|
|
"properties": {
|
|
"city": {
|
|
"type": "string"
|
|
},
|
|
"country": {
|
|
"type": "string"
|
|
},
|
|
"postal_code": {
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"type": "string"
|
|
},
|
|
"street": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.AddressForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"city": {
|
|
"type": "string"
|
|
},
|
|
"country": {
|
|
"type": "string"
|
|
},
|
|
"postal_code": {
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"type": "string"
|
|
},
|
|
"street": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.CPVCodeCount": {
|
|
"type": "object",
|
|
"properties": {
|
|
"count": {
|
|
"type": "integer"
|
|
},
|
|
"cpv_code": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.CategoryCount": {
|
|
"type": "object",
|
|
"properties": {
|
|
"category": {
|
|
"type": "string"
|
|
},
|
|
"count": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"company.CompanyListResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"companies": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/company.CompanyResponse"
|
|
}
|
|
},
|
|
"limit": {
|
|
"type": "integer"
|
|
},
|
|
"offset": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
},
|
|
"total_pages": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"company.CompanyResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"$ref": "#/definitions/company.Address"
|
|
},
|
|
"annual_revenue": {
|
|
"type": "number"
|
|
},
|
|
"compliance_notes": {
|
|
"type": "string"
|
|
},
|
|
"contact_person": {
|
|
"$ref": "#/definitions/company.ContactPerson"
|
|
},
|
|
"created_at": {
|
|
"type": "integer"
|
|
},
|
|
"created_by": {
|
|
"type": "string"
|
|
},
|
|
"currency": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"employee_count": {
|
|
"type": "integer"
|
|
},
|
|
"founded_year": {
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"industry": {
|
|
"type": "string"
|
|
},
|
|
"is_compliant": {
|
|
"type": "boolean"
|
|
},
|
|
"is_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"registration_number": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"tags": {
|
|
"$ref": "#/definitions/company.CompanyTags"
|
|
},
|
|
"tax_id": {
|
|
"type": "string"
|
|
},
|
|
"timezone": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "integer"
|
|
},
|
|
"updated_by": {
|
|
"type": "string"
|
|
},
|
|
"website": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.CompanyStatsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"active_companies": {
|
|
"type": "integer"
|
|
},
|
|
"companies_by_industry": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
},
|
|
"companies_by_status": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
},
|
|
"companies_by_type": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
},
|
|
"top_categories": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/company.CategoryCount"
|
|
}
|
|
},
|
|
"top_cpv_codes": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/company.CPVCodeCount"
|
|
}
|
|
},
|
|
"total_companies": {
|
|
"type": "integer"
|
|
},
|
|
"verified_companies": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"company.CompanyTags": {
|
|
"type": "object",
|
|
"properties": {
|
|
"categories": {
|
|
"description": "Categories",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"certifications": {
|
|
"description": "Certifications",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"cpv_codes": {
|
|
"description": "CPV codes (Common Procurement Vocabulary)",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"keywords": {
|
|
"description": "Keywords for search and matching",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"specializations": {
|
|
"description": "Specializations",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"company.CompanyTagsForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"categories": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"certifications": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"cpv_codes": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"keywords": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"specializations": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"company.ContactPerson": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"full_name": {
|
|
"type": "string"
|
|
},
|
|
"is_primary": {
|
|
"type": "boolean"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"mobile": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"position": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.ContactPersonForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"full_name": {
|
|
"type": "string"
|
|
},
|
|
"is_primary": {
|
|
"type": "boolean"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"mobile": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"position": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.CreateCompanyForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"description": "Address information",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/company.AddressForm"
|
|
}
|
|
]
|
|
},
|
|
"annual_revenue": {
|
|
"type": "number"
|
|
},
|
|
"contact_person": {
|
|
"description": "Contact information",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/company.ContactPersonForm"
|
|
}
|
|
]
|
|
},
|
|
"currency": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"employee_count": {
|
|
"description": "Business information",
|
|
"type": "integer"
|
|
},
|
|
"founded_year": {
|
|
"type": "integer"
|
|
},
|
|
"industry": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"description": "Settings",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"registration_number": {
|
|
"type": "string"
|
|
},
|
|
"tags": {
|
|
"description": "Tags for categorization and search",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/company.CompanyTagsForm"
|
|
}
|
|
]
|
|
},
|
|
"tax_id": {
|
|
"type": "string"
|
|
},
|
|
"timezone": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"website": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.RemoveTagsForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"categories": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"certifications": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"cpv_codes": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"keywords": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"specializations": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"company.SuspendCompanyForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"reason": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.UpdateCompanyForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"description": "Address information",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/company.AddressForm"
|
|
}
|
|
]
|
|
},
|
|
"annual_revenue": {
|
|
"type": "number"
|
|
},
|
|
"contact_person": {
|
|
"description": "Contact information",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/company.ContactPersonForm"
|
|
}
|
|
]
|
|
},
|
|
"currency": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"employee_count": {
|
|
"description": "Business information",
|
|
"type": "integer"
|
|
},
|
|
"founded_year": {
|
|
"type": "integer"
|
|
},
|
|
"industry": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"description": "Settings",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"registration_number": {
|
|
"type": "string"
|
|
},
|
|
"tags": {
|
|
"description": "Tags for categorization and search",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/company.CompanyTagsForm"
|
|
}
|
|
]
|
|
},
|
|
"tax_id": {
|
|
"type": "string"
|
|
},
|
|
"timezone": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"website": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.UpdateCompanyStatusForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"company.UpdateCompanyTagsForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tags": {
|
|
"$ref": "#/definitions/company.CompanyTagsForm"
|
|
}
|
|
}
|
|
},
|
|
"company.UpdateCompanyVerificationForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"compliance_notes": {
|
|
"type": "string"
|
|
},
|
|
"is_compliant": {
|
|
"type": "boolean"
|
|
},
|
|
"is_verified": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"customer.Address": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address_type": {
|
|
"description": "billing, shipping, etc.",
|
|
"type": "string"
|
|
},
|
|
"city": {
|
|
"type": "string"
|
|
},
|
|
"country": {
|
|
"type": "string"
|
|
},
|
|
"is_default": {
|
|
"type": "boolean"
|
|
},
|
|
"postal_code": {
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"type": "string"
|
|
},
|
|
"street": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.AddressForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address_type": {
|
|
"type": "string"
|
|
},
|
|
"city": {
|
|
"type": "string"
|
|
},
|
|
"country": {
|
|
"type": "string"
|
|
},
|
|
"is_default": {
|
|
"type": "boolean"
|
|
},
|
|
"postal_code": {
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"type": "string"
|
|
},
|
|
"street": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.AssignCompaniesForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"customer.AuthResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"customer": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
},
|
|
"expires_at": {
|
|
"type": "integer"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.CompanySummary": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.ContactPerson": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"full_name": {
|
|
"type": "string"
|
|
},
|
|
"is_primary": {
|
|
"type": "boolean"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"mobile": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"position": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.ContactPersonForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"full_name": {
|
|
"type": "string"
|
|
},
|
|
"is_primary": {
|
|
"type": "boolean"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"mobile": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"position": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.CreateCustomerForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"description": "Address information",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/customer.AddressForm"
|
|
}
|
|
]
|
|
},
|
|
"annual_revenue": {
|
|
"type": "number"
|
|
},
|
|
"business_type": {
|
|
"description": "Business information",
|
|
"type": "string"
|
|
},
|
|
"company_ids": {
|
|
"description": "Company assignments",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"contact_person": {
|
|
"description": "Contact person (for company customers)",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/customer.ContactPersonForm"
|
|
}
|
|
]
|
|
},
|
|
"currency": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"employee_count": {
|
|
"type": "integer"
|
|
},
|
|
"first_name": {
|
|
"description": "Individual customer fields",
|
|
"type": "string"
|
|
},
|
|
"founded_year": {
|
|
"type": "integer"
|
|
},
|
|
"full_name": {
|
|
"type": "string"
|
|
},
|
|
"industry": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"description": "Preferences and settings",
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"mobile": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"registration_number": {
|
|
"description": "Company customer fields",
|
|
"type": "string"
|
|
},
|
|
"tax_id": {
|
|
"type": "string"
|
|
},
|
|
"timezone": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.CustomerListResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"customers": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/customer.CustomerResponse"
|
|
}
|
|
},
|
|
"limit": {
|
|
"type": "integer"
|
|
},
|
|
"offset": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
},
|
|
"total_pages": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"customer.CustomerResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"$ref": "#/definitions/customer.Address"
|
|
},
|
|
"annual_revenue": {
|
|
"type": "number"
|
|
},
|
|
"business_type": {
|
|
"type": "string"
|
|
},
|
|
"companies": {
|
|
"description": "Company relationships",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/customer.CompanySummary"
|
|
}
|
|
},
|
|
"compliance_notes": {
|
|
"type": "string"
|
|
},
|
|
"contact_person": {
|
|
"$ref": "#/definitions/customer.ContactPerson"
|
|
},
|
|
"created_at": {
|
|
"type": "integer"
|
|
},
|
|
"created_by": {
|
|
"type": "string"
|
|
},
|
|
"currency": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"employee_count": {
|
|
"type": "integer"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"founded_year": {
|
|
"type": "integer"
|
|
},
|
|
"full_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"industry": {
|
|
"type": "string"
|
|
},
|
|
"is_compliant": {
|
|
"type": "boolean"
|
|
},
|
|
"is_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"mobile": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"registration_number": {
|
|
"description": "Company customer fields",
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"tax_id": {
|
|
"type": "string"
|
|
},
|
|
"timezone": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "integer"
|
|
},
|
|
"updated_by": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.LoginForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.RefreshTokenForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"refresh_token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.RemoveCompaniesForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"customer.SuspendCustomerForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"reason": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.UpdateCustomerForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"description": "Address information",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/customer.AddressForm"
|
|
}
|
|
]
|
|
},
|
|
"annual_revenue": {
|
|
"type": "number"
|
|
},
|
|
"business_type": {
|
|
"description": "Business information",
|
|
"type": "string"
|
|
},
|
|
"company_ids": {
|
|
"description": "Company assignments",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"company_name": {
|
|
"description": "Company customer fields",
|
|
"type": "string"
|
|
},
|
|
"contact_person": {
|
|
"description": "Contact person (for company customers)",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/customer.ContactPersonForm"
|
|
}
|
|
]
|
|
},
|
|
"currency": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"employee_count": {
|
|
"type": "integer"
|
|
},
|
|
"first_name": {
|
|
"description": "Individual customer fields",
|
|
"type": "string"
|
|
},
|
|
"founded_year": {
|
|
"type": "integer"
|
|
},
|
|
"full_name": {
|
|
"type": "string"
|
|
},
|
|
"industry": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"description": "Preferences and settings",
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"mobile": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"registration_number": {
|
|
"type": "string"
|
|
},
|
|
"tax_id": {
|
|
"type": "string"
|
|
},
|
|
"timezone": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.UpdateCustomerStatusForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"customer.UpdateCustomerVerificationForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"compliance_notes": {
|
|
"type": "string"
|
|
},
|
|
"is_compliant": {
|
|
"type": "boolean"
|
|
},
|
|
"is_verified": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"main.HealthResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"service": {
|
|
"description": "Service name",
|
|
"type": "string",
|
|
"example": "tender-management-api"
|
|
},
|
|
"status": {
|
|
"description": "Current health status",
|
|
"type": "string",
|
|
"example": "healthy"
|
|
},
|
|
"time": {
|
|
"description": "Current Unix timestamp",
|
|
"type": "integer",
|
|
"example": 1699123456
|
|
},
|
|
"uptime": {
|
|
"description": "Service uptime duration",
|
|
"type": "string",
|
|
"example": "24h30m15s"
|
|
},
|
|
"version": {
|
|
"description": "API version",
|
|
"type": "string",
|
|
"example": "2.0.0"
|
|
}
|
|
}
|
|
},
|
|
"response.APIError": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "string"
|
|
},
|
|
"details": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"response.APIResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {},
|
|
"error": {
|
|
"$ref": "#/definitions/response.APIError"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"meta": {
|
|
"$ref": "#/definitions/response.Meta"
|
|
},
|
|
"success": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"response.Meta": {
|
|
"type": "object",
|
|
"properties": {
|
|
"limit": {
|
|
"type": "integer"
|
|
},
|
|
"offset": {
|
|
"type": "integer"
|
|
},
|
|
"page": {
|
|
"type": "integer"
|
|
},
|
|
"pages": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"user.AuthResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"expires_at": {
|
|
"type": "integer"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"$ref": "#/definitions/user.UserResponse"
|
|
}
|
|
}
|
|
},
|
|
"user.ChangePasswordForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"new_password": {
|
|
"description": "New password (minimum 8 characters)",
|
|
"type": "string",
|
|
"example": "NewPass456!"
|
|
},
|
|
"old_password": {
|
|
"description": "Current password for verification",
|
|
"type": "string",
|
|
"example": "OldPassword123!"
|
|
}
|
|
}
|
|
},
|
|
"user.CreateUserForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"description": "Optional company UUID",
|
|
"type": "string",
|
|
"example": "123e4567-e89b-12d3-a456-426614174000"
|
|
},
|
|
"department": {
|
|
"description": "Optional department name",
|
|
"type": "string",
|
|
"example": "Information Technology"
|
|
},
|
|
"email": {
|
|
"description": "Valid email address",
|
|
"type": "string",
|
|
"example": "john.smith@company.com"
|
|
},
|
|
"full_name": {
|
|
"description": "Full name of the user",
|
|
"type": "string",
|
|
"example": "John Smith"
|
|
},
|
|
"password": {
|
|
"description": "Password (minimum 8 characters)",
|
|
"type": "string",
|
|
"example": "SecurePass123!"
|
|
},
|
|
"phone": {
|
|
"description": "Optional phone number",
|
|
"type": "string",
|
|
"example": "+1234567890"
|
|
},
|
|
"position": {
|
|
"description": "Optional job position",
|
|
"type": "string",
|
|
"example": "Senior Developer"
|
|
},
|
|
"profile_image": {
|
|
"description": "Optional profile image URL",
|
|
"type": "string",
|
|
"example": "https://example.com/avatar.jpg"
|
|
},
|
|
"role": {
|
|
"description": "User role (admin, manager, operator, viewer)",
|
|
"type": "string",
|
|
"example": "manager"
|
|
},
|
|
"username": {
|
|
"description": "Unique username (alphanumeric only)",
|
|
"type": "string",
|
|
"example": "johnsmith"
|
|
}
|
|
}
|
|
},
|
|
"user.LoginForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"password": {
|
|
"description": "User password",
|
|
"type": "string",
|
|
"example": "Nima.1998"
|
|
},
|
|
"username": {
|
|
"description": "Username or email address",
|
|
"type": "string",
|
|
"example": "nakhostin"
|
|
}
|
|
}
|
|
},
|
|
"user.RefreshTokenForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"refresh_token": {
|
|
"description": "Valid refresh token",
|
|
"type": "string",
|
|
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
|
|
}
|
|
}
|
|
},
|
|
"user.ResetPasswordForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"description": "Email address for password reset",
|
|
"type": "string",
|
|
"example": "john.smith@company.com"
|
|
}
|
|
}
|
|
},
|
|
"user.UpdateUserForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"description": "Updated company ID",
|
|
"type": "string",
|
|
"example": "123e4567-e89b-12d3-a456-426614174000"
|
|
},
|
|
"department": {
|
|
"description": "Updated department",
|
|
"type": "string",
|
|
"example": "Product Management"
|
|
},
|
|
"email": {
|
|
"description": "Updated email address",
|
|
"type": "string",
|
|
"example": "john.smith@newcompany.com"
|
|
},
|
|
"full_name": {
|
|
"description": "Updated full name",
|
|
"type": "string",
|
|
"example": "John Smith"
|
|
},
|
|
"phone": {
|
|
"description": "Updated phone number",
|
|
"type": "string",
|
|
"example": "+1234567890"
|
|
},
|
|
"position": {
|
|
"description": "Updated position",
|
|
"type": "string",
|
|
"example": "Tech Lead"
|
|
},
|
|
"profile_image": {
|
|
"description": "Updated profile image URL",
|
|
"type": "string",
|
|
"example": "https://example.com/new-avatar.jpg"
|
|
},
|
|
"role": {
|
|
"description": "Updated user role",
|
|
"type": "string",
|
|
"example": "admin"
|
|
},
|
|
"status": {
|
|
"description": "Updated account status",
|
|
"type": "string",
|
|
"example": "active"
|
|
},
|
|
"username": {
|
|
"description": "Updated username",
|
|
"type": "string",
|
|
"example": "johnsmith"
|
|
}
|
|
}
|
|
},
|
|
"user.UpdateUserRoleForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"user.UpdateUserStatusForm": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"user.UserListResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"limit": {
|
|
"type": "integer"
|
|
},
|
|
"offset": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
},
|
|
"total_pages": {
|
|
"type": "integer"
|
|
},
|
|
"users": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/user.UserResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"user.UserResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "integer"
|
|
},
|
|
"created_by": {
|
|
"type": "string"
|
|
},
|
|
"department": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"full_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"is_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"last_login_at": {
|
|
"type": "integer"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"position": {
|
|
"type": "string"
|
|
},
|
|
"profile_image": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "integer"
|
|
},
|
|
"updated_by": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"BearerAuth": {
|
|
"description": "Type \"Bearer\" followed by a space and JWT token. Example: \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"",
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"description": "System health check operations for monitoring application status and dependencies",
|
|
"name": "Admin-Health"
|
|
},
|
|
{
|
|
"description": "User authentication and authorization operations including login, logout, token refresh, and password management for web panel administration",
|
|
"name": "Admin-Authorization"
|
|
},
|
|
{
|
|
"description": "Administrative user management operations including CRUD operations, role management, status updates, and profile management for web panel administrators",
|
|
"name": "Admin-Users"
|
|
},
|
|
{
|
|
"description": "Administrative customer management operations for web panel including CRUD operations, company assignment, verification, status management, and comprehensive filtering with pagination",
|
|
"name": "Admin-Customers"
|
|
},
|
|
{
|
|
"description": "Administrative company management operations for web panel including CRUD operations, tag management, verification, status updates, comprehensive search and filtering, and statistical reporting",
|
|
"name": "Admin-Companies"
|
|
},
|
|
{
|
|
"description": "Customer authentication and authorization operations for mobile application including login, logout, token refresh, and profile access",
|
|
"name": "Authorization"
|
|
}
|
|
]
|
|
} |