{
    "openapi": "3.0.0",
    "info": {
        "title": "Hooshi Application API",
        "description": "API documentation for Hooshi Mobile Application",
        "contact": {
            "email": "support@hooshi.com"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "http://localhost/api",
            "description": "API Server"
        }
    ],
    "paths": {
        "/api/auth/login": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Login with email and password",
                "operationId": "dd51a484b7fa0f97c7680fdbde14cf5f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "password"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "password"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Login successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Login successful"
                                        },
                                        "data": {
                                            "properties": {
                                                "access_token": {
                                                    "type": "string"
                                                },
                                                "user": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid credentials"
                    }
                }
            }
        },
        "/api/auth/send-otp": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Send OTP code",
                "operationId": "bffceebe22269794653d542fb5e548dd",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email_or_phone",
                                    "type"
                                ],
                                "properties": {
                                    "email_or_phone": {
                                        "type": "string",
                                        "example": "user@example.com"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "register",
                                            "login",
                                            "reset_password"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OTP sent"
                    },
                    "404": {
                        "description": "User not found"
                    }
                }
            }
        },
        "/api/auth/verify-otp": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Verify OTP code",
                "operationId": "abcb5741589707b15c7ecac7a67c13aa",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email_or_phone",
                                    "code",
                                    "type"
                                ],
                                "properties": {
                                    "email_or_phone": {
                                        "type": "string",
                                        "example": "user@example.com"
                                    },
                                    "code": {
                                        "type": "string",
                                        "example": "123456"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "register",
                                            "login",
                                            "reset_password"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OTP Verified",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "access_token": {
                                                    "type": "string"
                                                },
                                                "user": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid OTP"
                    }
                }
            }
        },
        "/api/badges": {
            "get": {
                "tags": [
                    "Gamification"
                ],
                "summary": "List all badges",
                "description": "Lists badges and indicates if the current user has unlocked them (if logged in)",
                "operationId": "fabc4ce47a2d6dbb9bd8976d0b9a7cd8",
                "responses": {
                    "200": {
                        "description": "List of badges",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/categories": {
            "get": {
                "tags": [
                    "Content"
                ],
                "summary": "List all categories",
                "operationId": "ac9c4d978ea4e5b72915ca9728e5b8b1",
                "responses": {
                    "200": {
                        "description": "List of categories",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name_fa": {
                                                        "type": "string"
                                                    },
                                                    "name_en": {
                                                        "type": "string"
                                                    },
                                                    "slug": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/contents": {
            "get": {
                "tags": [
                    "Content"
                ],
                "summary": "List contents",
                "operationId": "efebe5ed27531dbc024d90288cbc5d36",
                "parameters": [
                    {
                        "name": "category_id",
                        "in": "query",
                        "description": "Filter by category ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "is_premium",
                        "in": "query",
                        "description": "Filter by premium status (0 or 1)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated list of contents",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        },
                                        "links": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/contents/{id}": {
            "get": {
                "tags": [
                    "Content"
                ],
                "summary": "Get content details",
                "operationId": "9a28cd13c41d46d67221ea62708f68b1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Content ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Content details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Content not found"
                    }
                }
            }
        },
        "/api/packages": {
            "get": {
                "tags": [
                    "Commerce"
                ],
                "summary": "List subscription packages",
                "operationId": "2d2d4df67a3ce58700702ed1c7827acd",
                "responses": {
                    "200": {
                        "description": "List of packages",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/health": {
            "get": {
                "tags": [
                    "System"
                ],
                "summary": "Health check",
                "operationId": "4f680121748a58b1aefd0799258b9aec",
                "responses": {
                    "200": {
                        "description": "System is healthy"
                    }
                }
            }
        },
        "/api/support/tickets": {
            "get": {
                "tags": [
                    "Support"
                ],
                "summary": "List my support tickets",
                "operationId": "f5ea7e0b535276c150c200b406cbf228",
                "responses": {
                    "200": {
                        "description": "List of tickets",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Support"
                ],
                "summary": "Create new ticket",
                "operationId": "f7f9f49cc16ae99f01f58ec177b2c728",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "subject",
                                    "category",
                                    "message"
                                ],
                                "properties": {
                                    "subject": {
                                        "type": "string"
                                    },
                                    "category": {
                                        "type": "string"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "enum": [
                                            "low",
                                            "medium",
                                            "high"
                                        ]
                                    },
                                    "message": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Ticket created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/support/tickets/{id}": {
            "get": {
                "tags": [
                    "Support"
                ],
                "summary": "Get ticket details and messages",
                "operationId": "35e3ce390bfbb35ea5918fd95a469b5d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ticket details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/support/tickets/{id}/reply": {
            "post": {
                "tags": [
                    "Support"
                ],
                "summary": "Reply to a ticket",
                "operationId": "a7f41125a489454e8c7e93313e7afa18",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "message"
                                ],
                                "properties": {
                                    "message": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Message sent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/user/profile": {
            "get": {
                "tags": [
                    "User Profile"
                ],
                "summary": "Get user profile",
                "operationId": "695a5ba8ff7a490aad2bed007b5499f9",
                "responses": {
                    "200": {
                        "description": "Profile data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/user/profile/update": {
            "put": {
                "tags": [
                    "User Profile"
                ],
                "summary": "Update user profile",
                "operationId": "3d7587cfe74216884c93c6246fa9067a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "full_name": {
                                        "type": "string"
                                    },
                                    "phone": {
                                        "type": "string"
                                    },
                                    "avatar": {
                                        "type": "string"
                                    },
                                    "password": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Profile updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "description": "Enter your bearer token in the format **Bearer <token>**",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Authentication",
            "description": "Authentication"
        },
        {
            "name": "Gamification",
            "description": "Gamification"
        },
        {
            "name": "Content",
            "description": "Content"
        },
        {
            "name": "Commerce",
            "description": "Commerce"
        },
        {
            "name": "System",
            "description": "System"
        },
        {
            "name": "Support",
            "description": "Support"
        },
        {
            "name": "User Profile",
            "description": "User Profile"
        }
    ]
}