From 58ecd2e94aa4d765c1df53e2a990526648f772c5 Mon Sep 17 00:00:00 2001 From: hossein taromi Date: Sun, 27 Jul 2025 14:46:37 +0330 Subject: [PATCH] chore: update swagger configuration --- swagger.json | 3552 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 2639 insertions(+), 913 deletions(-) diff --git a/swagger.json b/swagger.json index ef470f3..11bce61 100644 --- a/swagger.json +++ b/swagger.json @@ -1,9 +1,797 @@ { + "schemes": [ + "http", + "https" + ], "swagger": "2.0", "info": { - "contact": {} + "description": "Beehive API for managing products, files, users and admin operations\n\n## Environments\n- **Local**: http://localhost:8090\n- **Stage**: https://apimznstg.aireview.ir\n\nChange the host in the swagger UI or API client to match your target environment.", + "title": "Beehive API", + "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:8090", + "basePath": "/", "paths": { + "/api/v1/admin/admin-users": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves all admin users with pagination support", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get all admin users", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page offset", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "List of admin users", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.AdminUserInfo" + } + } + }, + "401": { + "description": "Unauthorized - invalid or missing JWT token", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + }, + "post": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Creates a new admin user in the system with optional roles and permissions", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Create admin user", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "Admin user information including roles and permissions", + "name": "adminUser", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.CreateAdminUserRequest" + } + } + ], + "responses": { + "201": { + "description": "Admin user created successfully", + "schema": { + "$ref": "#/definitions/domain.AdminUserInfo" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized - invalid or missing JWT token", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/admin/admin-users/{id}": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves a specific admin user by their ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get admin user by ID", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Admin user found", + "schema": { + "$ref": "#/definitions/domain.AdminUserInfo" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized - invalid or missing JWT token", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "Admin user not found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + }, + "put": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Updates an admin user in the system with optional roles and permissions (overwrites existing)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Update admin user", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Updated admin user information including roles and permissions", + "name": "adminUser", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.UpdateAdminUserRequest" + } + } + ], + "responses": { + "200": { + "description": "Admin user updated successfully", + "schema": { + "$ref": "#/definitions/domain.AdminUserInfo" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "Admin user not found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + }, + "delete": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Deletes an admin user from the system", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Delete admin user", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Admin user deleted successfully", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "Admin user not found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/admin/admin-users/{id}/permissions": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves all permissions assigned to an admin user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get admin user permissions", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "List of permissions", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Permission" + } + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/admin/admin-users/{id}/permissions/{permissionId}": { + "post": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Assigns a permission to an admin user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Assign permission to admin user", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Permission ID", + "name": "permissionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Permission assigned successfully", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + }, + "delete": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Removes a permission from an admin user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Remove permission from admin user", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Permission ID", + "name": "permissionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Permission removed successfully", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/admin/admin-users/{id}/roles": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves all roles assigned to an admin user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get admin user roles", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "List of roles", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Role" + } + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/admin/admin-users/{id}/roles/{roleId}": { + "post": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Assigns a role to an admin user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Assign role to admin user", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Role ID", + "name": "roleId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Role assigned successfully", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + }, + "delete": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Removes a role from an admin user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Remove role from admin user", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Admin user ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Role ID", + "name": "roleId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Role removed successfully", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + } + }, "/api/v1/admin/auth/login": { "post": { "description": "Authenticates admin user with username and password, returns JWT tokens and user permissions", @@ -56,6 +844,346 @@ } } }, + "/api/v1/admin/files": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Get a paginated list of files with optional filtering", + "produces": [ + "application/json" + ], + "tags": [ + "files" + ], + "summary": "List files", + "parameters": [ + { + "type": "integer", + "description": "Number of files to return (default: 10)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Number of files to skip (default: 0)", + "name": "offset", + "in": "query" + }, + { + "type": "string", + "description": "Filter by file type (image/video)", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "Search text in file names", + "name": "search", + "in": "query" + }, + { + "type": "integer", + "description": "Minimum file size in bytes", + "name": "min_size", + "in": "query" + }, + { + "type": "integer", + "description": "Maximum file size in bytes", + "name": "max_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetFilesResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + } + } + }, + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Upload an image or video file with admin authentication", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "files" + ], + "summary": "Upload a new file", + "parameters": [ + { + "type": "file", + "description": "File to upload", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "Display name for the file", + "name": "name", + "in": "formData" + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.UploadFileResponse" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/admin/files/{id}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Get file information by ID", + "produces": [ + "application/json" + ], + "tags": [ + "files" + ], + "summary": "Get file by ID", + "parameters": [ + { + "type": "string", + "description": "File ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.FileInfo" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "File not found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + } + } + }, + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Update file information", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "files" + ], + "summary": "Update file", + "parameters": [ + { + "type": "string", + "description": "File ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Update file request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.UpdateFileRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.UpdateFileResponse" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "File not found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + } + } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Delete a file by ID", + "produces": [ + "application/json" + ], + "tags": [ + "files" + ], + "summary": "Delete file", + "parameters": [ + { + "type": "string", + "description": "File ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.DeleteFileResponse" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "File not found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + } + } + } + }, "/api/v1/admin/permissions": { "get": { "security": [ @@ -771,6 +1899,75 @@ } } } + }, + "put": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Assigns multiple permissions to a role, overwriting all existing permissions", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Assign permissions to role (bulk)", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Role ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Permission IDs to assign", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.AssignPermissionsToRoleRequest" + } + } + ], + "responses": { + "200": { + "description": "Permissions assigned successfully", + "schema": { + "$ref": "#/definitions/domain.AssignPermissionsToRoleResponse" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "403": { + "description": "Forbidden - insufficient permissions", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } } }, "/api/v1/admin/roles/{id}/permissions/{permissionId}": { @@ -915,14 +2112,9 @@ } } }, - "/api/v1/admin/users": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves all admin users with pagination support", + "/api/v1/auth/otp/send": { + "post": { + "description": "Sends an OTP code to the provided phone number for authentication", "consumes": [ "application/json" ], @@ -930,67 +2122,139 @@ "application/json" ], "tags": [ - "admin" + "auth" ], - "summary": "Get all admin users", + "summary": "Send OTP for user login/register", + "parameters": [ + { + "description": "Send OTP payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.SendOTPRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.SendOTPResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse" + } + }, + "429": { + "description": "Too Many Requests", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/files/{serveKey}": { + "get": { + "description": "Download a file by its serve key and stream the actual file content", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "files" + ], + "summary": "Download file", "parameters": [ { "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", + "description": "File serve key", + "name": "serveKey", + "in": "path", "required": true + } + ], + "responses": { + "200": { + "description": "File content", + "schema": { + "type": "file" + } }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "File not found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/images": { + "get": { + "description": "Retrieves a paginated list of all images", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "images" + ], + "summary": "Get all images", + "parameters": [ { "type": "integer", - "description": "Number of items per page", + "description": "Number of images to return (default: 10)", "name": "limit", "in": "query" }, { "type": "integer", - "description": "Page offset", + "description": "Number of images to skip (default: 0)", "name": "offset", "in": "query" } ], "responses": { "200": { - "description": "List of admin users", + "description": "OK", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.AdminUserInfo" - } + "$ref": "#/definitions/domain.GetAllImagesResponse" } }, - "401": { - "description": "Unauthorized - invalid or missing JWT token", + "400": { + "description": "Bad Request", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } }, "500": { - "description": "Internal server error", + "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } } } }, "post": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Creates a new admin user in the system", + "description": "Creates a new image", "consumes": [ "application/json" ], @@ -998,69 +2262,45 @@ "application/json" ], "tags": [ - "admin" + "images" ], - "summary": "Create admin user", + "summary": "Create a new image", "parameters": [ { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "Admin user information", - "name": "adminUser", + "description": "Image creation payload", + "name": "request", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.CreateAdminUserRequest" + "$ref": "#/definitions/http.CreateImageRequest" } } ], "responses": { "201": { - "description": "Admin user created successfully", + "description": "Created", "schema": { - "$ref": "#/definitions/domain.AdminUserInfo" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" } }, "400": { - "description": "Bad request", + "description": "Bad Request", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "401": { - "description": "Unauthorized - invalid or missing JWT token", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } }, "500": { - "description": "Internal server error", + "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } } } } }, - "/api/v1/admin/users/{id}": { + "/api/v1/product-options": { "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves a specific admin user by their ID", + "description": "Retrieves a paginated list of all product options", "consumes": [ "application/json" ], @@ -1068,71 +2308,48 @@ "application/json" ], "tags": [ - "admin" + "product-options" ], - "summary": "Get admin user by ID", + "summary": "Get all product options", "parameters": [ { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true + "type": "integer", + "description": "Number of product options to return (default: 10)", + "name": "limit", + "in": "query" }, { - "type": "string", - "description": "Admin user ID", - "name": "id", - "in": "path", - "required": true + "type": "integer", + "description": "Number of product options to skip (default: 0)", + "name": "offset", + "in": "query" } ], "responses": { "200": { - "description": "Admin user found", + "description": "OK", "schema": { - "$ref": "#/definitions/domain.AdminUserInfo" + "$ref": "#/definitions/domain.GetAllProductOptionsResponse" } }, "400": { - "description": "Bad request", + "description": "Bad Request", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "401": { - "description": "Unauthorized - invalid or missing JWT token", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "404": { - "description": "Admin user not found", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } }, "500": { - "description": "Internal server error", + "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } } } - }, - "put": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Updates an existing admin user", + } + }, + "/api/v1/product-options/{id}": { + "get": { + "description": "Retrieves a specific product option by its ID", "consumes": [ "application/json" ], @@ -1140,74 +2357,47 @@ "application/json" ], "tags": [ - "admin" + "product-options" ], - "summary": "Update admin user", + "summary": "Get product option by ID", "parameters": [ { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Admin user ID", + "type": "integer", + "description": "Product Option ID", "name": "id", "in": "path", "required": true - }, - { - "description": "Updated admin user information", - "name": "adminUser", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.UpdateAdminUserRequest" - } } ], "responses": { "200": { - "description": "Admin user updated successfully", + "description": "OK", "schema": { - "$ref": "#/definitions/domain.AdminUserInfo" + "$ref": "#/definitions/domain.GetProductOptionByIDResponse" } }, "400": { - "description": "Bad request", + "description": "Bad Request", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } }, "404": { - "description": "Admin user not found", + "description": "Not Found", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } }, "500": { - "description": "Internal server error", + "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } } } }, "delete": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Deletes an admin user from the system", + "description": "Deletes a product option by its ID", "consumes": [ "application/json" ], @@ -1215,20 +2405,13 @@ "application/json" ], "tags": [ - "admin" + "product-options" ], - "summary": "Delete admin user", + "summary": "Delete a product option", "parameters": [ { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Admin user ID", + "type": "integer", + "description": "Product Option ID", "name": "id", "in": "path", "required": true @@ -1236,450 +2419,27 @@ ], "responses": { "200": { - "description": "Admin user deleted successfully", + "description": "OK", "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } + "$ref": "#/definitions/domain.DeleteProductOptionResponse" } }, "400": { - "description": "Bad request", + "description": "Bad Request", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } }, "404": { - "description": "Admin user not found", + "description": "Not Found", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } }, "500": { - "description": "Internal server error", + "description": "Internal Server Error", "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - } - } - } - }, - "/api/v1/admin/users/{id}/permissions": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves all permissions assigned to an admin user", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Get admin user permissions", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Admin user ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "List of permissions", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Permission" - } - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "500": { - "description": "Internal server error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - } - } - } - }, - "/api/v1/admin/users/{id}/permissions/{permissionId}": { - "post": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Assigns a permission to an admin user", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Assign permission to admin user", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Admin user ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Permission ID", - "name": "permissionId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Permission assigned successfully", - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "500": { - "description": "Internal server error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - } - } - }, - "delete": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Removes a permission from an admin user", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Remove permission from admin user", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Admin user ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Permission ID", - "name": "permissionId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Permission removed successfully", - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "500": { - "description": "Internal server error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - } - } - } - }, - "/api/v1/admin/users/{id}/roles": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves all roles assigned to an admin user", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Get admin user roles", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Admin user ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "List of roles", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Role" - } - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "500": { - "description": "Internal server error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - } - } - } - }, - "/api/v1/admin/users/{id}/roles/{roleId}": { - "post": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Assigns a role to an admin user", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Assign role to admin user", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Admin user ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Role assigned successfully", - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "500": { - "description": "Internal server error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - } - } - }, - "delete": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Removes a role from an admin user", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Remove role from admin user", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Admin user ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Role removed successfully", - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "403": { - "description": "Forbidden - insufficient permissions", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "500": { - "description": "Internal server error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" } } } @@ -1734,7 +2494,7 @@ } }, "post": { - "description": "Creates a new product with the provided details", + "description": "Creates a new product with the provided information", "consumes": [ "application/json" ], @@ -1752,7 +2512,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.CreateProductRequest" + "$ref": "#/definitions/http.CreateProductRequest" } } ], @@ -1825,7 +2585,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.CreateCategoryRequest" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.CreateCategoryRequest" } } ], @@ -1878,7 +2638,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.UpdateCategoryRequest" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateCategoryRequest" } } ], @@ -2128,7 +2888,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/domain.Image" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" } }, "400": { @@ -2152,7 +2912,7 @@ } }, "delete": { - "description": "Deletes an image by its ID", + "description": "Deletes an existing image", "consumes": [ "application/json" ], @@ -2173,8 +2933,119 @@ } ], "responses": { - "204": { - "description": "No Content" + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/products/options": { + "post": { + "description": "Creates a new product option with the provided details", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "product-options" + ], + "summary": "Create a new product option", + "parameters": [ + { + "description": "Product option creation payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.CreateProductOptionRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.CreateProductOptionResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/products/options/{id}": { + "put": { + "description": "Updates an existing product option with the provided details", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "product-options" + ], + "summary": "Update product option", + "parameters": [ + { + "type": "string", + "description": "Product Option ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Product option update payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateProductOptionRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.UpdateProductOptionResponse" + } }, "400": { "description": "Bad Request", @@ -2224,7 +3095,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.UpdateProductVariantRequest" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateProductVariantRequest" } } ], @@ -2304,6 +3175,59 @@ } } }, + "/api/v1/products/variants/{variantId}/assign-images": { + "post": { + "description": "Assigns an array of images to a specific product variant", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "images" + ], + "summary": "Assign images to variant", + "parameters": [ + { + "type": "string", + "description": "Variant ID", + "name": "variantId", + "in": "path", + "required": true + }, + { + "description": "Image assignment payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/http.AssignImagesToVariantRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/http.AssignImagesToVariantResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + } + } + } + }, "/api/v1/products/{id}": { "get": { "description": "Retrieves a specific product by its ID", @@ -2354,7 +3278,7 @@ } }, "put": { - "description": "Updates an existing product with new details", + "description": "Updates an existing product with the provided information", "consumes": [ "application/json" ], @@ -2367,7 +3291,7 @@ "summary": "Update product", "parameters": [ { - "type": "string", + "type": "integer", "description": "Product ID", "name": "id", "in": "path", @@ -2379,7 +3303,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.UpdateProductRequest" + "$ref": "#/definitions/http.UpdateProductRequest" } } ], @@ -2459,6 +3383,230 @@ } } }, + "/api/v1/products/{id}/total-sold": { + "put": { + "description": "Sets the total sold count for a product for promotional purposes", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "products" + ], + "summary": "Set product total sold count", + "parameters": [ + { + "type": "integer", + "description": "Product ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Total sold update payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/http.SetTotalSoldRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/http.SetTotalSoldResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/products/{productID}/recommended": { + "get": { + "description": "Retrieves recommended products based on the categories of the specified product", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "products" + ], + "summary": "Get recommended products", + "parameters": [ + { + "type": "string", + "description": "Product ID", + "name": "productID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Number of recommended products to return (default: 10)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Number of recommended products to skip (default: 0)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetRecommendedProductsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/products/{productId}/all-images": { + "get": { + "description": "Retrieves all images for a specific product and its variants", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "images" + ], + "summary": "Get product and variants images", + "parameters": [ + { + "type": "string", + "description": "Product ID", + "name": "productId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetProductAndVariantsImagesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/products/{productId}/assign-images": { + "post": { + "description": "Assigns an array of images to a specific product", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "images" + ], + "summary": "Assign images to product", + "parameters": [ + { + "type": "string", + "description": "Product ID", + "name": "productId", + "in": "path", + "required": true + }, + { + "description": "Image assignment payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/http.AssignImagesToProductRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/http.AssignImagesToProductResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + } + } + } + }, "/api/v1/products/{productId}/images": { "get": { "description": "Retrieves all images for a specific product", @@ -2487,7 +3635,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/domain.Image" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" } } }, @@ -2504,57 +3652,6 @@ } } } - }, - "post": { - "description": "Creates a new image for a specific product", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "images" - ], - "summary": "Create a new product image", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "productId", - "in": "path", - "required": true - }, - { - "description": "Image creation payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/http.CreateImageRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/domain.Image" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" - } - } - } } }, "/api/v1/products/{productId}/variants": { @@ -2626,7 +3723,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/domain.CreateProductVariantRequest" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.CreateProductVariantRequest" } } ], @@ -2703,58 +3800,6 @@ } } } - }, - "/api/v1/users/otp/send": { - "post": { - "description": "Generates and sends an OTP code to the specified phone number", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "auth" - ], - "summary": "Send OTP to phone number", - "parameters": [ - { - "description": "Phone number", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.SendOTPRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.SendOTPResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse" - } - }, - "429": { - "description": "Too Many Requests", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse" - } - } - } - } } }, "definitions": { @@ -2824,6 +3869,28 @@ } } }, + "domain.AssignPermissionsToRoleRequest": { + "type": "object", + "properties": { + "permission_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "role_id": { + "type": "integer" + } + } + }, + "domain.AssignPermissionsToRoleResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, "domain.CreateAdminUserRequest": { "type": "object", "properties": { @@ -2836,6 +3903,18 @@ "password": { "type": "string" }, + "permissions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "roles": { + "type": "array", + "items": { + "type": "integer" + } + }, "status": { "type": "string" }, @@ -2844,19 +3923,11 @@ } } }, - "domain.CreateCategoryRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, "domain.CreateCategoryResponse": { "type": "object", "properties": { "category": { - "$ref": "#/definitions/domain.ProductCategory" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory" } } }, @@ -2879,27 +3950,11 @@ } } }, - "domain.CreateProductRequest": { + "domain.CreateProductOptionResponse": { "type": "object", "properties": { - "attributes": { - "type": "object", - "additionalProperties": true - }, - "category_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "integer" + "product_option": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" } } }, @@ -2907,28 +3962,7 @@ "type": "object", "properties": { "product": { - "$ref": "#/definitions/domain.Product" - } - } - }, - "domain.CreateProductVariantRequest": { - "type": "object", - "properties": { - "attributes": { - "type": "object", - "additionalProperties": true - }, - "fee_percentage": { - "type": "integer" - }, - "product_id": { - "type": "integer" - }, - "profit_percentage": { - "type": "integer" - }, - "weight": { - "type": "number" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" } } }, @@ -2936,7 +3970,7 @@ "type": "object", "properties": { "variant": { - "$ref": "#/definitions/domain.ProductVariant" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" } } }, @@ -2959,6 +3993,14 @@ } } }, + "domain.DeleteFileResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, "domain.DeletePermissionResponse": { "type": "object", "properties": { @@ -2967,6 +4009,14 @@ } } }, + "domain.DeleteProductOptionResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, "domain.DeleteProductResponse": { "type": "object", "properties": { @@ -2983,17 +4033,83 @@ } } }, + "domain.FileInfo": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "mime_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "original_name": { + "type": "string" + }, + "serve_key": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "thumbnail_serve_key": { + "type": "string" + }, + "thumbnail_url": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/domain.FileType" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "domain.FileType": { + "type": "string", + "enum": [ + "image", + "video" + ], + "x-enum-varnames": [ + "FileTypeImage", + "FileTypeVideo" + ] + }, "domain.GetAllCategoriesResponse": { "type": "object", "properties": { "categories": { "type": "array", "items": { - "$ref": "#/definitions/domain.ProductCategory" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory" } } } }, + "domain.GetAllImagesResponse": { + "type": "object", + "properties": { + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" + } + }, + "total": { + "type": "integer" + } + } + }, "domain.GetAllPermissionsResponse": { "type": "object", "properties": { @@ -3005,17 +4121,45 @@ } } }, + "domain.GetAllProductOptionsResponse": { + "type": "object", + "properties": { + "product_options": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" + } + }, + "total": { + "type": "integer" + } + } + }, "domain.GetAllProductsResponse": { "type": "object", "properties": { "products": { "type": "array", "items": { - "$ref": "#/definitions/domain.Product" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" } } } }, + "domain.GetFilesResponse": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.FileInfo" + } + }, + "total": { + "type": "integer" + } + } + }, "domain.GetPermissionByIDResponse": { "type": "object", "properties": { @@ -3024,11 +4168,39 @@ } } }, + "domain.GetProductAndVariantsImagesResponse": { + "type": "object", + "properties": { + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" + } + }, + "product_id": { + "type": "integer" + }, + "variants": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ProductVariantWithImages" + } + } + } + }, "domain.GetProductByIDResponse": { "type": "object", "properties": { "product": { - "$ref": "#/definitions/domain.Product" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" + } + } + }, + "domain.GetProductOptionByIDResponse": { + "type": "object", + "properties": { + "product_option": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" } } }, @@ -3038,7 +4210,7 @@ "variants": { "type": "array", "items": { - "$ref": "#/definitions/domain.ProductVariant" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" } } } @@ -3049,7 +4221,7 @@ "products": { "type": "array", "items": { - "$ref": "#/definitions/domain.Product" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" } } } @@ -3060,28 +4232,19 @@ "products": { "type": "array", "items": { - "$ref": "#/definitions/domain.Product" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" } } } }, - "domain.Image": { + "domain.GetRecommendedProductsResponse": { "type": "object", "properties": { - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "url": { - "type": "string" + "recommended_products": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" + } } } }, @@ -3103,7 +4266,38 @@ "$ref": "#/definitions/domain.TokenPair" }, "user_info": { - "$ref": "#/definitions/domain.UserInfo" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_domain.UserInfo" + } + } + }, + "domain.Maintenance": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string" + }, + "image": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "domain.Option": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "meta_title": { + "type": "string" + }, + "title": { + "type": "string" } } }, @@ -3127,75 +4321,16 @@ } } }, - "domain.Product": { + "domain.ProductVariantWithImages": { "type": "object", "properties": { "attributes": { "type": "object", "additionalProperties": true }, - "created_at": { + "color": { "type": "string" }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Image" - } - }, - "name": { - "type": "string" - }, - "product_categories": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.ProductCategory" - } - }, - "product_variants": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.ProductVariant" - } - }, - "type": { - "type": "integer" - }, - "updated_at": { - "type": "string" - } - } - }, - "domain.ProductCategory": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, - "domain.ProductVariant": { - "type": "object", - "properties": { - "attributes": { - "type": "object", - "additionalProperties": true - }, "created_at": { "type": "string" }, @@ -3208,7 +4343,7 @@ "images": { "type": "array", "items": { - "$ref": "#/definitions/domain.Image" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" } }, "product_id": { @@ -3217,6 +4352,9 @@ "profit_percentage": { "type": "integer" }, + "size": { + "type": "string" + }, "updated_at": { "type": "string" }, @@ -3304,6 +4442,18 @@ "password": { "type": "string" }, + "permissions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "roles": { + "type": "array", + "items": { + "type": "integer" + } + }, "status": { "type": "string" }, @@ -3312,22 +4462,27 @@ } } }, - "domain.UpdateCategoryRequest": { + "domain.UpdateCategoryResponse": { + "type": "object", + "properties": { + "category": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory" + } + } + }, + "domain.UpdateFileRequest": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "name": { "type": "string" } } }, - "domain.UpdateCategoryResponse": { + "domain.UpdateFileResponse": { "type": "object", "properties": { - "category": { - "$ref": "#/definitions/domain.ProductCategory" + "file": { + "$ref": "#/definitions/domain.FileInfo" } } }, @@ -3353,30 +4508,11 @@ } } }, - "domain.UpdateProductRequest": { + "domain.UpdateProductOptionResponse": { "type": "object", "properties": { - "attributes": { - "type": "object", - "additionalProperties": true - }, - "category_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "type": { - "type": "integer" + "product_option": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" } } }, @@ -3384,28 +4520,7 @@ "type": "object", "properties": { "product": { - "$ref": "#/definitions/domain.Product" - } - } - }, - "domain.UpdateProductVariantRequest": { - "type": "object", - "properties": { - "attributes": { - "type": "object", - "additionalProperties": true - }, - "fee_percentage": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "profit_percentage": { - "type": "integer" - }, - "weight": { - "type": "number" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" } } }, @@ -3413,7 +4528,7 @@ "type": "object", "properties": { "variant": { - "$ref": "#/definitions/domain.ProductVariant" + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" } } }, @@ -3426,12 +4541,412 @@ "id": { "type": "integer" }, + "permissions": { + "type": "array", + "items": { + "type": "integer" + } + }, "title": { "type": "string" } } }, - "domain.UserInfo": { + "domain.UploadFileResponse": { + "type": "object", + "properties": { + "file": { + "$ref": "#/definitions/domain.FileInfo" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_file_delivery_http.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.CreateCategoryRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.CreateProductOptionRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "maintenance": { + "$ref": "#/definitions/domain.Maintenance" + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Option" + } + }, + "title": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.CreateProductVariantRequest": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "enabled": { + "type": "boolean" + }, + "fee_percentage": { + "type": "integer" + }, + "meta": { + "type": "object", + "additionalProperties": true + }, + "product_id": { + "type": "integer" + }, + "profit_percentage": { + "type": "integer" + }, + "size": { + "type": "string" + }, + "stock_limit": { + "type": "integer" + }, + "stock_managed": { + "type": "boolean" + }, + "stock_number": { + "type": "integer" + }, + "weight": { + "type": "number" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.Image": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "file_type": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "thumbnail_url": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.Product": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "design_style": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "id": { + "type": "integer" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" + } + }, + "name": { + "type": "string" + }, + "product_categories": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory" + } + }, + "product_option": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" + }, + "product_option_id": { + "type": "integer" + }, + "product_variants": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" + } + }, + "total_sold": { + "type": "integer" + }, + "type": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "weights": { + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "maintenance": { + "$ref": "#/definitions/domain.Maintenance" + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Option" + } + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "color": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "fee_amount": { + "type": "number" + }, + "fee_percentage": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" + } + }, + "meta": { + "type": "object", + "additionalProperties": true + }, + "price_amount": { + "description": "Pricing fields (calculated in response)", + "type": "number" + }, + "product_id": { + "type": "integer" + }, + "profit_amount": { + "type": "number" + }, + "profit_percentage": { + "type": "integer" + }, + "size": { + "type": "string" + }, + "stock_limit": { + "type": "integer" + }, + "stock_managed": { + "type": "boolean" + }, + "stock_number": { + "type": "integer" + }, + "tax_amount": { + "type": "number" + }, + "tax_percentage": { + "type": "number" + }, + "updated_at": { + "type": "string" + }, + "weight": { + "type": "number" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateCategoryRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateProductOptionRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "maintenance": { + "$ref": "#/definitions/domain.Maintenance" + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Option" + } + }, + "title": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateProductVariantRequest": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "enabled": { + "type": "boolean" + }, + "fee_percentage": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "meta": { + "type": "object", + "additionalProperties": true + }, + "profit_percentage": { + "type": "integer" + }, + "size": { + "type": "string" + }, + "stock_limit": { + "type": "integer" + }, + "stock_managed": { + "type": "boolean" + }, + "stock_number": { + "type": "integer" + }, + "weight": { + "type": "number" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "gitlab_com_mazane_beehive_mazane_application_user_domain.UserInfo": { "type": "object", "properties": { "avatar": { @@ -3460,26 +4975,40 @@ } } }, - "gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse": { + "http.AssignImagesToProductRequest": { "type": "object", "properties": { - "error": { + "image_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "http.AssignImagesToProductResponse": { + "type": "object", + "properties": { + "message": { "type": "string" } } }, - "gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse": { + "http.AssignImagesToVariantRequest": { "type": "object", "properties": { - "error": { - "type": "string" + "image_ids": { + "type": "array", + "items": { + "type": "integer" + } } } }, - "gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse": { + "http.AssignImagesToVariantResponse": { "type": "object", "properties": { - "error": { + "message": { "type": "string" } } @@ -3487,25 +5016,208 @@ "http.CreateImageRequest": { "type": "object", "properties": { + "file_type": { + "type": "string" + }, "name": { "type": "string" }, + "thumbnail_url": { + "type": "string" + }, "url": { "type": "string" } } }, + "http.CreateProductRequest": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "category_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "description": { + "type": "string" + }, + "design_style": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "product_option_id": { + "type": "integer" + }, + "total_sold": { + "type": "integer" + }, + "type": { + "type": "integer" + }, + "variants": { + "type": "array", + "items": { + "$ref": "#/definitions/http.CreateVariantRequest" + } + } + } + }, + "http.CreateVariantRequest": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "enabled": { + "type": "boolean" + }, + "fee_percentage": { + "type": "integer" + }, + "meta": { + "type": "object", + "additionalProperties": true + }, + "profit_percentage": { + "type": "integer" + }, + "stock_limit": { + "type": "integer" + }, + "stock_managed": { + "type": "boolean" + }, + "stock_number": { + "type": "integer" + }, + "weight": { + "type": "number" + } + } + }, + "http.SetTotalSoldRequest": { + "type": "object", + "properties": { + "total_sold": { + "type": "integer" + } + } + }, + "http.SetTotalSoldResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, "http.UpdateImageRequest": { "type": "object", "properties": { + "file_type": { + "type": "string" + }, "name": { "type": "string" }, + "thumbnail_url": { + "type": "string" + }, "url": { "type": "string" } } }, + "http.UpdateProductRequest": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "category_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "description": { + "type": "string" + }, + "design_style": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "product_option_id": { + "type": "integer" + }, + "total_sold": { + "type": "integer" + }, + "type": { + "type": "integer" + }, + "variants": { + "type": "array", + "items": { + "$ref": "#/definitions/http.UpdateVariantRequest" + } + } + } + }, + "http.UpdateVariantRequest": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "enabled": { + "type": "boolean" + }, + "fee_percentage": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "meta": { + "type": "object", + "additionalProperties": true + }, + "profit_percentage": { + "type": "integer" + }, + "stock_limit": { + "type": "integer" + }, + "stock_managed": { + "type": "boolean" + }, + "stock_number": { + "type": "integer" + }, + "weight": { + "type": "number" + } + } + }, "time.Duration": { "type": "integer", "enum": [ @@ -3529,5 +5241,19 @@ "Hour" ] } + }, + "securityDefinitions": { + "AdminAuth": { + "description": "Type \"Bearer\" followed by a space and JWT token for admin access.", + "type": "apiKey", + "name": "Authorization", + "in": "header" + }, + "BearerAuth": { + "description": "Type \"Bearer\" followed by a space and JWT token.", + "type": "apiKey", + "name": "Authorization", + "in": "header" + } } } \ No newline at end of file