{
    "openapi": "3.0.0",
    "info": {
        "title": "FoodBox API",
        "description": "FoodBox boshqaruv tizimi REST API",
        "contact": {
            "name": "FoodBox Support",
            "email": "support@foodbox.uz"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "http://localhost:8090",
            "description": "Local development server"
        }
    ],
    "paths": {
        "/api/auth/login": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Login with username and password",
                "operationId": "dd51a484b7fa0f97c7680fdbde14cf5f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "username",
                                    "password"
                                ],
                                "properties": {
                                    "username": {
                                        "type": "string",
                                        "example": "admin"
                                    },
                                    "password": {
                                        "type": "string",
                                        "example": "admin123"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Login successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "token": {
                                            "type": "string",
                                            "example": "1|abc123..."
                                        },
                                        "user": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid username or password"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Account inactive",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Your account is inactive"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/login-pin": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Login with username and PIN code",
                "operationId": "507a8f9309d4b5af4e049e808c944b9e",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "username",
                                    "pincode"
                                ],
                                "properties": {
                                    "username": {
                                        "type": "string",
                                        "example": "granulator"
                                    },
                                    "pincode": {
                                        "type": "string",
                                        "example": "1234"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Login successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "token": {
                                            "type": "string",
                                            "example": "1|abc123..."
                                        },
                                        "user": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid PIN or username",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Noto'g'ri PIN kod"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Account inactive",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Your account is inactive"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/logout": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Logout (revoke token)",
                "operationId": "df9bdc6c7a6d9f20b983526b2ec0f698",
                "responses": {
                    "200": {
                        "description": "Logged out successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Logged out successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/auth/me": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Get authenticated user info",
                "operationId": "b5de204f5e452ef51327c691aa99e77c",
                "responses": {
                    "200": {
                        "description": "Authenticated user",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/health": {
            "get": {
                "tags": [
                    "Health"
                ],
                "summary": "Health check",
                "operationId": "c873d7f3d9f52c19cd7a1b4bebfe02df",
                "responses": {
                    "200": {
                        "description": "API is running",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "version": {
                                            "type": "string",
                                            "example": "1.0.0"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/products": {
            "get": {
                "tags": [
                    "Products"
                ],
                "summary": "Get all products",
                "operationId": "d97d1c3727cbac49708b85f7d11f7d58",
                "responses": {
                    "200": {
                        "description": "List of products",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Product"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/smena/current": {
            "get": {
                "tags": [
                    "Smena"
                ],
                "summary": "Check if there is an active (unclosed) smena",
                "operationId": "e7dd923a6a7f9ba3d8c02ca2bbe34e27",
                "responses": {
                    "200": {
                        "description": "Active smena found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "active": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "oneOf": [
                                                {
                                                    "$ref": "#/components/schemas/Smena"
                                                }
                                            ],
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/smena/open": {
            "post": {
                "tags": [
                    "Smena"
                ],
                "summary": "Open a new smena",
                "operationId": "84c72c18458c3b599df8e5d1a64eb45f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "user_id"
                                ],
                                "properties": {
                                    "user_id": {
                                        "description": "ID of the user opening the smena",
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Smena opened successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Smena"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "A smena is already open",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "There is already an active smena"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Smena"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/smena/{id}/close": {
            "post": {
                "tags": [
                    "Smena"
                ],
                "summary": "Close an active smena",
                "operationId": "8b50dd988fa8ba7d7d0110de4e252b16",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "user_id"
                                ],
                                "properties": {
                                    "user_id": {
                                        "description": "ID of the user closing the smena",
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Smena closed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Smena"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Smena is already closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "This smena is already closed"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/smena": {
            "get": {
                "tags": [
                    "Smena"
                ],
                "summary": "Get all smena list",
                "operationId": "d02b2fd4f676fe9a81f9c7fd33d3a8f5",
                "responses": {
                    "200": {
                        "description": "List of all smena",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Smena"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/users": {
            "get": {
                "tags": [
                    "Users"
                ],
                "summary": "Get all users",
                "operationId": "566aed8efb436ca506e0ef51a032ecd9",
                "responses": {
                    "200": {
                        "description": "List of users",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/User"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Users"
                ],
                "summary": "Create a user",
                "operationId": "be551c1d694a01c164966f58bfa77013",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UserCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "User created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/users/{id}": {
            "get": {
                "tags": [
                    "Users"
                ],
                "summary": "Get a user",
                "operationId": "6f51bd5fa2dddcd25e44cfa53dcbd10a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Users"
                ],
                "summary": "Update a user",
                "operationId": "070e37fc9aff78ae73860751bc990ed3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UserUpdateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "User updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Users"
                ],
                "summary": "Delete a user",
                "operationId": "0b4133ed462528a5e648b88ead11e929",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User deleted"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/roles": {
            "get": {
                "tags": [
                    "Users"
                ],
                "summary": "Get all roles",
                "operationId": "f48ce60eca4060f2597c20716ebe012e",
                "responses": {
                    "200": {
                        "description": "List of roles",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/transactions": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Get transactions by smena (smena_id is required)",
                "operationId": "aa5b4ca9ae5aaace5519ea5e2f882e13",
                "parameters": [
                    {
                        "name": "smena_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "product_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of transactions for the given smena",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/UserTransaction"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "smena_id is required"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Create a transaction",
                "operationId": "019545af9f566a2bc133330c98d37e6c",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UserTransactionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Transaction created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/UserTransaction"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/transactions/{id}": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Get a transaction",
                "operationId": "08774759c44a6c559b4b0ca4ccad1256",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Transaction details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/UserTransaction"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Update a transaction",
                "operationId": "ce513fa7686308708cbaba2f518a5082",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UserTransactionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Transaction updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/UserTransaction"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Delete a transaction",
                "operationId": "4b3d7c79f24b212e6847eb7765a5bd74",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Transaction deleted"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "Product": {
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "label": {
                        "type": "string",
                        "example": "Drabilka"
                    },
                    "name": {
                        "type": "string",
                        "example": "generated_drabilka",
                        "enum": [
                            "generated_drabilka",
                            "used_drabilka",
                            "used_granula",
                            "generated_foodbox",
                            "packaged_foodbox",
                            "sold_foodbox"
                        ]
                    },
                    "unit": {
                        "type": "string",
                        "example": "kg"
                    }
                },
                "type": "object"
            },
            "Smena": {
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "opened_time": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-03-31T08:00:00Z"
                    },
                    "closed_time": {
                        "type": "string",
                        "format": "date-time",
                        "example": null,
                        "nullable": true
                    },
                    "overall_used_granula": {
                        "type": "number",
                        "format": "float",
                        "example": 0
                    },
                    "overall_used_drabilka": {
                        "type": "number",
                        "format": "float",
                        "example": 0
                    },
                    "overall_foodbox_generated": {
                        "type": "number",
                        "format": "float",
                        "example": 0
                    },
                    "overall_foodbix_packaged": {
                        "type": "number",
                        "format": "float",
                        "example": 0
                    },
                    "overall_sold_foodbox": {
                        "type": "number",
                        "format": "float",
                        "example": 0
                    },
                    "overall_created_drabilka": {
                        "type": "number",
                        "format": "float",
                        "example": 0
                    },
                    "open_user_id": {
                        "type": "integer",
                        "example": 1,
                        "nullable": true
                    },
                    "closed_user_id": {
                        "type": "integer",
                        "example": null,
                        "nullable": true
                    },
                    "open_user": {
                        "properties": {
                            "id": {
                                "type": "integer",
                                "example": 1
                            },
                            "username": {
                                "type": "string",
                                "example": "admin"
                            }
                        },
                        "type": "object",
                        "nullable": true
                    },
                    "closed_user": {
                        "properties": {
                            "id": {
                                "type": "integer",
                                "example": 1
                            },
                            "username": {
                                "type": "string",
                                "example": "admin"
                            }
                        },
                        "type": "object",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "User": {
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "username": {
                        "type": "string",
                        "example": "john"
                    },
                    "pincode": {
                        "type": "string",
                        "example": "1234",
                        "nullable": true
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true
                    },
                    "role": {
                        "type": "string",
                        "example": "admin",
                        "nullable": true,
                        "enum": [
                            "admin",
                            "granulator_manager",
                            "granulator_aparat",
                            "sanovchi",
                            "sotuvchi"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "UserCreateRequest": {
                "required": [
                    "username",
                    "password",
                    "role"
                ],
                "properties": {
                    "username": {
                        "type": "string",
                        "example": "john"
                    },
                    "password": {
                        "type": "string",
                        "example": "secret123"
                    },
                    "pincode": {
                        "type": "string",
                        "example": "1234",
                        "nullable": true
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true
                    },
                    "role": {
                        "type": "string",
                        "example": "sotuvchi",
                        "enum": [
                            "admin",
                            "granulator_manager",
                            "granulator_aparat",
                            "sanovchi",
                            "sotuvchi"
                        ]
                    }
                },
                "type": "object"
            },
            "UserUpdateRequest": {
                "properties": {
                    "username": {
                        "type": "string",
                        "example": "john"
                    },
                    "password": {
                        "type": "string",
                        "example": "newpassword"
                    },
                    "pincode": {
                        "type": "string",
                        "example": "5678",
                        "nullable": true
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true
                    },
                    "role": {
                        "type": "string",
                        "example": "sanovchi",
                        "enum": [
                            "admin",
                            "granulator_manager",
                            "granulator_aparat",
                            "sanovchi",
                            "sotuvchi"
                        ]
                    }
                },
                "type": "object"
            },
            "UserTransaction": {
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "product_id": {
                        "type": "integer",
                        "example": 1
                    },
                    "product": {
                        "properties": {
                            "id": {
                                "type": "integer",
                                "example": 1
                            },
                            "name": {
                                "type": "string",
                                "example": "used_granula"
                            },
                            "unit": {
                                "type": "string",
                                "example": "kg"
                            }
                        },
                        "type": "object"
                    },
                    "value": {
                        "type": "number",
                        "format": "float",
                        "example": 12.5
                    },
                    "datetime": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-03-31T10:00:00Z"
                    },
                    "smena_id": {
                        "type": "integer",
                        "example": 1,
                        "nullable": true
                    },
                    "user_id": {
                        "type": "integer",
                        "example": 1,
                        "nullable": true
                    },
                    "user": {
                        "properties": {
                            "id": {
                                "type": "integer",
                                "example": 1
                            },
                            "username": {
                                "type": "string",
                                "example": "admin"
                            }
                        },
                        "type": "object",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "UserTransactionRequest": {
                "required": [
                    "product_id",
                    "value"
                ],
                "properties": {
                    "product_id": {
                        "type": "integer",
                        "example": 1
                    },
                    "value": {
                        "type": "number",
                        "format": "float",
                        "example": 12.5
                    },
                    "datetime": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-03-31T10:00:00Z",
                        "nullable": true
                    },
                    "smena_id": {
                        "type": "integer",
                        "example": 1,
                        "nullable": true
                    },
                    "user_id": {
                        "type": "integer",
                        "example": 1,
                        "nullable": true
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "description": "Enter token received from /api/auth/login",
                "bearerFormat": "Sanctum token",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Auth",
            "description": "Autentifikatsiya endpointlari"
        },
        {
            "name": "Users",
            "description": "Foydalanuvchilarni boshqarish"
        },
        {
            "name": "Products",
            "description": "Mahsulotlar"
        },
        {
            "name": "Transactions",
            "description": "Tranzaksiyalar"
        },
        {
            "name": "Smena",
            "description": "Smena boshqaruvi"
        },
        {
            "name": "Health",
            "description": "Health"
        }
    ]
}