Files
tm_back/cmd/web/docs/docs.go
T
n.nakhostin 8c1e593686 Implement customer management domain with authorization and API enhancements
- Introduced a new customer management domain, including entities, services, handlers, and forms for customer operations.
- Added JWT-based user authorization settings in the configuration file for both user and customer management.
- Updated API endpoints to reflect the new structure, including changes to health check and user management routes.
- Enhanced Swagger documentation to include new customer-related endpoints and authorization details.
- Refactored the Makefile to include a target for generating API documentation.
- Removed obsolete documentation files to streamline the project structure.
2025-08-11 12:55:08 +03:30

3259 lines
115 KiB
Go

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/admin/v1/change-password": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Change current user password",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Change password",
"parameters": [
{
"description": "Password change data",
"name": "password",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.ChangePasswordForm"
}
}
],
"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"
}
},
"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": [
"Customers-Admin"
],
"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": [
"Customers-Admin"
],
"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. This is useful for company administrators to see all users within their organization.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Get customers by company ID",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Company UUID",
"name": "companyId",
"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 company ID format",
"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": [
"Customers-Admin"
],
"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": [
"Customers-Admin"
],
"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/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Retrieve detailed customer information by unique customer ID. Returns comprehensive customer data including personal details, company information, address, verification status, and audit fields.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Get customer by ID",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Customer UUID",
"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 format",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Customer does not exist",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update existing customer information with comprehensive details. All fields are optional and only provided fields will be updated. This endpoint is used by the web panel for full customer management.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Update customer information",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Customer UUID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Customer update information - all fields are optional",
"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 customer ID or input data",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Customer does not exist",
"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. The customer record is preserved but marked as deleted. This is a reversible operation.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Delete customer",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Customer UUID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Customer deleted successfully",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad request - Invalid customer ID format",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Customer does not exist",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/admin/v1/customers/{id}/activate": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Reactivate a suspended customer account by setting their status back to active. This reverses the suspension action.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Activate suspended customer account",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Customer UUID",
"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 does not exist",
"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 the status of a customer account. Valid statuses include active, inactive, suspended, and pending. This affects the customer's ability to access the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Update customer status",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Customer UUID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Status update information",
"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 customer ID or status",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Customer does not exist",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"422": {
"description": "Validation error - Invalid status value",
"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 by setting their status to suspended. Suspended customers cannot access the system. A reason for suspension must be provided.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Suspend customer account",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Customer UUID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Suspension reason",
"name": "reason",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "Customer suspended successfully",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad request - Invalid customer ID or missing reason",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Customer does not exist",
"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 the verification and compliance status of a customer. This includes marking customers as verified and compliant, with optional compliance notes for audit purposes.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Update customer verification and compliance status",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Customer UUID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Verification and compliance update information",
"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 customer ID",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Customer does not exist",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"422": {
"description": "Validation error - Invalid verification 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. This is a simple verification action that sets the customer's verification status to true.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Admin"
],
"summary": "Verify customer",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Customer UUID",
"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 does not exist",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/admin/v1/login": {
"post": {
"description": "Authenticate user with username and password",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authorization"
],
"summary": "Login user",
"parameters": [
{
"description": "Login credentials",
"name": "login",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.LoginForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/user.AuthResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/admin/v1/logout": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Logout current user and invalidate tokens",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Logout user",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/admin/v1/profile": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get current user profile information",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Get user profile",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/user.UserResponse"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"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 current user profile information",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Update user profile",
"parameters": [
{
"description": "Profile update data",
"name": "profile",
"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"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/admin/v1/refresh-token": {
"post": {
"description": "Refresh access token using refresh token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authorization"
],
"summary": "Refresh access token",
"parameters": [
{
"description": "Refresh token",
"name": "refresh",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.RefreshTokenForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/user.AuthResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/admin/v1/reset-password": {
"post": {
"description": "Send password reset email to user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authorization"
],
"summary": "Reset password",
"parameters": [
{
"description": "Password reset request",
"name": "reset",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.ResetPasswordForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"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": [
"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 (admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Create user",
"parameters": [
{
"description": "User creation data",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.CreateUserForm"
}
}
],
"responses": {
"201": {
"description": "Created",
"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"
}
},
"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": [
"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": [
"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": [
"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": [
"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": [
"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": [
"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": [
"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/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": [
"Customers-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/logout": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Logout customer and invalidate access token. This ensures the token cannot be used for future requests.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-Authorization"
],
"summary": "Customer logout",
"responses": {
"200": {
"description": "Logout successful",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized - Invalid or missing access token",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/profile": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Retrieve authenticated customer's profile information. This endpoint requires a valid access token and returns the customer's own profile data.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Customers-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 access token",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"404": {
"description": "Not found - Customer profile not found",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/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": [
"Customers-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"
}
}
}
}
},
"/health": {
"get": {
"description": "Get server health status",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Health"
],
"summary": "Health check",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/main.HealthResponse"
}
}
}
}
}
},
"definitions": {
"customer.Address": {
"type": "object",
"properties": {
"addressType": {
"description": "billing, shipping, etc.",
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"isDefault": {
"type": "boolean"
},
"postalCode": {
"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.AuthResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"customer": {
"$ref": "#/definitions/customer.CustomerResponse"
},
"expires_at": {
"type": "integer"
},
"refresh_token": {
"type": "string"
}
}
},
"customer.ContactPerson": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"firstName": {
"type": "string"
},
"fullName": {
"type": "string"
},
"isPrimary": {
"type": "boolean"
},
"lastName": {
"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_id": {
"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"
},
"password": {
"type": "string"
},
"phone": {
"type": "string"
},
"registration_number": {
"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"
},
"company_id": {
"type": "string"
},
"company_name": {
"type": "string"
},
"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": {
"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.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_id": {
"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": {
"status": {
"type": "string"
},
"time": {
"type": "integer"
},
"version": {
"type": "string"
}
}
},
"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": {
"type": "string"
},
"old_password": {
"type": "string"
}
}
},
"user.CreateUserForm": {
"type": "object",
"properties": {
"company_id": {
"type": "string"
},
"department": {
"type": "string"
},
"email": {
"type": "string"
},
"full_name": {
"type": "string"
},
"password": {
"type": "string"
},
"phone": {
"type": "string"
},
"position": {
"type": "string"
},
"profile_image": {
"type": "string"
},
"role": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"user.LoginForm": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"user.RefreshTokenForm": {
"type": "object",
"properties": {
"refresh_token": {
"type": "string"
}
}
},
"user.ResetPasswordForm": {
"type": "object",
"properties": {
"email": {
"type": "string"
}
}
},
"user.UpdateUserForm": {
"type": "object",
"properties": {
"company_id": {
"type": "string"
},
"department": {
"type": "string"
},
"email": {
"type": "string"
},
"full_name": {
"type": "string"
},
"phone": {
"type": "string"
},
"position": {
"type": "string"
},
"profile_image": {
"type": "string"
},
"role": {
"type": "string"
},
"status": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"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.",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
},
"tags": [
{
"description": "User management operations including authentication, profile management, and admin operations",
"name": "Users"
},
{
"description": "Authentication operations including login, logout, and token management",
"name": "Authorization"
},
{
"description": "Customer management operations including authentication, profile management, and admin operations",
"name": "Customers-Admin"
},
{
"description": "Customer authentication operations including login, logout, and token management",
"name": "Customers-Authorization"
},
{
"description": "Health check operations",
"name": "Health"
}
]
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0.0",
Host: "localhost:8081",
BasePath: "",
Schemes: []string{},
Title: "Tender Management API",
Description: "This is the API documentation for the Tender Management System.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}