{
    "openapi": "3.0.0",
    "info": {
        "title": "Expense Tracker API",
        "description": "RESTful API for managing personal expenses, tracking spending by categories, and monitoring monthly budgets.",
        "contact": {
            "email": "support@expensetracker.com"
        },
        "license": {
            "name": "MIT",
            "url": "https://opensource.org/licenses/MIT"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "http://localhost:8000/api",
            "description": "Local Development Server"
        },
        {
            "url": "https://api.expensetracker.com/api",
            "description": "Production Server"
        }
    ],
    "paths": {
        "/auth/register": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Register a new user",
                "operationId": "08136088c4862c313b35d6518bab8d3a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email",
                                    "password",
                                    "password_confirmation"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "John Doe"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "john@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "SecurePass123!"
                                    },
                                    "password_confirmation": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "SecurePass123!"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "User registered successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Registration successful"
                                        },
                                        "data": {
                                            "properties": {
                                                "user": {
                                                    "$ref": "#/components/schemas/User"
                                                },
                                                "token": {
                                                    "type": "string",
                                                    "example": "1|sanctum_token_string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            }
        },
        "/auth/login": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Login user",
                "operationId": "99d66635c4992aeaa6aa44ff653d0563",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "password"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "john@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "SecurePass123!"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Login successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "user": {
                                                    "$ref": "#/components/schemas/User"
                                                },
                                                "token": {
                                                    "type": "string",
                                                    "example": "1|sanctum_token_string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Invalid credentials"
                    }
                }
            }
        },
        "/auth/logout": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Logout user",
                "operationId": "6abf3b64a4bc7838d56346f05a5153af",
                "responses": {
                    "200": {
                        "description": "Logout successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Logout successful"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/auth/user": {
            "get": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Get authenticated user",
                "operationId": "32d03117b496ae02c2543b61438d24ad",
                "responses": {
                    "200": {
                        "description": "User details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "user": {
                                                    "$ref": "#/components/schemas/User"
                                                },
                                                "roles": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "permissions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/categories": {
            "get": {
                "tags": [
                    "Categories"
                ],
                "summary": "Get all categories",
                "description": "Retrieve all categories (default + user's custom categories)",
                "operationId": "ac9c4d978ea4e5b72915ca9728e5b8b1",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Category"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Categories"
                ],
                "summary": "Create new category",
                "description": "Create a new custom category",
                "operationId": "cca49a87d9b0ebb9a98ad7c154b71737",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "icon",
                                    "color"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Entertainment"
                                    },
                                    "icon": {
                                        "type": "string",
                                        "example": "🎬"
                                    },
                                    "color": {
                                        "type": "string",
                                        "example": "#907B60"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Category created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category created successfully"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Category"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/categories/{id}": {
            "get": {
                "tags": [
                    "Categories"
                ],
                "summary": "Get category by ID",
                "description": "Retrieve a specific category",
                "operationId": "09767bb2e47dde77dd1e2591428b0ae1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Category"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Categories"
                ],
                "summary": "Update category",
                "description": "Update a custom category (cannot update default categories)",
                "operationId": "7dcf71887e585de7f881e9eb98d86126",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "icon",
                                    "color"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Movies"
                                    },
                                    "icon": {
                                        "type": "string",
                                        "example": "🎥"
                                    },
                                    "color": {
                                        "type": "string",
                                        "example": "#C1B6AE"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Category updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category updated successfully"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Category"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Cannot update default category"
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Categories"
                ],
                "summary": "Delete category",
                "description": "Delete a custom category (cannot delete default categories or categories with expenses)",
                "operationId": "9b61b65823f4a21f182506b34ddf805c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Category deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Cannot delete default category"
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "409": {
                        "description": "Category has expenses"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/dashboard/overview": {
            "get": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Get dashboard overview",
                "description": "Get comprehensive dashboard overview including income, expenses, balance, and category breakdown",
                "operationId": "aa916ea9a152b88ff8d02de260dd3390",
                "parameters": [
                    {
                        "name": "month",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "Y-m",
                            "example": "2025-12"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "month": {
                                                    "type": "string",
                                                    "example": "2025-12"
                                                },
                                                "monthly_income": {
                                                    "type": "string",
                                                    "example": "5000.00"
                                                },
                                                "total_expenses": {
                                                    "type": "string",
                                                    "example": "1500.00"
                                                },
                                                "remaining_balance": {
                                                    "type": "string",
                                                    "example": "3500.00"
                                                },
                                                "spending_percentage": {
                                                    "type": "number",
                                                    "example": 30
                                                },
                                                "top_category": {
                                                    "type": "object"
                                                },
                                                "expense_by_category": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "daily_expenses": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/dashboard/trends": {
            "get": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Get spending trends",
                "description": "Get spending trends over time (monthly, weekly, or yearly)",
                "operationId": "7fc53b369409f5829bf955deb5b640f0",
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "default": "monthly",
                            "enum": [
                                "monthly",
                                "weekly",
                                "yearly"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 6,
                            "maximum": 12,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "period": {
                                                    "type": "string",
                                                    "example": "monthly"
                                                },
                                                "trends": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "period": {
                                                                "type": "string",
                                                                "example": "2025-12"
                                                            },
                                                            "total_expenses": {
                                                                "type": "string",
                                                                "example": "1500.00"
                                                            },
                                                            "total_income": {
                                                                "type": "string",
                                                                "example": "5000.00"
                                                            },
                                                            "savings": {
                                                                "type": "string",
                                                                "example": "3500.00"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/dashboard/category-breakdown": {
            "get": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Get category breakdown",
                "description": "Get expenses breakdown by category for a specific month",
                "operationId": "bc838e40abce42f750a571f92f3394d3",
                "parameters": [
                    {
                        "name": "month",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "Y-m",
                            "example": "2025-12"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "categories": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "name": {
                                                                "type": "object",
                                                                "example": {
                                                                    "en": "Food",
                                                                    "ar": "طعام"
                                                                }
                                                            },
                                                            "amount": {
                                                                "type": "string",
                                                                "example": "500.00"
                                                            },
                                                            "percentage": {
                                                                "type": "number",
                                                                "example": 33.33
                                                            },
                                                            "color": {
                                                                "type": "string",
                                                                "example": "#907B60"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "total": {
                                                    "type": "string",
                                                    "example": "1500.00"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/expenses": {
            "get": {
                "tags": [
                    "Expenses"
                ],
                "summary": "Get all expenses",
                "description": "Retrieve expenses with filtering, search, and pagination",
                "operationId": "8bcf0194356bbaeef047c66188f65944",
                "parameters": [
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "date",
                                "amount"
                            ]
                        }
                    },
                    {
                        "name": "sort_order",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 20
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "expenses": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Expense"
                                                    }
                                                },
                                                "pagination": {
                                                    "properties": {
                                                        "current_page": {
                                                            "type": "integer"
                                                        },
                                                        "total_pages": {
                                                            "type": "integer"
                                                        },
                                                        "total_expenses": {
                                                            "type": "integer"
                                                        },
                                                        "per_page": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Expenses"
                ],
                "summary": "Create new expense",
                "description": "Create a new expense record",
                "operationId": "3ea1b5dbe09af5276ecb56173ce789bb",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "category_id",
                                    "amount",
                                    "date"
                                ],
                                "properties": {
                                    "category_id": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "amount": {
                                        "type": "string",
                                        "example": "150.00"
                                    },
                                    "date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2025-12-15"
                                    },
                                    "note": {
                                        "type": "string",
                                        "example": "Grocery shopping"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Expense created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Expense created successfully"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Expense"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/expenses/{id}": {
            "get": {
                "tags": [
                    "Expenses"
                ],
                "summary": "Get expense by ID",
                "description": "Retrieve a specific expense record",
                "operationId": "64b051c55aa8ec7bc35dbdbeec5a1358",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Expense"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Expenses"
                ],
                "summary": "Update expense",
                "description": "Update an existing expense record",
                "operationId": "ecf2e2616f2c4533434160953c6a2042",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "category_id",
                                    "amount",
                                    "date"
                                ],
                                "properties": {
                                    "category_id": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "amount": {
                                        "type": "string",
                                        "example": "175.00"
                                    },
                                    "date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2025-12-15"
                                    },
                                    "note": {
                                        "type": "string",
                                        "example": "Updated note"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Expense updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Expense updated successfully"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Expense"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Expenses"
                ],
                "summary": "Delete expense",
                "description": "Delete an expense record (soft delete)",
                "operationId": "ec5dfb519e7d7779406d070d83c90e92",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Expense deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Expense deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/expenses/summary": {
            "get": {
                "tags": [
                    "Expenses"
                ],
                "summary": "Get expense summary",
                "description": "Get total expenses and category breakdown for a specific month",
                "operationId": "b6033a168c54cd63b303c0f8a776456f",
                "parameters": [
                    {
                        "name": "month",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "Y-m",
                            "example": "2025-12"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "month": {
                                                    "type": "string",
                                                    "example": "2025-12"
                                                },
                                                "total_expenses": {
                                                    "type": "string",
                                                    "example": "1500.00"
                                                },
                                                "categories": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/export/csv": {
            "get": {
                "tags": [
                    "Export"
                ],
                "summary": "Export expenses as CSV",
                "description": "Export expenses to CSV file with optional filtering",
                "operationId": "73ccc94327e26895b2764bdb52bbb14c",
                "parameters": [
                    {
                        "name": "date_from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "CSV file",
                        "content": {
                            "text/csv": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/export/pdf": {
            "get": {
                "tags": [
                    "Export"
                ],
                "summary": "Export expenses as PDF",
                "description": "Export expenses to PDF file (not yet implemented)",
                "operationId": "147a73d571fcf177ca26870d6cef005d",
                "parameters": [
                    {
                        "name": "date_from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "501": {
                        "description": "Not implemented",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/export/excel": {
            "get": {
                "tags": [
                    "Export"
                ],
                "summary": "Export expenses as Excel",
                "description": "Export expenses to Excel file (not yet implemented)",
                "operationId": "fbace95b36d3b6f041049ba0a1083ced",
                "parameters": [
                    {
                        "name": "date_from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "501": {
                        "description": "Not implemented",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/export/history": {
            "get": {
                "tags": [
                    "Export"
                ],
                "summary": "Get export history",
                "description": "Retrieve user's export history with pagination",
                "operationId": "90e2795974e4aed407240e8495401556",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "export_format": {
                                                        "type": "string",
                                                        "example": "csv"
                                                    },
                                                    "date_from": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "date_to": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "record_count": {
                                                        "type": "integer",
                                                        "example": 50
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "pagination": {
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "total_pages": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/income": {
            "get": {
                "tags": [
                    "Income"
                ],
                "summary": "Get income history",
                "description": "Retrieve all income records for the authenticated user",
                "operationId": "a9f186b92f0bc0bede0bc54ceaa7949d",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Income"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Income"
                ],
                "summary": "Create new income",
                "description": "Create a new income record",
                "operationId": "0137ebf118981cd104e17b56f1cbf3c9",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "monthly_amount",
                                    "effective_from"
                                ],
                                "properties": {
                                    "monthly_amount": {
                                        "type": "string",
                                        "example": "5000.00"
                                    },
                                    "effective_from": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2025-12-01"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Income created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Income created successfully"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Income"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/income/current": {
            "get": {
                "tags": [
                    "Income"
                ],
                "summary": "Get current income",
                "description": "Retrieve the currently active income record",
                "operationId": "3932efd22ffd7e8befbff3424a504339",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Income"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No income record found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/income/{id}": {
            "get": {
                "tags": [
                    "Income"
                ],
                "summary": "Get income by ID",
                "description": "Retrieve a specific income record",
                "operationId": "e91a2efbadd9ba0f1fbcb56a3586bd21",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Income"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Income"
                ],
                "summary": "Update income",
                "description": "Update an existing income record",
                "operationId": "cc9c37fccbb161352deffef1c7e0e7c2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "monthly_amount",
                                    "effective_from"
                                ],
                                "properties": {
                                    "monthly_amount": {
                                        "type": "string",
                                        "example": "5500.00"
                                    },
                                    "effective_from": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2025-12-01"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Income updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Income updated successfully"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Income"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Income"
                ],
                "summary": "Delete income",
                "description": "Delete an income record",
                "operationId": "b726c1aab61cc514db81d21cc899e072",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Income deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Income deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/settings": {
            "get": {
                "tags": [
                    "Settings"
                ],
                "summary": "Get settings",
                "description": "Get user settings, profile information, and preferences",
                "operationId": "42d0b4246b20863060a17026148f8d92",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "user": {
                                                    "$ref": "#/components/schemas/User"
                                                },
                                                "current_income": {
                                                    "$ref": "#/components/schemas/Income"
                                                },
                                                "preferences": {
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string",
                                                            "example": "USD"
                                                        },
                                                        "date_format": {
                                                            "type": "string",
                                                            "example": "Y-m-d"
                                                        },
                                                        "first_day_of_week": {
                                                            "type": "string",
                                                            "example": "monday"
                                                        },
                                                        "language": {
                                                            "type": "string",
                                                            "example": "en"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/settings/profile": {
            "put": {
                "tags": [
                    "Settings"
                ],
                "summary": "Update profile",
                "description": "Update user profile information",
                "operationId": "5c870ad6f8c4860dba3ce742e450a4a8",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "John Doe"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "john@example.com"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Profile updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Profile updated successfully"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/settings/change-password": {
            "post": {
                "tags": [
                    "Settings"
                ],
                "summary": "Change password",
                "description": "Change user password (all tokens will be revoked)",
                "operationId": "01770ad97fc24bdee4be97277542f694",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "current_password",
                                    "new_password",
                                    "new_password_confirmation"
                                ],
                                "properties": {
                                    "current_password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "oldpassword123"
                                    },
                                    "new_password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "newpassword123"
                                    },
                                    "new_password_confirmation": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "newpassword123"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Password changed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Password changed successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "Category": {
                "title": "Category",
                "required": [
                    "id",
                    "name"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "user_id": {
                        "type": "integer",
                        "example": null,
                        "nullable": true
                    },
                    "name": {
                        "type": "object",
                        "example": {
                            "en": "Food",
                            "ar": "طعام"
                        }
                    },
                    "icon": {
                        "type": "string",
                        "example": "🍔"
                    },
                    "color": {
                        "type": "string",
                        "example": "#907B60"
                    },
                    "is_default": {
                        "type": "boolean",
                        "example": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "Expense": {
                "title": "Expense",
                "required": [
                    "id",
                    "user_id",
                    "category_id",
                    "amount",
                    "date"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "user_id": {
                        "type": "integer",
                        "example": 1
                    },
                    "category_id": {
                        "type": "integer",
                        "example": 1
                    },
                    "amount": {
                        "type": "string",
                        "example": "150.00"
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "example": "2025-12-15"
                    },
                    "note": {
                        "type": "string",
                        "example": "Grocery shopping"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "deleted_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "Income": {
                "title": "Income",
                "required": [
                    "id",
                    "user_id",
                    "monthly_amount",
                    "effective_from"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "user_id": {
                        "type": "integer",
                        "example": 1
                    },
                    "monthly_amount": {
                        "type": "string",
                        "example": "5000.00"
                    },
                    "effective_from": {
                        "type": "string",
                        "format": "date",
                        "example": "2025-12-01"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "User": {
                "title": "User",
                "required": [
                    "id",
                    "name",
                    "email"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "name": {
                        "type": "string",
                        "example": "John Doe"
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "example": "john@example.com"
                    },
                    "email_verified_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "sanctum": {
                "type": "http",
                "description": "Enter your bearer token in the format: Bearer {token}",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Authentication",
            "description": "API Endpoints for user authentication"
        },
        {
            "name": "Income",
            "description": "API Endpoints for managing monthly income"
        },
        {
            "name": "Expenses",
            "description": "API Endpoints for managing expenses"
        },
        {
            "name": "Categories",
            "description": "API Endpoints for managing expense categories"
        },
        {
            "name": "Dashboard",
            "description": "API Endpoints for dashboard statistics and analytics"
        },
        {
            "name": "Export",
            "description": "API Endpoints for exporting data in various formats"
        },
        {
            "name": "Settings",
            "description": "API Endpoints for user settings and preferences"
        }
    ]
}