{ "swagger": "2.0", "info": { "description": "This is a sample server celler server.", "title": "WMS Wareify API Docs", "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": "1.0" }, "host": "localhost:8888", "basePath": "/api/v1", "paths": { "/auth/login": { "post": { "description": "Authenticate user and return access \u0026 refresh tokens.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "User login", "parameters": [ { "description": "Login payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.UserLoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/auth/refresh": { "post": { "description": "Exchange a refresh token for a new access token (and optionally a new refresh token).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Refresh auth token", "parameters": [ { "description": "Refresh token payload", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": true } } } } }, "/clients": { "get": { "description": "Get paginated list of clients with filtering and sorting capabilities", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Clients" ], "summary": "Get list of clients", "parameters": [ { "type": "string", "description": "Filter by name (partial match)", "name": "name", "in": "query" }, { "type": "string", "description": "Filter by code (partial match)", "name": "code", "in": "query" }, { "type": "integer", "description": "Page size (default: 10)", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Page number (default: 1)", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.ResponseWithPagination" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "post": { "description": "Create a new client with the provided information", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Clients" ], "summary": "Create a new client", "parameters": [ { "type": "string", "description": "Client name", "name": "name", "in": "formData", "required": true }, { "type": "string", "description": "Client code", "name": "code", "in": "formData", "required": true }, { "type": "file", "description": "Client logo (optional)", "name": "logo", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/clients/{id}": { "get": { "description": "Get detailed information of a specific client by their ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Clients" ], "summary": "Get client by ID", "parameters": [ { "type": "string", "description": "Client ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "put": { "description": "Update client information by ID", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Clients" ], "summary": "Update client", "parameters": [ { "type": "string", "description": "Client ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Client name", "name": "name", "in": "formData" }, { "type": "string", "description": "Client code", "name": "code", "in": "formData" }, { "type": "file", "description": "Client logo (optional)", "name": "logo", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "delete": { "description": "Delete a client by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Clients" ], "summary": "Delete client", "parameters": [ { "type": "string", "description": "Client ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/clients/{id}/assign-menus": { "post": { "description": "Assign one or more menus to a client", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Clients" ], "summary": "Assign menus to client", "parameters": [ { "type": "string", "description": "Client ID", "name": "id", "in": "path", "required": true }, { "description": "Menu assignment data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.AssignMenusToClientRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/clients/{id}/remove-menus": { "post": { "description": "Remove one or more menus from a client", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Clients" ], "summary": "Remove menus from client", "parameters": [ { "type": "string", "description": "Client ID", "name": "id", "in": "path", "required": true }, { "description": "Menu removal data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.RemoveMenusFromClientRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/maintenance-groups": { "get": { "description": "Get all maintenance groups", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "MaintenanceGroup" ], "summary": "Get all maintenance groups", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/utils.Response" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } }, "put": { "description": "Update maintenance group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "MaintenanceGroup" ], "summary": "Update maintenance group", "parameters": [ { "description": "Update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.MaintGroupUpdateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } }, "post": { "description": "Create a new maintenance group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "MaintenanceGroup" ], "summary": "Create a new maintenance group", "parameters": [ { "description": "Create payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.MaintGroupCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/maintenance-groups/{id}": { "get": { "description": "Get maintenance group by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "MaintenanceGroup" ], "summary": "Get maintenance group by ID", "parameters": [ { "type": "string", "description": "MaintenanceGroup ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } }, "delete": { "description": "Delete maintenance group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "MaintenanceGroup" ], "summary": "Delete maintenance group", "parameters": [ { "type": "string", "description": "MaintenanceGroup ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/menus": { "get": { "description": "Get paginated list of menus with filtering and sorting capabilities", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Menus" ], "summary": "Get list of menus", "parameters": [ { "type": "string", "description": "Filter by name (partial match)", "name": "name", "in": "query" }, { "type": "string", "description": "Filter by parent menu ID", "name": "parent_id", "in": "query" }, { "type": "array", "items": { "type": "string" }, "collectionFormat": "csv", "description": "Include related entities", "name": "includes", "in": "query" }, { "type": "integer", "description": "Page number (default: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (default: 10)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.ResponseWithPagination" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "post": { "description": "Create a new menu with the provided information", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Menus" ], "summary": "Create a new menu", "parameters": [ { "description": "Menu creation data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.MenuCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/menus/by-name": { "get": { "description": "Get menu information by its name", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Menus" ], "summary": "Get menu by name", "parameters": [ { "type": "string", "description": "Menu name", "name": "name", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/menus/{id}": { "get": { "description": "Get detailed information of a specific menu by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Menus" ], "summary": "Get menu by ID", "parameters": [ { "type": "string", "description": "Menu ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "put": { "description": "Update menu information by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Menus" ], "summary": "Update menu", "parameters": [ { "type": "string", "description": "Menu ID", "name": "id", "in": "path", "required": true }, { "description": "Menu update data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.MenuUpdateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "delete": { "description": "Delete a menu by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Menus" ], "summary": "Delete menu", "parameters": [ { "type": "string", "description": "Menu ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/permissions": { "get": { "description": "Get list of all permissions", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Permissions" ], "summary": "Get list of permissions", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "post": { "description": "Create a new permission with the provided information", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Permissions" ], "summary": "Create a new permission", "parameters": [ { "description": "Permission creation data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.PermissionsCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/permissions/by-name": { "get": { "description": "Get permission information by its name", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Permissions" ], "summary": "Get permission by name", "parameters": [ { "type": "string", "description": "Permission name", "name": "name", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/permissions/{id}": { "get": { "description": "Get detailed information of a specific permission by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Permissions" ], "summary": "Get permission by ID", "parameters": [ { "type": "string", "description": "Permission ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "put": { "description": "Update permission information by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Permissions" ], "summary": "Update permission", "parameters": [ { "type": "string", "description": "Permission ID", "name": "id", "in": "path", "required": true }, { "description": "Permission update data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.PermissionsUpdateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "delete": { "description": "Delete a permission by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Permissions" ], "summary": "Delete permission", "parameters": [ { "type": "string", "description": "Permission ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/roles": { "get": { "description": "Get paginated list of roles. Supports filtering and pagination.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Get all roles", "parameters": [ { "type": "string", "description": "Filter by name (partial match)", "name": "name", "in": "query" }, { "type": "integer", "description": "Page number (default: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (default: 10)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/utils.ResponseWithPagination" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } }, "post": { "description": "Create a new role.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Create a new role", "parameters": [ { "description": "Role create payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.RoleCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/roles/{id}": { "get": { "description": "Get details of a role by ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Get role by ID", "parameters": [ { "type": "string", "description": "Role ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } }, "put": { "description": "Update a role by ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Update a role", "parameters": [ { "type": "string", "description": "Role ID", "name": "id", "in": "path", "required": true }, { "description": "Role update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.RoleUpdateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } }, "delete": { "description": "Delete a role by ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Delete a role", "parameters": [ { "type": "string", "description": "Role ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/roles/{id}/assign-permissions": { "post": { "description": "Assign permissions to a role by role ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Assign permissions to role", "parameters": [ { "type": "string", "description": "Role ID", "name": "id", "in": "path", "required": true }, { "description": "Assign permissions payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.AssignPermissionRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/roles/{id}/remove-permissions": { "post": { "description": "Remove permissions from a role by role ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Remove permissions from role", "parameters": [ { "type": "string", "description": "Role ID", "name": "id", "in": "path", "required": true }, { "description": "Remove permissions payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.RemovePermissionRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get paginated list of users for the current client. Supports filtering by name and including related roles.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "Get list of users", "parameters": [ { "type": "string", "description": "Filter by name (partial match)", "name": "name", "in": "query" }, { "type": "integer", "description": "Page number (default: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (default: 10)", "name": "page_size", "in": "query" }, { "type": "string", "description": "Sort expression, e.g. created_at desc", "name": "sort", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/utils.ResponseWithPagination" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update profile of the authenticated user. Use multipart/form-data if uploading files (photo).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "Update current user", "parameters": [ { "description": "Update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.UserUpdateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete the authenticated user's account (soft/hard depends on implementation).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "Delete current user", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/me": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Return the authenticated user's profile.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "Get current user", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/register": { "post": { "description": "Create a new user under the authenticated client. Validates input and returns created user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "Register a new user", "parameters": [ { "description": "Register payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.UserCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/send-verification-email": { "post": { "description": "Send email with verification code/link to a user's email address.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "Send verification email", "parameters": [ { "description": "Email request payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.SendVerificationEmailRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/verify-email": { "post": { "description": "Verify a user's email using code or token sent via email.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "Verify user email", "parameters": [ { "description": "Verify email payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.VerifyEmailRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get details of a user by their ID. Requires appropriate permissions.", "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": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/{id}/assign-roles": { "post": { "description": "Assign roles to a user by user ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Assign roles to user", "parameters": [ { "type": "string", "description": "User ID", "name": "id", "in": "path", "required": true }, { "description": "Assign roles payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.AssignRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/{id}/remove-roles": { "post": { "description": "Remove roles from a user by user ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Remove roles from user", "parameters": [ { "type": "string", "description": "User ID", "name": "id", "in": "path", "required": true }, { "description": "Remove roles payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dto.RemoveRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } }, "/users/{id}/roles": { "get": { "description": "Get all roles assigned to a user by user ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Roles" ], "summary": "Get roles by user ID", "parameters": [ { "type": "string", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/utils.ResponseWithPagination" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } } } } } }, "definitions": { "dto.AssignMenusToClientRequest": { "type": "object", "required": [ "menu_ids" ], "properties": { "menu_ids": { "type": "array", "items": { "type": "string" } } } }, "dto.AssignPermissionRequest": { "type": "object", "required": [ "permission_ids" ], "properties": { "permission_ids": { "description": "RoleID string `json:\"role_id\" binding:\"required,uuid4\"`", "type": "array", "items": { "type": "string" } } } }, "dto.AssignRoleRequest": { "type": "object", "required": [ "role_ids" ], "properties": { "role_ids": { "description": "UserID string `json:\"user_id\" binding:\"required,uuid4\"`", "type": "array", "items": { "type": "string" } } } }, "dto.MaintGroupCreateRequest": { "type": "object", "required": [ "client_id", "code", "maintenance_group_roles", "name" ], "properties": { "client_id": { "type": "string" }, "code": { "type": "string", "maxLength": 50, "minLength": 2 }, "description": { "type": "string" }, "maintenance_group_roles": { "type": "array", "items": { "$ref": "#/definitions/dto.MaintenanceGroupRole" } }, "name": { "type": "string", "maxLength": 100, "minLength": 2 } } }, "dto.MaintGroupUpdateRequest": { "type": "object", "properties": { "client_id": { "type": "string" }, "code": { "type": "string", "maxLength": 50, "minLength": 2 }, "description": { "type": "string" }, "maintenance_group_roles": { "type": "array", "items": { "$ref": "#/definitions/dto.MaintenanceGroupRoleUpdate" } }, "name": { "type": "string", "maxLength": 100, "minLength": 2 } } }, "dto.MaintenanceGroupRole": { "type": "object", "required": [ "level", "maintenance_group_role_users", "role_id" ], "properties": { "level": { "type": "integer" }, "maintenance_group_role_users": { "type": "array", "items": { "$ref": "#/definitions/dto.MaintenanceGroupRoleUser" } }, "role_id": { "type": "string" } } }, "dto.MaintenanceGroupRoleUpdate": { "type": "object", "properties": { "id": { "type": "string" }, "level": { "type": "integer" }, "maintenance_group_role_users": { "type": "array", "items": { "$ref": "#/definitions/dto.MaintenanceGroupRoleUser" } }, "role_id": { "type": "string" } } }, "dto.MaintenanceGroupRoleUser": { "type": "object", "required": [ "user_id" ], "properties": { "user_id": { "type": "string" } } }, "dto.MenuCreateRequest": { "type": "object", "required": [ "mode", "name", "sequence", "url" ], "properties": { "icon_url": { "type": "string", "maxLength": 100, "minLength": 2 }, "mode": { "type": "string", "maxLength": 20, "minLength": 1 }, "name": { "type": "string", "maxLength": 100, "minLength": 2 }, "parent_id": { "type": "string" }, "sequence": { "type": "integer" }, "status": { "type": "string" }, "table_name": { "type": "string", "maxLength": 10 }, "url": { "type": "string", "minLength": 1 } } }, "dto.MenuUpdateRequest": { "type": "object", "properties": { "icon_url": { "type": "string", "maxLength": 100, "minLength": 2 }, "mode": { "type": "string", "maxLength": 20, "minLength": 1 }, "name": { "type": "string", "maxLength": 100, "minLength": 2 }, "parent_id": { "type": "string" }, "sequence": { "type": "integer" }, "status": { "type": "string" }, "table_name": { "type": "string", "maxLength": 10 }, "url": { "type": "string", "minLength": 1 } } }, "dto.PermissionsCreateRequest": { "type": "object", "required": [ "menu_id", "name" ], "properties": { "menu_id": { "type": "string" }, "name": { "type": "string" } } }, "dto.PermissionsUpdateRequest": { "type": "object", "properties": { "menu_id": { "type": "string" }, "name": { "type": "string" } } }, "dto.RemoveMenusFromClientRequest": { "type": "object", "required": [ "menu_ids" ], "properties": { "menu_ids": { "type": "array", "items": { "type": "string" } } } }, "dto.RemovePermissionRequest": { "type": "object", "required": [ "permission_ids" ], "properties": { "permission_ids": { "description": "RoleID string `json:\"role_id\" binding:\"required,uuid4\"`", "type": "array", "items": { "type": "string" } } } }, "dto.RemoveRoleRequest": { "type": "object", "required": [ "role_ids" ], "properties": { "role_ids": { "description": "UserID string `json:\"user_id\" binding:\"required,uuid4\"`", "type": "array", "items": { "type": "string" } } } }, "dto.RoleCreateRequest": { "type": "object", "required": [ "client_id", "name" ], "properties": { "client_id": { "type": "string" }, "description": { "type": "string" }, "home_url": { "type": "string" }, "icon_url": { "type": "string" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "role_menus": { "type": "array", "items": { "type": "string" } }, "role_permissions": { "type": "array", "items": { "type": "string" } }, "type": { "type": "string" }, "user_roles": { "type": "array", "items": { "type": "string" } }, "users": { "type": "array", "items": { "type": "string" } } } }, "dto.RoleUpdateRequest": { "type": "object", "properties": { "client_id": { "type": "string" }, "description": { "type": "string" }, "home_url": { "type": "string" }, "icon_url": { "type": "string" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "type": { "type": "string" } } }, "dto.SendVerificationEmailRequest": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string" } } }, "dto.UserCreateRequest": { "type": "object", "required": [ "client_id", "email", "name", "password", "username" ], "properties": { "address": { "type": "string" }, "client_id": { "type": "string" }, "email": { "type": "string" }, "gender": { "type": "string", "maxLength": 10 }, "location_id": { "type": "string" }, "maintenance_group_user_id": { "type": "string" }, "name": { "type": "string", "maxLength": 100, "minLength": 2 }, "password": { "type": "string", "minLength": 8 }, "phone": { "type": "string", "maxLength": 20, "minLength": 8 }, "photo_url": { "type": "string" }, "username": { "type": "string", "maxLength": 100, "minLength": 2 } } }, "dto.UserLoginRequest": { "type": "object", "required": [ "login", "password" ], "properties": { "login": { "type": "string" }, "password": { "type": "string" } } }, "dto.UserUpdateRequest": { "type": "object", "properties": { "address": { "type": "string" }, "client_id": { "type": "string" }, "email": { "type": "string" }, "gender": { "type": "string", "maxLength": 10 }, "location_id": { "type": "string" }, "maintenance_group_user_id": { "type": "string" }, "name": { "type": "string", "maxLength": 100, "minLength": 2 }, "password": { "type": "string", "minLength": 8 }, "phone": { "type": "string", "maxLength": 20, "minLength": 8 }, "photo_url": { "type": "string" }, "username": { "type": "string", "maxLength": 100, "minLength": 2 } } }, "dto.VerifyEmailRequest": { "type": "object", "required": [ "token" ], "properties": { "token": { "type": "string" } } }, "utils.PaginationResponse": { "type": "object", "properties": { "max_page": { "type": "integer" }, "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" } } }, "utils.Response": { "type": "object", "properties": { "data": {}, "error": {}, "message": { "type": "string" }, "meta": {}, "status": { "type": "boolean" } } }, "utils.ResponseWithPagination": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "message": { "type": "string" }, "pagination": { "$ref": "#/definitions/utils.PaginationResponse" }, "status": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Bearer token for authentication", "type": "apiKey", "name": "Authorization", "in": "header" } }, "externalDocs": { "description": "OpenAPI", "url": "https://swagger.io/resources/open-api/" } }