From b3c3a8afd07161d26008d3f39f2cb04300520e2f Mon Sep 17 00:00:00 2001 From: hosseintaromi Date: Mon, 28 Jul 2025 09:11:08 +0330 Subject: [PATCH] fix(product-options): update API routes and enhance product option models --- src/components/ui/Button.tsx | 3 +- src/components/ui/FileUploader.tsx | 11 +- src/constant/routes.ts | 4 +- src/hooks/useFileUpload.ts | 41 +- src/pages/product-options/core/_models.ts | 37 +- .../ProductOptionFormPage.tsx | 280 +- .../ProductOptionsListPage.tsx | 20 +- .../products/product-form/ProductFormPage.tsx | 6 +- swagger.json | 10101 ++++++++-------- 9 files changed, 5102 insertions(+), 5401 deletions(-) diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx index b2303f1..9d0da0c 100644 --- a/src/components/ui/Button.tsx +++ b/src/components/ui/Button.tsx @@ -1,4 +1,5 @@ import { clsx } from 'clsx'; +import { MouseEvent } from 'react'; interface ButtonProps { children: any; @@ -6,7 +7,7 @@ interface ButtonProps { size?: 'sm' | 'md' | 'lg'; disabled?: boolean; loading?: boolean; - onClick?: () => void; + onClick?: (e?: MouseEvent) => void; type?: 'button' | 'submit' | 'reset'; className?: string; } diff --git a/src/components/ui/FileUploader.tsx b/src/components/ui/FileUploader.tsx index e43ccd5..fea07e2 100644 --- a/src/components/ui/FileUploader.tsx +++ b/src/components/ui/FileUploader.tsx @@ -120,7 +120,6 @@ export const FileUploader: React.FC = ({ setFiles(prev => [...prev, newFile]); try { - // شبیه‌سازی پروگرس const progressInterval = setInterval(() => { setFiles(prev => prev.map(f => f.id === fileId && f.progress < 90 @@ -145,13 +144,13 @@ export const FileUploader: React.FC = ({ : f )); } - }, [onUpload, files.length, maxFiles, maxFileSize, acceptedTypes]); + }, [onUpload, maxFiles, maxFileSize, acceptedTypes]); - const handleFileSelect = (selectedFiles: FileList) => { + const handleFileSelect = useCallback((selectedFiles: FileList) => { Array.from(selectedFiles).forEach(file => { handleFileUpload(file); }); - }; + }, [handleFileUpload]); const handleDrop = useCallback((e: React.DragEvent) => { e.preventDefault(); @@ -160,7 +159,7 @@ export const FileUploader: React.FC = ({ const droppedFiles = e.dataTransfer.files; handleFileSelect(droppedFiles); - }, [disabled, handleFileUpload]); + }, [disabled, handleFileSelect]); const handleDragOver = useCallback((e: React.DragEvent) => { e.preventDefault(); @@ -307,7 +306,7 @@ export const FileUploader: React.FC = ({ variant="secondary" size="sm" onClick={(e) => { - e.stopPropagation(); + e?.stopPropagation(); handleRemove(file.id); }} className="p-1 h-8 w-8" diff --git a/src/constant/routes.ts b/src/constant/routes.ts index d4b2e15..be72bbb 100644 --- a/src/constant/routes.ts +++ b/src/constant/routes.ts @@ -39,8 +39,8 @@ export const API_ROUTES = { // Product Options APIs GET_PRODUCT_OPTIONS: "api/v1/product-options", GET_PRODUCT_OPTION: (id: string) => `api/v1/product-options/${id}`, - CREATE_PRODUCT_OPTION: "api/v1/products/options", - UPDATE_PRODUCT_OPTION: (id: string) => `api/v1/products/options/${id}`, + CREATE_PRODUCT_OPTION: "api/v1/product-options", + UPDATE_PRODUCT_OPTION: (id: string) => `api/v1/product-options/${id}`, DELETE_PRODUCT_OPTION: (id: string) => `api/v1/product-options/${id}`, // Categories APIs diff --git a/src/hooks/useFileUpload.ts b/src/hooks/useFileUpload.ts index 23d60c5..6425ab6 100644 --- a/src/hooks/useFileUpload.ts +++ b/src/hooks/useFileUpload.ts @@ -1,24 +1,21 @@ import { useMutation } from "@tanstack/react-query"; -import { - httpPostRequest, - httpDeleteRequest, - APIUrlGenerator, -} from "@/utils/baseHttpService"; +import { toast } from "react-hot-toast"; +import { APIUrlGenerator } from "@/utils/baseHttpService"; import { API_ROUTES } from "@/constant/routes"; -import toast from "react-hot-toast"; - -interface UploadFileResponse { - id: string; - name: string; - size: number; - type: string; - url: string; - serve_key: string; - created_at: string; -} +import { httpPostRequest, httpDeleteRequest } from "@/utils/baseHttpService"; interface UploadResponse { - file: UploadFileResponse; + file: { + id: number; + url: string; + name: string; + original_name: string; + serve_key: string; + size: number; + mime_type: string; + created_at: string; + updated_at: string; + }; } export const useFileUpload = () => { @@ -26,12 +23,18 @@ export const useFileUpload = () => { mutationFn: async (file: File): Promise<{ id: string; url: string }> => { const formData = new FormData(); formData.append("file", file); + formData.append("name", "uploaded-file"); console.log("Uploading file:", file.name); const response = await httpPostRequest( APIUrlGenerator(API_ROUTES.UPLOAD_FILE), - formData + formData, + { + headers: { + "Content-Type": "multipart/form-data", + }, + } ); console.log("Upload response:", response); @@ -41,7 +44,7 @@ export const useFileUpload = () => { } return { - id: response.data.file.id, + id: response.data.file.id.toString(), url: response.data.file.url, }; }, diff --git a/src/pages/product-options/core/_models.ts b/src/pages/product-options/core/_models.ts index 00a6e8a..c099ddc 100644 --- a/src/pages/product-options/core/_models.ts +++ b/src/pages/product-options/core/_models.ts @@ -1,14 +1,31 @@ +export interface Maintenance { + content: string; + description: string; + image: string; + title: string; +} + +export interface Option { + description: string; + meta_title: string; + title: string; +} + export interface ProductOption { id: number; - name: string; - values: string[]; + title: string; + description: string; + maintenance: Maintenance; + options: Option[]; created_at: string; updated_at: string; } export interface ProductOptionFormData { - name: string; - values: string[]; + title: string; + description: string; + maintenance: Maintenance; + options: Option[]; } export interface ProductOptionFilters { @@ -18,14 +35,18 @@ export interface ProductOptionFilters { } export interface CreateProductOptionRequest { - name: string; - values: string[]; + title: string; + description: string; + maintenance: Maintenance; + options: Option[]; } export interface UpdateProductOptionRequest { id: number; - name: string; - values: string[]; + title: string; + description: string; + maintenance: Maintenance; + options: Option[]; } export interface ProductOptionsResponse { diff --git a/src/pages/product-options/product-option-form/ProductOptionFormPage.tsx b/src/pages/product-options/product-option-form/ProductOptionFormPage.tsx index ee0bf0b..5058df1 100644 --- a/src/pages/product-options/product-option-form/ProductOptionFormPage.tsx +++ b/src/pages/product-options/product-option-form/ProductOptionFormPage.tsx @@ -1,19 +1,33 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; -import { useForm } from 'react-hook-form'; +import { useForm, useFieldArray } from 'react-hook-form'; import { yupResolver } from '@hookform/resolvers/yup'; import * as yup from 'yup'; import { useProductOption, useCreateProductOption, useUpdateProductOption } from '../core/_hooks'; -import { ProductOptionFormData } from '../core/_models'; +import { ProductOptionFormData, Maintenance, Option } from '../core/_models'; import { Button } from "@/components/ui/Button"; import { Input } from "@/components/ui/Input"; import { LoadingSpinner } from "@/components/ui/LoadingSpinner"; -import { TagInput } from "@/components/ui/TagInput"; -import { ArrowRight, Settings } from "lucide-react"; +import { ArrowRight, Settings, Plus, Trash2 } from "lucide-react"; + +const maintenanceSchema = yup.object({ + title: yup.string().required('عنوان نگهداری الزامی است'), + description: yup.string().required('توضیحات نگهداری الزامی است'), + content: yup.string().required('محتوای نگهداری الزامی است'), + image: yup.string().required('تصویر نگهداری الزامی است'), +}); + +const optionSchema = yup.object({ + title: yup.string().required('عنوان گزینه الزامی است'), + description: yup.string().required('توضیحات گزینه الزامی است'), + meta_title: yup.string().required('متا تایتل الزامی است'), +}); const productOptionSchema = yup.object({ - name: yup.string().required('نام گزینه الزامی است').min(2, 'نام گزینه باید حداقل 2 کاراکتر باشد'), - values: yup.array().of(yup.string()).min(1, 'حداقل یک مقدار باید وارد شود').required('مقادیر الزامی است'), + title: yup.string().required('عنوان الزامی است').min(2, 'عنوان باید حداقل 2 کاراکتر باشد'), + description: yup.string().required('توضیحات الزامی است'), + maintenance: maintenanceSchema.required('اطلاعات نگهداری الزامی است'), + options: yup.array().of(optionSchema).min(1, 'حداقل یک گزینه باید وارد شود').required('گزینه‌ها الزامی است'), }); const ProductOptionFormPage = () => { @@ -30,7 +44,7 @@ const ProductOptionFormPage = () => { const { register, handleSubmit, - formState: { errors, isValid, isDirty }, + formState: { errors, isValid }, setValue, watch, control @@ -38,17 +52,31 @@ const ProductOptionFormPage = () => { resolver: yupResolver(productOptionSchema) as any, mode: 'onChange', defaultValues: { - name: '', - values: [] + title: '', + description: '', + maintenance: { + title: '', + description: '', + content: '', + image: '' + }, + options: [] } }); + const { fields: optionFields, append: appendOption, remove: removeOption } = useFieldArray({ + control, + name: "options" + }); + const formValues = watch(); useEffect(() => { if (isEdit && productOption) { - setValue('name', productOption.name, { shouldValidate: true }); - setValue('values', productOption.values, { shouldValidate: true }); + setValue('title', productOption.title, { shouldValidate: true }); + setValue('description', productOption.description, { shouldValidate: true }); + setValue('maintenance', productOption.maintenance, { shouldValidate: true }); + setValue('options', productOption.options, { shouldValidate: true }); } }, [isEdit, productOption, setValue]); @@ -56,18 +84,14 @@ const ProductOptionFormPage = () => { if (isEdit && id) { updateOption({ id: parseInt(id), - name: data.name, - values: data.values + ...data }, { onSuccess: () => { navigate('/product-options'); } }); } else { - createOption({ - name: data.name, - values: data.values - }, { + createOption(data, { onSuccess: () => { navigate('/product-options'); } @@ -75,122 +99,172 @@ const ProductOptionFormPage = () => { } }; - const handleBack = () => { - navigate('/product-options'); + const addOption = () => { + appendOption({ + title: '', + description: '', + meta_title: '' + }); }; - const handleValuesChange = (values: string[]) => { - setValue('values', values, { shouldValidate: true, shouldDirty: true }); - }; - - if (isEdit && isLoadingOption) { + if (isLoadingOption) { return ( -
+
); } return ( -
- {/* Header */} -
- -
-

- - {isEdit ? 'ویرایش گزینه محصول' : 'ایجاد گزینه محصول جدید'} -

-

- {isEdit ? 'ویرایش اطلاعات گزینه محصول' : 'اطلاعات گزینه محصول جدید را وارد کنید'} -

+
+
+
+
+ +
+ +

+ {isEdit ? 'ویرایش گزینه محصول' : 'ایجاد گزینه محصول جدید'} +

+
+
-
- {/* Form */} -
-
- + +
+
+ +
+
+ +
+
- +
+

اطلاعات نگهداری

+
+ + + + +
+
- {/* Preview */} - {formValues.values && formValues.values.length > 0 && ( -
-

- پیش‌نمایش گزینه -

-
-
- نام: {formValues.name || 'نام گزینه'} +
+
+

گزینه‌ها

+ +
+ + {optionFields.map((field, index) => ( +
+
+

گزینه {index + 1}

+
-
- مقادیر: -
- {formValues.values.map((value, index) => ( - - {value} - - ))} -
+
+ + +
-
- )} + ))} -
+ {optionFields.length === 0 && ( +
+ هیچ گزینه‌ای تعریف نشده است. برای شروع گزینه‌ای اضافه کنید. +
+ )} +
+ +
- - {/* Help Section */} -
-

- راهنما -

-
    -
  • • گزینه‌های محصول برای تعریف ویژگی‌هایی مثل رنگ، سایز، جنس استفاده می‌شوند
  • -
  • • هر گزینه می‌تواند چندین مقدار داشته باشد (مثل قرمز، آبی، سبز برای رنگ)
  • -
  • • این گزینه‌ها بعداً در ایجاد محصولات قابل استفاده خواهند بود
  • -
  • • برای اضافه کردن مقدار جدید، آن را تایپ کنید و Enter بزنید
  • -
-
); }; diff --git a/src/pages/product-options/product-options-list/ProductOptionsListPage.tsx b/src/pages/product-options/product-options-list/ProductOptionsListPage.tsx index 23d9941..23f3b28 100644 --- a/src/pages/product-options/product-options-list/ProductOptionsListPage.tsx +++ b/src/pages/product-options/product-options-list/ProductOptionsListPage.tsx @@ -163,22 +163,22 @@ const ProductOptionsListPage = () => { {(productOptions || []).map((option: ProductOption) => ( - {option.name} + {option.title}
- {option.values.slice(0, 3).map((value, index) => ( + {(option.options || []).slice(0, 3).map((optionItem, index) => ( - {value} + {optionItem.title} ))} - {option.values.length > 3 && ( + {(option.options || []).length > 3 && ( - +{option.values.length - 3} بیشتر + +{(option.options || []).length - 3} بیشتر )}
@@ -218,21 +218,21 @@ const ProductOptionsListPage = () => {

- {option.name} + {option.title}

- {option.values.slice(0, 3).map((value, index) => ( + {(option.options || []).slice(0, 3).map((optionItem, index) => ( - {value} + {optionItem.title} ))} - {option.values.length > 3 && ( + {(option.options || []).length > 3 && ( - +{option.values.length - 3} بیشتر + +{(option.options || []).length - 3} بیشتر )}
diff --git a/src/pages/products/product-form/ProductFormPage.tsx b/src/pages/products/product-form/ProductFormPage.tsx index 7d6ee34..d6012ea 100644 --- a/src/pages/products/product-form/ProductFormPage.tsx +++ b/src/pages/products/product-form/ProductFormPage.tsx @@ -195,8 +195,8 @@ const ProductFormPage = () => { const productOptionOptions = (productOptions || []).map(option => ({ id: option.id, - title: option.name, - description: `مقادیر: ${option.values.join(', ')}` + title: option.title, + description: `تعداد گزینه‌ها: ${(option.options || []).length}` })); return ( @@ -329,7 +329,7 @@ const ProductFormPage = () => { {(productOptions || []).map((option) => ( ))} diff --git a/swagger.json b/swagger.json index 11bce61..fdadab4 100644 --- a/swagger.json +++ b/swagger.json @@ -1,5259 +1,4862 @@ { - "schemes": [ - "http", - "https" - ], - "swagger": "2.0", - "info": { - "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" + "schemes": ["http", "https"], + "swagger": "2.0", + "info": { + "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" }, - "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", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin-auth" - ], - "summary": "Admin login", - "parameters": [ - { - "description": "Admin login payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.AdminLoginRequest" - } - } - ], - "responses": { - "200": { - "description": "Login successful with tokens and permissions", - "schema": { - "$ref": "#/definitions/domain.AdminLoginResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - }, - "401": { - "description": "Unauthorized", - "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/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": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves all permissions from the system", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Get all permissions", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "List of permissions", - "schema": { - "$ref": "#/definitions/domain.GetAllPermissionsResponse" - } - }, - "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 permission in the system", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Create permission", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "Permission information", - "name": "permission", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.CreatePermissionRequest" - } - } - ], - "responses": { - "201": { - "description": "Permission created successfully", - "schema": { - "$ref": "#/definitions/domain.CreatePermissionResponse" - } - }, - "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/permissions/{id}": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves a specific permission by its ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Get permission by ID", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Permission ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Permission found", - "schema": { - "$ref": "#/definitions/domain.GetPermissionByIDResponse" - } - }, - "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": "Permission 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 existing permission", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Update permission", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Permission ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Updated permission information", - "name": "permission", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.UpdatePermissionRequest" - } - } - ], - "responses": { - "200": { - "description": "Permission updated successfully", - "schema": { - "$ref": "#/definitions/domain.UpdatePermissionResponse" - } - }, - "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": "Permission 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 a permission from the system", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Delete permission", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Permission ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Permission deleted successfully", - "schema": { - "$ref": "#/definitions/domain.DeletePermissionResponse" - } - }, - "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": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves all roles from the system", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Get all roles", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "List of roles", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Role" - } - } - }, - "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 role in the system", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Create role", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "Role information", - "name": "role", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.CreateRoleRequest" - } - } - ], - "responses": { - "201": { - "description": "Role created successfully", - "schema": { - "$ref": "#/definitions/domain.Role" - } - }, - "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/roles/{id}": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves a specific role by its ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Get role by ID", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Role ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Role found", - "schema": { - "$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" - } - }, - "404": { - "description": "Role 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 existing role", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Update role", - "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": "Updated role information", - "name": "role", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.UpdateRoleRequest" - } - } - ], - "responses": { - "200": { - "description": "Role updated successfully", - "schema": { - "$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" - } - }, - "404": { - "description": "Role 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 a role from the system", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Delete role", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Role ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Role 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" - } - }, - "500": { - "description": "Internal server error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" - } - } - } - } - }, - "/api/v1/admin/roles/{id}/permissions": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Retrieves all permissions assigned to a role", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Get role permissions", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Role 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" - } - } - } - }, - "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}": { - "post": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "Assigns a permission to a role", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Assign permission to role", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Role 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 a role", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "Remove permission from role", - "parameters": [ - { - "type": "string", - "description": "Bearer \u003ctoken\u003e", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "Role 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/auth/otp/send": { - "post": { - "description": "Sends an OTP code to the provided phone number for authentication", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "auth" - ], - "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": "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 images to return (default: 10)", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Number of images to skip (default: 0)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetAllImagesResponse" - } - }, - "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" - } - } - } - }, - "post": { - "description": "Creates a new image", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "images" - ], - "summary": "Create a new image", - "parameters": [ - { - "description": "Image creation payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/http.CreateImageRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_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/product-options": { - "get": { - "description": "Retrieves a paginated list of all product options", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "product-options" - ], - "summary": "Get all product options", - "parameters": [ - { - "type": "integer", - "description": "Number of product options to return (default: 10)", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Number of product options to skip (default: 0)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetAllProductOptionsResponse" - } - }, - "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/product-options/{id}": { - "get": { - "description": "Retrieves a specific product option by its ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "product-options" - ], - "summary": "Get product option by ID", - "parameters": [ - { - "type": "integer", - "description": "Product Option ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetProductOptionByIDResponse" - } - }, - "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" - } - } - } - }, - "delete": { - "description": "Deletes a product option by its ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "product-options" - ], - "summary": "Delete a product option", - "parameters": [ - { - "type": "integer", - "description": "Product Option ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.DeleteProductOptionResponse" - } - }, - "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": { - "get": { - "description": "Retrieves a paginated list of all products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "products" - ], - "summary": "Get all products", - "parameters": [ - { - "type": "integer", - "description": "Number of products to return (default: 10)", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Number of products to skip (default: 0)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetAllProductsResponse" - } - }, - "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" - } - } - } - }, - "post": { - "description": "Creates a new product with the provided information", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "products" - ], - "summary": "Create a new product", - "parameters": [ - { - "description": "Product creation payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/http.CreateProductRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/domain.CreateProductResponse" - } - }, - "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/categories": { - "get": { - "description": "Retrieves all product categories", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "categories" - ], - "summary": "Get all product categories", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetAllCategoriesResponse" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" - } - } - } - }, - "post": { - "description": "Creates a new product category", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "categories" - ], - "summary": "Create a new product category", - "parameters": [ - { - "description": "Category creation payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.CreateCategoryRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/domain.CreateCategoryResponse" - } - }, - "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/categories/{categoryId}": { - "put": { - "description": "Updates an existing product category", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "categories" - ], - "summary": "Update product category", - "parameters": [ - { - "type": "string", - "description": "Category ID", - "name": "categoryId", - "in": "path", - "required": true - }, - { - "description": "Category update payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateCategoryRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.UpdateCategoryResponse" - } - }, - "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" - } - } - } - }, - "delete": { - "description": "Deletes a product category by its ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "categories" - ], - "summary": "Delete product category", - "parameters": [ - { - "type": "string", - "description": "Category ID", - "name": "categoryId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.DeleteCategoryResponse" - } - }, - "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/category/{categoryId}": { - "get": { - "description": "Retrieves products filtered by category ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "products" - ], - "summary": "Get products by category", - "parameters": [ - { - "type": "string", - "description": "Category ID", - "name": "categoryId", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Number of products to return (default: 10)", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Number of products to skip (default: 0)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetProductsByCategoryResponse" - } - }, - "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/filter": { - "get": { - "description": "Retrieves products with optional filters for type, category, search, and weight range", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "products" - ], - "summary": "Get products with filters", - "parameters": [ - { - "type": "integer", - "description": "Product type filter", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "Category ID filter", - "name": "categoryId", - "in": "query" - }, - { - "type": "string", - "description": "Text search in name and description", - "name": "search", - "in": "query" - }, - { - "type": "number", - "description": "Minimum weight filter", - "name": "minWeight", - "in": "query" - }, - { - "type": "number", - "description": "Maximum weight filter", - "name": "maxWeight", - "in": "query" - }, - { - "type": "integer", - "description": "Number of products to return (default: 10)", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Number of products to skip (default: 0)", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetProductsWithFiltersResponse" - } - }, - "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/images/{imageId}": { - "put": { - "description": "Updates an existing image", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "images" - ], - "summary": "Update image", - "parameters": [ - { - "type": "string", - "description": "Image ID", - "name": "imageId", - "in": "path", - "required": true - }, - { - "description": "Image update payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/http.UpdateImageRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" - } - }, - "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" - } - } - } - }, - "delete": { - "description": "Deletes an existing image", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "images" - ], - "summary": "Delete image", - "parameters": [ - { - "type": "string", - "description": "Image ID", - "name": "imageId", - "in": "path", - "required": true - } - ], - "responses": { - "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", - "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/variants/{variantId}": { - "put": { - "description": "Updates an existing product variant", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "variants" - ], - "summary": "Update product variant", - "parameters": [ - { - "type": "string", - "description": "Variant ID", - "name": "variantId", - "in": "path", - "required": true - }, - { - "description": "Variant update payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateProductVariantRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.UpdateProductVariantResponse" - } - }, - "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" - } - } - } - }, - "delete": { - "description": "Deletes a product variant by its ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "variants" - ], - "summary": "Delete product variant", - "parameters": [ - { - "type": "string", - "description": "Variant ID", - "name": "variantId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.DeleteProductVariantResponse" - } - }, - "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/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", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "products" - ], - "summary": "Get product by ID", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetProductByIDResponse" - } - }, - "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" - } - } - } - }, - "put": { - "description": "Updates an existing product with the provided information", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "products" - ], - "summary": "Update product", - "parameters": [ - { - "type": "integer", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Product update payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/http.UpdateProductRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.UpdateProductResponse" - } - }, - "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" - } - } - } - }, - "delete": { - "description": "Deletes a product by its ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "products" - ], - "summary": "Delete product", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.DeleteProductResponse" - } - }, - "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/{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", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "images" - ], - "summary": "Get product images", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "productId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_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": { - "get": { - "description": "Retrieves all variants for a specific product", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "variants" - ], - "summary": "Get product variants", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "productId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.GetProductVariantsByProductIDResponse" - } - }, - "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" - } - } - } - }, - "post": { - "description": "Creates a new product variant for a specific product", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "variants" - ], - "summary": "Create a new product variant", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "productId", - "in": "path", - "required": true - }, - { - "description": "Variant creation payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.CreateProductVariantRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/domain.CreateProductVariantResponse" - } - }, - "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/users/login": { - "post": { - "description": "Authenticates user with OTP or creates new account", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "auth" - ], - "summary": "Login or register user", - "parameters": [ - { - "description": "Login/Register payload", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/domain.LoginOrRegisterRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/domain.LoginOrRegisterResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse" - } - }, - "401": { - "description": "Unauthorized", - "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" - } - } - } - } - } + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, - "definitions": { - "domain.AdminLoginRequest": { - "type": "object", - "properties": { - "password": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "domain.AdminLoginResponse": { - "type": "object", - "properties": { - "admin_user": { - "$ref": "#/definitions/domain.AdminUserInfo" - }, - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Permission" - } - }, - "tokens": { - "$ref": "#/definitions/domain.TokenPair" - } - } - }, - "domain.AdminUserInfo": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "first_name": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "type": "string" - }, - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Permission" - } - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Role" - } - }, - "status": { - "$ref": "#/definitions/domain.Status" - }, - "updated_at": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "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": { - "first_name": { - "type": "string" - }, - "last_name": { - "type": "string" - }, - "password": { - "type": "string" - }, - "permissions": { - "type": "array", - "items": { - "type": "integer" - } - }, - "roles": { - "type": "array", - "items": { - "type": "integer" - } - }, - "status": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "domain.CreateCategoryResponse": { - "type": "object", - "properties": { - "category": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory" - } - } - }, - "domain.CreatePermissionRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "domain.CreatePermissionResponse": { - "type": "object", - "properties": { - "permission": { - "$ref": "#/definitions/domain.Permission" - } - } - }, - "domain.CreateProductOptionResponse": { - "type": "object", - "properties": { - "product_option": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" - } - } - }, - "domain.CreateProductResponse": { - "type": "object", - "properties": { - "product": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" - } - } - }, - "domain.CreateProductVariantResponse": { - "type": "object", - "properties": { - "variant": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" - } - } - }, - "domain.CreateRoleRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "domain.DeleteCategoryResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "domain.DeleteFileResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "domain.DeletePermissionResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "domain.DeleteProductOptionResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "domain.DeleteProductResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "domain.DeleteProductVariantResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "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": { + "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", - "enum": [ - "image", - "video" - ], - "x-enum-varnames": [ - "FileTypeImage", - "FileTypeVideo" - ] - }, - "domain.GetAllCategoriesResponse": { - "type": "object", - "properties": { - "categories": { - "type": "array", - "items": { - "$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": { - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Permission" - } - } - } - }, - "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/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": { - "permission": { - "$ref": "#/definitions/domain.Permission" - } - } - }, - "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/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" - } - } - }, - "domain.GetProductVariantsByProductIDResponse": { - "type": "object", - "properties": { - "variants": { - "type": "array", - "items": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" - } - } - } - }, - "domain.GetProductsByCategoryResponse": { - "type": "object", - "properties": { - "products": { - "type": "array", - "items": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" - } - } - } - }, - "domain.GetProductsWithFiltersResponse": { - "type": "object", - "properties": { - "products": { - "type": "array", - "items": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" - } - } - } - }, - "domain.GetRecommendedProductsResponse": { - "type": "object", - "properties": { - "recommended_products": { - "type": "array", - "items": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" - } - } - } - }, - "domain.LoginOrRegisterRequest": { - "type": "object", - "properties": { - "otp_code": { - "type": "string" - }, - "phone_number": { - "type": "string" - } - } - }, - "domain.LoginOrRegisterResponse": { - "type": "object", - "properties": { - "tokens": { - "$ref": "#/definitions/domain.TokenPair" - }, - "user_info": { - "$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" - } - } - }, - "domain.Permission": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "title": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, - "domain.ProductVariantWithImages": { - "type": "object", - "properties": { - "attributes": { - "type": "object", - "additionalProperties": true - }, - "color": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "fee_percentage": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" - } - }, - "product_id": { - "type": "integer" - }, - "profit_percentage": { - "type": "integer" - }, - "size": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "weight": { - "type": "number" - } - } - }, - "domain.Role": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/domain.Permission" - } - }, - "title": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, - "domain.SendOTPRequest": { - "type": "object", - "properties": { - "phone_number": { - "type": "string" - } - } - }, - "domain.SendOTPResponse": { - "type": "object", - "properties": { - "remaining_time": { - "$ref": "#/definitions/time.Duration" - } - } - }, - "domain.Status": { - "type": "string", - "enum": [ - "active", - "deactive" - ], - "x-enum-varnames": [ - "StatusActive", - "StatusDeactive" - ] - }, - "domain.TokenPair": { - "type": "object", - "properties": { - "access_token": { - "type": "string" - }, - "refresh_token": { - "type": "string" - } - } - }, - "domain.UpdateAdminUserRequest": { - "type": "object", - "properties": { - "first_name": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "type": "string" - }, - "password": { - "type": "string" - }, - "permissions": { - "type": "array", - "items": { - "type": "integer" - } - }, - "roles": { - "type": "array", - "items": { - "type": "integer" - } - }, - "status": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "domain.UpdateCategoryResponse": { - "type": "object", - "properties": { - "category": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory" - } - } - }, - "domain.UpdateFileRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "domain.UpdateFileResponse": { - "type": "object", - "properties": { - "file": { - "$ref": "#/definitions/domain.FileInfo" - } - } - }, - "domain.UpdatePermissionRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "domain.UpdatePermissionResponse": { - "type": "object", - "properties": { - "permission": { - "$ref": "#/definitions/domain.Permission" - } - } - }, - "domain.UpdateProductOptionResponse": { - "type": "object", - "properties": { - "product_option": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" - } - } - }, - "domain.UpdateProductResponse": { - "type": "object", - "properties": { - "product": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" - } - } - }, - "domain.UpdateProductVariantResponse": { - "type": "object", - "properties": { - "variant": { - "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" - } - } - }, - "domain.UpdateRoleRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "permissions": { - "type": "array", - "items": { - "type": "integer" - } - }, - "title": { - "type": "string" - } - } - }, - "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": { - "type": "string" - }, - "email": { - "type": "string" - }, - "first_name": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_name": { - "type": "string" - }, - "national_code": { - "type": "string" - }, - "phone_number": { - "type": "string" - }, - "verified": { - "type": "boolean" - } - } - }, - "http.AssignImagesToProductRequest": { - "type": "object", - "properties": { - "image_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "http.AssignImagesToProductResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "http.AssignImagesToVariantRequest": { - "type": "object", - "properties": { - "image_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "http.AssignImagesToVariantResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "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": { + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { "type": "integer", - "enum": [ - -9223372036854775808, - 9223372036854775807, - 1, - 1000, - 1000000, - 1000000000, - 60000000000, - 3600000000000 - ], - "x-enum-varnames": [ - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour" - ] + "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" + } + } + } + } }, - "securityDefinitions": { - "AdminAuth": { - "description": "Type \"Bearer\" followed by a space and JWT token for admin access.", - "type": "apiKey", + "/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" - }, - "BearerAuth": { - "description": "Type \"Bearer\" followed by a space and JWT token.", - "type": "apiKey", - "name": "Authorization", - "in": "header" + "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", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin-auth"], + "summary": "Admin login", + "parameters": [ + { + "description": "Admin login payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.AdminLoginRequest" + } + } + ], + "responses": { + "200": { + "description": "Login successful with tokens and permissions", + "schema": { + "$ref": "#/definitions/domain.AdminLoginResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "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/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": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves all permissions from the system", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Get all permissions", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "List of permissions", + "schema": { + "$ref": "#/definitions/domain.GetAllPermissionsResponse" + } + }, + "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 permission in the system", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Create permission", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "Permission information", + "name": "permission", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.CreatePermissionRequest" + } + } + ], + "responses": { + "201": { + "description": "Permission created successfully", + "schema": { + "$ref": "#/definitions/domain.CreatePermissionResponse" + } + }, + "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/permissions/{id}": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves a specific permission by its ID", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Get permission by ID", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Permission ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Permission found", + "schema": { + "$ref": "#/definitions/domain.GetPermissionByIDResponse" + } + }, + "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": "Permission 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 existing permission", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Update permission", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Permission ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Updated permission information", + "name": "permission", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.UpdatePermissionRequest" + } + } + ], + "responses": { + "200": { + "description": "Permission updated successfully", + "schema": { + "$ref": "#/definitions/domain.UpdatePermissionResponse" + } + }, + "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": "Permission 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 a permission from the system", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Delete permission", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Permission ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Permission deleted successfully", + "schema": { + "$ref": "#/definitions/domain.DeletePermissionResponse" + } + }, + "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": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves all roles from the system", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Get all roles", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "List of roles", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Role" + } + } + }, + "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 role in the system", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Create role", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "Role information", + "name": "role", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.CreateRoleRequest" + } + } + ], + "responses": { + "201": { + "description": "Role created successfully", + "schema": { + "$ref": "#/definitions/domain.Role" + } + }, + "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/roles/{id}": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves a specific role by its ID", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Get role by ID", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Role ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Role found", + "schema": { + "$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" + } + }, + "404": { + "description": "Role 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 existing role", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Update role", + "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": "Updated role information", + "name": "role", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.UpdateRoleRequest" + } + } + ], + "responses": { + "200": { + "description": "Role updated successfully", + "schema": { + "$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" + } + }, + "404": { + "description": "Role 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 a role from the system", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Delete role", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Role ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Role 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" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_admin_delivery_http.ErrorResponse" + } + } + } + } + }, + "/api/v1/admin/roles/{id}/permissions": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Retrieves all permissions assigned to a role", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Get role permissions", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Role 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" + } + } + } + }, + "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}": { + "post": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "Assigns a permission to a role", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Assign permission to role", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Role 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 a role", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["admin"], + "summary": "Remove permission from role", + "parameters": [ + { + "type": "string", + "description": "Bearer \u003ctoken\u003e", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "Role 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/auth/otp/send": { + "post": { + "description": "Sends an OTP code to the provided phone number for authentication", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["auth"], + "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": "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 images to return (default: 10)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Number of images to skip (default: 0)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetAllImagesResponse" + } + }, + "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" + } + } + } + }, + "post": { + "description": "Creates a new image", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["images"], + "summary": "Create a new image", + "parameters": [ + { + "description": "Image creation payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/http.CreateImageRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_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/product-options": { + "get": { + "description": "Retrieves a paginated list of all product options", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["product-options"], + "summary": "Get all product options", + "parameters": [ + { + "type": "integer", + "description": "Number of product options to return (default: 10)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Number of product options to skip (default: 0)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetAllProductOptionsResponse" + } + }, + "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/product-options/{id}": { + "get": { + "description": "Retrieves a specific product option by its ID", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["product-options"], + "summary": "Get product option by ID", + "parameters": [ + { + "type": "integer", + "description": "Product Option ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetProductOptionByIDResponse" + } + }, + "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" + } + } + } + }, + "delete": { + "description": "Deletes a product option by its ID", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["product-options"], + "summary": "Delete a product option", + "parameters": [ + { + "type": "integer", + "description": "Product Option ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.DeleteProductOptionResponse" + } + }, + "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": { + "get": { + "description": "Retrieves a paginated list of all products", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["products"], + "summary": "Get all products", + "parameters": [ + { + "type": "integer", + "description": "Number of products to return (default: 10)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Number of products to skip (default: 0)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetAllProductsResponse" + } + }, + "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" + } + } + } + }, + "post": { + "description": "Creates a new product with the provided information", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["products"], + "summary": "Create a new product", + "parameters": [ + { + "description": "Product creation payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/http.CreateProductRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.CreateProductResponse" + } + }, + "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/categories": { + "get": { + "description": "Retrieves all product categories", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["categories"], + "summary": "Get all product categories", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetAllCategoriesResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_delivery_http.ErrorResponse" + } + } + } + }, + "post": { + "description": "Creates a new product category", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["categories"], + "summary": "Create a new product category", + "parameters": [ + { + "description": "Category creation payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.CreateCategoryRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.CreateCategoryResponse" + } + }, + "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/categories/{categoryId}": { + "put": { + "description": "Updates an existing product category", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["categories"], + "summary": "Update product category", + "parameters": [ + { + "type": "string", + "description": "Category ID", + "name": "categoryId", + "in": "path", + "required": true + }, + { + "description": "Category update payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateCategoryRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.UpdateCategoryResponse" + } + }, + "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" + } + } + } + }, + "delete": { + "description": "Deletes a product category by its ID", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["categories"], + "summary": "Delete product category", + "parameters": [ + { + "type": "string", + "description": "Category ID", + "name": "categoryId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.DeleteCategoryResponse" + } + }, + "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/category/{categoryId}": { + "get": { + "description": "Retrieves products filtered by category ID", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["products"], + "summary": "Get products by category", + "parameters": [ + { + "type": "string", + "description": "Category ID", + "name": "categoryId", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Number of products to return (default: 10)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Number of products to skip (default: 0)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetProductsByCategoryResponse" + } + }, + "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/filter": { + "get": { + "description": "Retrieves products with optional filters for type, category, search, and weight range", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["products"], + "summary": "Get products with filters", + "parameters": [ + { + "type": "integer", + "description": "Product type filter", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "Category ID filter", + "name": "categoryId", + "in": "query" + }, + { + "type": "string", + "description": "Text search in name and description", + "name": "search", + "in": "query" + }, + { + "type": "number", + "description": "Minimum weight filter", + "name": "minWeight", + "in": "query" + }, + { + "type": "number", + "description": "Maximum weight filter", + "name": "maxWeight", + "in": "query" + }, + { + "type": "integer", + "description": "Number of products to return (default: 10)", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Number of products to skip (default: 0)", + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetProductsWithFiltersResponse" + } + }, + "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/images/{imageId}": { + "put": { + "description": "Updates an existing image", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["images"], + "summary": "Update image", + "parameters": [ + { + "type": "string", + "description": "Image ID", + "name": "imageId", + "in": "path", + "required": true + }, + { + "description": "Image update payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/http.UpdateImageRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" + } + }, + "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" + } + } + } + }, + "delete": { + "description": "Deletes an existing image", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["images"], + "summary": "Delete image", + "parameters": [ + { + "type": "string", + "description": "Image ID", + "name": "imageId", + "in": "path", + "required": true + } + ], + "responses": { + "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/product-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/product-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", + "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/variants/{variantId}": { + "put": { + "description": "Updates an existing product variant", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["variants"], + "summary": "Update product variant", + "parameters": [ + { + "type": "string", + "description": "Variant ID", + "name": "variantId", + "in": "path", + "required": true + }, + { + "description": "Variant update payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.UpdateProductVariantRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.UpdateProductVariantResponse" + } + }, + "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" + } + } + } + }, + "delete": { + "description": "Deletes a product variant by its ID", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["variants"], + "summary": "Delete product variant", + "parameters": [ + { + "type": "string", + "description": "Variant ID", + "name": "variantId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.DeleteProductVariantResponse" + } + }, + "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/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", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["products"], + "summary": "Get product by ID", + "parameters": [ + { + "type": "string", + "description": "Product ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetProductByIDResponse" + } + }, + "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" + } + } + } + }, + "put": { + "description": "Updates an existing product with the provided information", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["products"], + "summary": "Update product", + "parameters": [ + { + "type": "integer", + "description": "Product ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Product update payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/http.UpdateProductRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.UpdateProductResponse" + } + }, + "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" + } + } + } + }, + "delete": { + "description": "Deletes a product by its ID", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["products"], + "summary": "Delete product", + "parameters": [ + { + "type": "string", + "description": "Product ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.DeleteProductResponse" + } + }, + "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/{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", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["images"], + "summary": "Get product images", + "parameters": [ + { + "type": "string", + "description": "Product ID", + "name": "productId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_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": { + "get": { + "description": "Retrieves all variants for a specific product", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["variants"], + "summary": "Get product variants", + "parameters": [ + { + "type": "string", + "description": "Product ID", + "name": "productId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetProductVariantsByProductIDResponse" + } + }, + "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" + } + } + } + }, + "post": { + "description": "Creates a new product variant for a specific product", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["variants"], + "summary": "Create a new product variant", + "parameters": [ + { + "type": "string", + "description": "Product ID", + "name": "productId", + "in": "path", + "required": true + }, + { + "description": "Variant creation payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.CreateProductVariantRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/domain.CreateProductVariantResponse" + } + }, + "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/users/login": { + "post": { + "description": "Authenticates user with OTP or creates new account", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["auth"], + "summary": "Login or register user", + "parameters": [ + { + "description": "Login/Register payload", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.LoginOrRegisterRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.LoginOrRegisterResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_user_delivery_http.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } } -} \ No newline at end of file + }, + "definitions": { + "domain.AdminLoginRequest": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "domain.AdminLoginResponse": { + "type": "object", + "properties": { + "admin_user": { + "$ref": "#/definitions/domain.AdminUserInfo" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Permission" + } + }, + "tokens": { + "$ref": "#/definitions/domain.TokenPair" + } + } + }, + "domain.AdminUserInfo": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Permission" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Role" + } + }, + "status": { + "$ref": "#/definitions/domain.Status" + }, + "updated_at": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "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": { + "first_name": { + "type": "string" + }, + "last_name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "roles": { + "type": "array", + "items": { + "type": "integer" + } + }, + "status": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "domain.CreateCategoryResponse": { + "type": "object", + "properties": { + "category": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory" + } + } + }, + "domain.CreatePermissionRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "domain.CreatePermissionResponse": { + "type": "object", + "properties": { + "permission": { + "$ref": "#/definitions/domain.Permission" + } + } + }, + "domain.CreateProductOptionResponse": { + "type": "object", + "properties": { + "product_option": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" + } + } + }, + "domain.CreateProductResponse": { + "type": "object", + "properties": { + "product": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" + } + } + }, + "domain.CreateProductVariantResponse": { + "type": "object", + "properties": { + "variant": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" + } + } + }, + "domain.CreateRoleRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "domain.DeleteCategoryResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "domain.DeleteFileResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "domain.DeletePermissionResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "domain.DeleteProductOptionResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "domain.DeleteProductResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "domain.DeleteProductVariantResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "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/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": { + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Permission" + } + } + } + }, + "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/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": { + "permission": { + "$ref": "#/definitions/domain.Permission" + } + } + }, + "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/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" + } + } + }, + "domain.GetProductVariantsByProductIDResponse": { + "type": "object", + "properties": { + "variants": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" + } + } + } + }, + "domain.GetProductsByCategoryResponse": { + "type": "object", + "properties": { + "products": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" + } + } + } + }, + "domain.GetProductsWithFiltersResponse": { + "type": "object", + "properties": { + "products": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" + } + } + } + }, + "domain.GetRecommendedProductsResponse": { + "type": "object", + "properties": { + "recommended_products": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" + } + } + } + }, + "domain.LoginOrRegisterRequest": { + "type": "object", + "properties": { + "otp_code": { + "type": "string" + }, + "phone_number": { + "type": "string" + } + } + }, + "domain.LoginOrRegisterResponse": { + "type": "object", + "properties": { + "tokens": { + "$ref": "#/definitions/domain.TokenPair" + }, + "user_info": { + "$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" + } + } + }, + "domain.Permission": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "domain.ProductVariantWithImages": { + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": true + }, + "color": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "fee_percentage": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Image" + } + }, + "product_id": { + "type": "integer" + }, + "profit_percentage": { + "type": "integer" + }, + "size": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "weight": { + "type": "number" + } + } + }, + "domain.Role": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Permission" + } + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "domain.SendOTPRequest": { + "type": "object", + "properties": { + "phone_number": { + "type": "string" + } + } + }, + "domain.SendOTPResponse": { + "type": "object", + "properties": { + "remaining_time": { + "$ref": "#/definitions/time.Duration" + } + } + }, + "domain.Status": { + "type": "string", + "enum": ["active", "deactive"], + "x-enum-varnames": ["StatusActive", "StatusDeactive"] + }, + "domain.TokenPair": { + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "refresh_token": { + "type": "string" + } + } + }, + "domain.UpdateAdminUserRequest": { + "type": "object", + "properties": { + "first_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "roles": { + "type": "array", + "items": { + "type": "integer" + } + }, + "status": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "domain.UpdateCategoryResponse": { + "type": "object", + "properties": { + "category": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductCategory" + } + } + }, + "domain.UpdateFileRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "domain.UpdateFileResponse": { + "type": "object", + "properties": { + "file": { + "$ref": "#/definitions/domain.FileInfo" + } + } + }, + "domain.UpdatePermissionRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "title": { + "type": "string" + } + } + }, + "domain.UpdatePermissionResponse": { + "type": "object", + "properties": { + "permission": { + "$ref": "#/definitions/domain.Permission" + } + } + }, + "domain.UpdateProductOptionResponse": { + "type": "object", + "properties": { + "product_option": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductOption" + } + } + }, + "domain.UpdateProductResponse": { + "type": "object", + "properties": { + "product": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.Product" + } + } + }, + "domain.UpdateProductVariantResponse": { + "type": "object", + "properties": { + "variant": { + "$ref": "#/definitions/gitlab_com_mazane_beehive_mazane_application_product_domain.ProductVariant" + } + } + }, + "domain.UpdateRoleRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "permissions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "title": { + "type": "string" + } + } + }, + "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": { + "type": "string" + }, + "email": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "type": "string" + }, + "national_code": { + "type": "string" + }, + "phone_number": { + "type": "string" + }, + "verified": { + "type": "boolean" + } + } + }, + "http.AssignImagesToProductRequest": { + "type": "object", + "properties": { + "image_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "http.AssignImagesToProductResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "http.AssignImagesToVariantRequest": { + "type": "object", + "properties": { + "image_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "http.AssignImagesToVariantResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "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": [ + -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, + 60000000000, 3600000000000 + ], + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "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" + } + } +}